Block class rename
This commit is contained in:
parent
4b55bf30a8
commit
5f3547de8e
157 changed files with 748 additions and 756 deletions
|
@ -4,7 +4,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.util.Tickable;
|
||||
import ru.betterend.blocks.BlockHydrothermalVent;
|
||||
import ru.betterend.blocks.HydrothermalVentBlock;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
|
@ -21,8 +21,8 @@ public class BlockEntityHydrothermalVent extends BlockEntity implements Tickable
|
|||
double y = pos.getY() + 0.9 + world.random.nextDouble() * 0.3;
|
||||
double z = pos.getZ() + world.random.nextDouble();
|
||||
BlockState state = getCachedState();
|
||||
if (state.isOf(EndBlocks.HYDROTHERMAL_VENT) && state.get(BlockHydrothermalVent.ACTIVATED)) {
|
||||
if (state.get(BlockHydrothermalVent.WATERLOGGED)) {
|
||||
if (state.isOf(EndBlocks.HYDROTHERMAL_VENT) && state.get(HydrothermalVentBlock.ACTIVATED)) {
|
||||
if (state.get(HydrothermalVentBlock.WATERLOGGED)) {
|
||||
world.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.text.TranslatableText;
|
|||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import ru.betterend.blocks.basis.BlockBarrel;
|
||||
import ru.betterend.blocks.basis.EndBarrelBlock;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
|
||||
public class EBarrelBlockEntity extends LootableContainerBlockEntity {
|
||||
|
@ -104,7 +104,7 @@ public class EBarrelBlockEntity extends LootableContainerBlockEntity {
|
|||
this.scheduleUpdate();
|
||||
} else {
|
||||
BlockState blockState = this.getCachedState();
|
||||
if (!(blockState.getBlock() instanceof BlockBarrel)) {
|
||||
if (!(blockState.getBlock() instanceof EndBarrelBlock)) {
|
||||
this.markRemoved();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||
import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
|
||||
import net.minecraft.util.Tickable;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.blocks.basis.BlockPedestal;
|
||||
import ru.betterend.blocks.basis.PedestalBlock;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
|
@ -76,8 +76,8 @@ public class PedestalBlockEntity extends BlockEntity implements Inventory, Ticka
|
|||
}
|
||||
|
||||
public void removeStack(World world, BlockState state) {
|
||||
world.setBlockState(pos, state.with(BlockPedestal.HAS_ITEM, false)
|
||||
.with(BlockPedestal.HAS_LIGHT, false));
|
||||
world.setBlockState(pos, state.with(PedestalBlock.HAS_ITEM, false)
|
||||
.with(PedestalBlock.HAS_LIGHT, false));
|
||||
this.removeStack(0);
|
||||
}
|
||||
|
||||
|
@ -91,12 +91,12 @@ public class PedestalBlockEntity extends BlockEntity implements Inventory, Ticka
|
|||
public void markDirty() {
|
||||
if (world != null && !world.isClient) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
if (state.getBlock() instanceof BlockPedestal) {
|
||||
state = state.with(BlockPedestal.HAS_ITEM, !isEmpty());
|
||||
if (state.getBlock() instanceof PedestalBlock) {
|
||||
state = state.with(PedestalBlock.HAS_ITEM, !isEmpty());
|
||||
if (activeItem.getItem() == EndItems.ETERNAL_CRYSTAL) {
|
||||
state = state.with(BlockPedestal.HAS_LIGHT, true);
|
||||
state = state.with(PedestalBlock.HAS_LIGHT, true);
|
||||
} else {
|
||||
state = state.with(BlockPedestal.HAS_LIGHT, false);
|
||||
state = state.with(PedestalBlock.HAS_LIGHT, false);
|
||||
}
|
||||
world.setBlockState(pos, state);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.util.math.Direction;
|
|||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.BlockChest;
|
||||
import ru.betterend.blocks.basis.EndChestBlock;
|
||||
import ru.betterend.blocks.entities.EChestBlockEntity;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
|
@ -165,7 +165,7 @@ public class EndChestBlockEntityRenderer extends BlockEntityRenderer<EChestBlock
|
|||
EndItems.getModBlocks().forEach((item) -> {
|
||||
if (item instanceof BlockItem) {
|
||||
Block block = ((BlockItem) item).getBlock();
|
||||
if (block instanceof BlockChest) {
|
||||
if (block instanceof EndChestBlock) {
|
||||
String name = Registry.BLOCK.getId(block).getPath();
|
||||
LAYERS.put(block, new RenderLayer[] {
|
||||
RenderLayer.getEntityCutout(BetterEnd.makeID("textures/entity/chest/" + name + ".png")),
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.util.SignType;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.BlockSign;
|
||||
import ru.betterend.blocks.basis.EndSignBlock;
|
||||
import ru.betterend.blocks.entities.ESignBlockEntity;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class EndSignBlockEntityRenderer extends BlockEntityRenderer<ESignBlockEn
|
|||
float angle = -((float) ((Integer) state.get(SignBlock.ROTATION) * 360) / 16.0F);
|
||||
|
||||
BlockState blockState = signBlockEntity.getCachedState();
|
||||
if (blockState.get(BlockSign.FLOOR)) {
|
||||
if (blockState.get(EndSignBlock.FLOOR)) {
|
||||
matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(angle));
|
||||
this.model.foot.visible = true;
|
||||
} else {
|
||||
|
@ -109,7 +109,7 @@ public class EndSignBlockEntityRenderer extends BlockEntityRenderer<ESignBlockEn
|
|||
EndItems.getModBlocks().forEach((item) -> {
|
||||
if (item instanceof BlockItem) {
|
||||
Block block = ((BlockItem) item).getBlock();
|
||||
if (block instanceof BlockSign) {
|
||||
if (block instanceof EndSignBlock) {
|
||||
String name = Registry.BLOCK.getId(block).getPath();
|
||||
RenderLayer layer = RenderLayer.getEntitySolid(BetterEnd.makeID("textures/entity/sign/" + name + ".png"));
|
||||
LAYERS.put(block, layer);
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import ru.betterend.blocks.EternalPedestal;
|
||||
import ru.betterend.blocks.basis.BlockPedestal;
|
||||
import ru.betterend.blocks.basis.PedestalBlock;
|
||||
import ru.betterend.blocks.entities.PedestalBlockEntity;
|
||||
import ru.betterend.client.render.BeamRenderer;
|
||||
import ru.betterend.client.render.EndCrystalRenderer;
|
||||
|
@ -38,14 +38,14 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> extends BlockEn
|
|||
if (blockEntity.isEmpty()) return;
|
||||
|
||||
BlockState state = blockEntity.getWorld().getBlockState(blockEntity.getPos());
|
||||
if (!(state.getBlock() instanceof BlockPedestal)) return;
|
||||
if (!(state.getBlock() instanceof PedestalBlock)) return;
|
||||
|
||||
ItemStack activeItem = blockEntity.getStack(0);
|
||||
matrices.push();
|
||||
MinecraftClient minecraft = MinecraftClient.getInstance();
|
||||
BakedModel model = minecraft.getItemRenderer().getHeldItemModel(activeItem, blockEntity.getWorld(), null);
|
||||
Vector3f translate = model.getTransformation().ground.translation;
|
||||
BlockPedestal pedestal = (BlockPedestal) state.getBlock();
|
||||
PedestalBlock pedestal = (PedestalBlock) state.getBlock();
|
||||
matrices.translate(translate.getX(), translate.getY(), translate.getZ());
|
||||
matrices.translate(0.5, pedestal.getHeight(state), 0.5);
|
||||
if (activeItem.getItem() instanceof BlockItem) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue