Reformated
This commit is contained in:
parent
fc1da134e7
commit
60e8008cb7
416 changed files with 5772 additions and 4573 deletions
|
@ -1,10 +1,10 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import org.betterx.bclib.blocks.LeveledAnvilBlock;
|
||||
import org.betterx.betterend.complexmaterials.MetalMaterial;
|
||||
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
public class EndAnvilBlock extends LeveledAnvilBlock {
|
||||
protected MetalMaterial metalMaterial;
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlockNotFull;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
|
||||
import net.minecraft.client.resources.model.UnbakedModel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
|
@ -24,10 +28,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlockNotFull;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -91,12 +91,14 @@ public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterlogg
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
Boolean water = state.getValue(WATERLOGGED);
|
||||
if (water) {
|
||||
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||
|
@ -125,9 +127,11 @@ public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterlogg
|
|||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public UnbakedModel getModelVariant(ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||
public UnbakedModel getModelVariant(
|
||||
ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache
|
||||
) {
|
||||
String floor = blockState.getValue(IS_FLOOR) ? "_floor" : "";
|
||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + floor);
|
||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
|
||||
import org.betterx.bclib.blocks.BasePlantBlock;
|
||||
import org.betterx.betterend.interfaces.PottablePlant;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class EndPlantBlock extends BasePlantBlock implements PottablePlant {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
|
||||
import org.betterx.bclib.blocks.BasePlantWithAgeBlock;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
|
||||
import org.betterx.bclib.blocks.BaseTerrainBlock;
|
||||
import org.betterx.bclib.interfaces.TagProvider;
|
||||
import org.betterx.betterend.interfaces.PottableTerrain;
|
||||
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
|
||||
import org.betterx.bclib.blocks.BaseTerrainBlock;
|
||||
import org.betterx.bclib.interfaces.TagProvider;
|
||||
import org.betterx.betterend.interfaces.PottableTerrain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EndTerrainBlock extends BaseTerrainBlock implements PottableTerrain, TagProvider {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import org.betterx.bclib.blocks.TripleTerrainBlock;
|
||||
import org.betterx.betterend.interfaces.PottableTerrain;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
public class EndTripleTerrain extends TripleTerrainBlock implements PottableTerrain {
|
||||
public EndTripleTerrain(MaterialColor color) {
|
||||
super(Blocks.END_STONE, color);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
|
||||
import org.betterx.bclib.blocks.UnderwaterPlantBlock;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
|
||||
import org.betterx.bclib.blocks.BaseUnderwaterWallPlantBlock;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock {
|
||||
|
||||
public EndUnderwaterWallPlantBlock() {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
|
||||
import org.betterx.bclib.blocks.WallMushroomBlock;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class EndWallMushroom extends WallMushroomBlock {
|
||||
|
||||
public EndWallMushroom(int light) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.CommonBlockTags;
|
||||
import org.betterx.bclib.blocks.BaseWallPlantBlock;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class EndWallPlantBlock extends BaseWallPlantBlock {
|
||||
public EndWallPlantBlock() {
|
||||
}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.api.v2.tag.NamedBlockTags;
|
||||
import org.betterx.bclib.api.v2.tag.TagAPI;
|
||||
import org.betterx.bclib.blocks.BaseAttachedBlock;
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.bclib.items.tool.BaseShearsItem;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -20,14 +29,6 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.betterx.bclib.api.v2.tag.NamedBlockTags;
|
||||
import org.betterx.bclib.api.v2.tag.TagAPI;
|
||||
import org.betterx.bclib.blocks.BaseAttachedBlock;
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.bclib.items.tool.BaseShearsItem;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
|
@ -69,7 +70,7 @@ public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider,
|
|||
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
|
||||
Enchantments.SILK_TOUCH,
|
||||
tool
|
||||
) > 0) {
|
||||
) > 0) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
} else if (dropChance < 1 || MHelper.RANDOM.nextInt(dropChance) == 0) {
|
||||
return Lists.newArrayList(new ItemStack(drop));
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
@ -7,8 +9,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class LitBaseBlock extends BaseBlock {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseRotatedPillarBlock;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseRotatedPillarBlock;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class LitPillarBlock extends BaseRotatedPillarBlock {
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlockNotFull;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
import org.betterx.betterend.blocks.EndBlockProperties;
|
||||
import org.betterx.betterend.blocks.EndBlockProperties.PedestalState;
|
||||
import org.betterx.betterend.blocks.InfusionPedestal;
|
||||
import org.betterx.betterend.blocks.entities.InfusionPedestalEntity;
|
||||
import org.betterx.betterend.blocks.entities.PedestalBlockEntity;
|
||||
import org.betterx.betterend.client.models.Patterns;
|
||||
import org.betterx.betterend.rituals.InfusionRitual;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
import net.minecraft.client.resources.model.UnbakedModel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
@ -36,16 +47,6 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.betterx.bclib.blocks.BaseBlockNotFull;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
import org.betterx.betterend.blocks.EndBlockProperties;
|
||||
import org.betterx.betterend.blocks.EndBlockProperties.PedestalState;
|
||||
import org.betterx.betterend.blocks.InfusionPedestal;
|
||||
import org.betterx.betterend.blocks.entities.InfusionPedestalEntity;
|
||||
import org.betterx.betterend.blocks.entities.PedestalBlockEntity;
|
||||
import org.betterx.betterend.client.models.Patterns;
|
||||
import org.betterx.betterend.rituals.InfusionRitual;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
@ -77,7 +78,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
.setValue(STATE, PedestalState.DEFAULT)
|
||||
.setValue(HAS_ITEM, false)
|
||||
.setValue(HAS_LIGHT, false)
|
||||
);
|
||||
);
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
@ -98,12 +99,14 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public InteractionResult use(BlockState state,
|
||||
Level level,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit) {
|
||||
public InteractionResult use(
|
||||
BlockState state,
|
||||
Level level,
|
||||
BlockPos pos,
|
||||
Player player,
|
||||
InteractionHand hand,
|
||||
BlockHitResult hit
|
||||
) {
|
||||
if (!state.is(this) || !isPlaceable(state)) {
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
|
@ -188,12 +191,14 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom) {
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom
|
||||
) {
|
||||
BlockState updated = getUpdatedState(state, direction, newState, world, pos, posFrom);
|
||||
if (!updated.is(this)) return updated;
|
||||
if (!isPlaceable(updated)) {
|
||||
|
@ -202,12 +207,14 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
return updated;
|
||||
}
|
||||
|
||||
private BlockState getUpdatedState(BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom) {
|
||||
private BlockState getUpdatedState(
|
||||
BlockState state,
|
||||
Direction direction,
|
||||
BlockState newState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos posFrom
|
||||
) {
|
||||
if (!state.is(this)) return state.updateShape(direction, newState, world, pos, posFrom);
|
||||
if (direction != Direction.UP && direction != Direction.DOWN) return state;
|
||||
BlockState upState = world.getBlockState(pos.above());
|
||||
|
@ -411,9 +418,11 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public UnbakedModel getModelVariant(ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||
public UnbakedModel getModelVariant(
|
||||
ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache
|
||||
) {
|
||||
PedestalState state = blockState.getValue(STATE);
|
||||
ResourceLocation modelId = new ResourceLocation(
|
||||
stateId.getNamespace(),
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseCropBlock;
|
||||
import org.betterx.betterend.interfaces.PottablePlant;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
public class PottableCropBlock extends BaseCropBlock implements PottablePlant {
|
||||
private final Block[] terrain;
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.blocks.FeatureSaplingBlock;
|
||||
import org.betterx.betterend.interfaces.PottablePlant;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public abstract class PottableFeatureSapling extends FeatureSaplingBlock implements PottablePlant {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseLeavesBlock;
|
||||
import org.betterx.betterend.interfaces.PottablePlant;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
public class PottableLeavesBlock extends BaseLeavesBlock implements PottablePlant {
|
||||
|
||||
public PottableLeavesBlock(Block sapling, MaterialColor color) {
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
import org.betterx.bclib.interfaces.CustomColorProvider;
|
||||
import org.betterx.betterend.client.models.Patterns;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.client.color.block.BlockColor;
|
||||
import net.minecraft.client.color.item.ItemColor;
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
|
@ -15,11 +20,6 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
import org.betterx.bclib.interfaces.CustomColorProvider;
|
||||
import org.betterx.betterend.client.models.Patterns;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import java.util.Optional;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class StoneLanternBlock extends EndLanternBlock implements CustomColorPro
|
|||
Patterns.BLOCK_STONE_LANTERN_FLOOR,
|
||||
blockName,
|
||||
blockName
|
||||
)
|
||||
)
|
||||
: Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, blockName, blockName);
|
||||
return ModelsHelper.fromPattern(pattern);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue