diff --git a/src/main/java/io/github/cottonmc/templates/Templates.java b/src/main/java/io/github/cottonmc/templates/Templates.java index fa613ee..610fec7 100644 --- a/src/main/java/io/github/cottonmc/templates/Templates.java +++ b/src/main/java/io/github/cottonmc/templates/Templates.java @@ -16,7 +16,7 @@ public class Templates implements ModInitializer { public static final Block SLOPE = register("slope", new SlopeBlock(), ItemGroup.DECORATIONS); @SuppressWarnings("unchecked") - public static final BlockEntityType SLOPE_ENTITY = register("slope", SlopeEntity::new, SLOPE); + public static final BlockEntityType SLOPE_ENTITY = register("slope", SlopeEntity::new, SLOPE); @Override public void onInitialize() { @@ -31,7 +31,7 @@ public class Templates implements ModInitializer { } @SuppressWarnings("rawtypes") - public static BlockEntityType register(String name, Supplier be, Block...blocks) { + public static BlockEntityType register(String name, Supplier be, Block...blocks) { return Registry.register(Registry.BLOCK_ENTITY, new Identifier(MODID, name), BlockEntityType.Builder.create(be, blocks).build(null)); } @@ -39,5 +39,4 @@ public class Templates implements ModInitializer { Registry.register(Registry.ITEM, new Identifier(MODID, name), item); return item; } - } diff --git a/src/main/java/io/github/cottonmc/templates/block/SlopeBlock.java b/src/main/java/io/github/cottonmc/templates/block/SlopeBlock.java index 73c0277..d9de768 100644 --- a/src/main/java/io/github/cottonmc/templates/block/SlopeBlock.java +++ b/src/main/java/io/github/cottonmc/templates/block/SlopeBlock.java @@ -1,7 +1,7 @@ package io.github.cottonmc.templates.block; import io.github.cottonmc.templates.block.entity.SlopeEntity; -import net.fabricmc.fabric.api.block.FabricBlockSettings; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.EntityContext; @@ -27,7 +27,7 @@ public class SlopeBlock extends TemplateBlock { public static final VoxelShape WEST = VoxelShapes.cuboid(0f, 0.5f, 0f, 0.5f, 1f, 1f); public SlopeBlock() { - super(FabricBlockSettings.of(Material.WOOD).build()); + super(FabricBlockSettings.of(Material.WOOD)); this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH).with(LIGHT, 0).with(REDSTONE, false)); } diff --git a/src/main/java/io/github/cottonmc/templates/block/entity/TemplateEntity.java b/src/main/java/io/github/cottonmc/templates/block/entity/TemplateEntity.java index 818b838..f861e71 100644 --- a/src/main/java/io/github/cottonmc/templates/block/entity/TemplateEntity.java +++ b/src/main/java/io/github/cottonmc/templates/block/entity/TemplateEntity.java @@ -1,8 +1,8 @@ package io.github.cottonmc.templates.block.entity; import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable; +import net.fabricmc.fabric.api.networking.v1.PlayerLookup; import net.fabricmc.fabric.api.rendering.data.v1.RenderAttachmentBlockEntity; -import net.fabricmc.fabric.api.server.PlayerStream; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -18,7 +18,7 @@ public abstract class TemplateEntity extends BlockEntity implements BlockEntityC protected BlockState renderedState = Blocks.AIR.getDefaultState(); protected boolean glowstone = false; protected boolean redstone = false; - private Block baseBlock; + private final Block baseBlock; public TemplateEntity(BlockEntityType type, Block baseBlock) { super(type); @@ -71,8 +71,7 @@ public abstract class TemplateEntity extends BlockEntity implements BlockEntityC public void markDirty() { super.markDirty(); if (world != null && !world.isClient) { - for (Object obj : PlayerStream.watching(this).toArray()) { - ServerPlayerEntity player = (ServerPlayerEntity) obj; + for(ServerPlayerEntity player : PlayerLookup.tracking(this)) { player.networkHandler.sendPacket(this.toUpdatePacket()); } world.updateNeighborsAlways(pos.offset(Direction.UP), baseBlock); diff --git a/src/main/java/io/github/cottonmc/templates/util/SpriteSet.java b/src/main/java/io/github/cottonmc/templates/util/SpriteSet.java index 6d12508..14b4d23 100644 --- a/src/main/java/io/github/cottonmc/templates/util/SpriteSet.java +++ b/src/main/java/io/github/cottonmc/templates/util/SpriteSet.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.Random; import net.minecraft.client.texture.MissingSprite; -import org.apache.commons.lang3.ObjectUtils; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.fabricmc.fabric.api.renderer.v1.model.ModelHelper;