diff --git a/build.gradle b/build.gradle index 4e0cdb9..2bf21f9 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { } } dependencies { - classpath "net.fabricmc:fabric-loom:0.2.6-SNAPSHOT" + classpath "net.fabricmc:fabric-loom:0.4-SNAPSHOT" } } @@ -26,16 +26,16 @@ targetCompatibility = 1.8 group = "com.reddit.user.koppeh.flamingo" archivesBaseName = "Flamingo" -version = "1.15.2-1.16" +version = "1.16-1.17" minecraft { } dependencies { - minecraft "com.mojang:minecraft:1.15.2" - mappings "net.fabricmc:yarn:1.15.2+build.14:v2" - modCompile "net.fabricmc:fabric-loader:0.7.8+build.187" - modCompile "net.fabricmc.fabric-api:fabric-api:0.5.1+build.294-1.15" + minecraft "com.mojang:minecraft:1.16" + mappings "net.fabricmc:yarn:1.16+build.1:v2" + modImplementation "net.fabricmc:fabric-loader:0.8.8+build.202" + modImplementation "net.fabricmc.fabric-api:fabric-api:0.13.1+build.370-1.16" } processResources { diff --git a/src/main/java/com/reddit/user/koppeh/flamingo/FlamingoBlock.java b/src/main/java/com/reddit/user/koppeh/flamingo/FlamingoBlock.java index e8f7ac6..61f5ae2 100644 --- a/src/main/java/com/reddit/user/koppeh/flamingo/FlamingoBlock.java +++ b/src/main/java/com/reddit/user/koppeh/flamingo/FlamingoBlock.java @@ -5,8 +5,8 @@ import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; +import net.minecraft.block.ShapeContext; import net.minecraft.block.entity.BlockEntity; -import net.minecraft.entity.EntityContext; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; @@ -32,7 +32,7 @@ public FlamingoBlock(Settings settings) { @Override @Deprecated - public VoxelShape getOutlineShape(BlockState blockState_1, BlockView blockView_1, BlockPos blockPos_1, EntityContext context) { + public VoxelShape getOutlineShape(BlockState blockState_1, BlockView blockView_1, BlockPos blockPos_1, ShapeContext context) { return OUTLINE_SHAPE; } @@ -63,13 +63,13 @@ public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity p public boolean onAttackInteraction(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, Direction direction) { BlockEntity blockEntity = world.getBlockEntity(pos); if (!world.isClient && blockEntity instanceof FlamingoBlockEntity) { - world.addBlockAction(pos, this, 0, 0); + world.addSyncedBlockEvent(pos, this, 0, 0); } return false; } @Override - public boolean onBlockAction(BlockState state, World world, BlockPos pos, int type, int data) { + public boolean onSyncedBlockEvent(BlockState state, World world, BlockPos pos, int type, int data) { if (world.getBlockEntity(pos) != null) { ((FlamingoBlockEntity) world.getBlockEntity(pos)).wiggle(); return true; diff --git a/src/main/java/com/reddit/user/koppeh/flamingo/client/mixin/ItemDynamicRendererMixin.java b/src/main/java/com/reddit/user/koppeh/flamingo/client/mixin/ItemDynamicRendererMixin.java index 708df22..962d599 100644 --- a/src/main/java/com/reddit/user/koppeh/flamingo/client/mixin/ItemDynamicRendererMixin.java +++ b/src/main/java/com/reddit/user/koppeh/flamingo/client/mixin/ItemDynamicRendererMixin.java @@ -5,6 +5,7 @@ import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher; import net.minecraft.client.render.item.BuiltinModelItemRenderer; +import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; @@ -19,7 +20,7 @@ public class ItemDynamicRendererMixin { private final FlamingoBlockEntity flamingoRender = new FlamingoBlockEntity(); @Inject(at = @At("HEAD"), method = "render", cancellable = true) - public void render(ItemStack stack, MatrixStack matrix, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, CallbackInfo info) { + public void render(ItemStack stack, ModelTransformation.Mode mode, MatrixStack matrix, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, CallbackInfo info) { if (Registry.ITEM.getId(stack.getItem()).equals(new Identifier(Flamingo.MOD_ID, "flamingo"))) { BlockEntityRenderDispatcher.INSTANCE.renderEntity(this.flamingoRender, matrix, vertexConsumerProvider, light, overlay); info.cancel();