From 61cf62572b52fb07d6ac3d2457fedd703e190445 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Mon, 1 Jul 2024 16:43:31 +0200 Subject: [PATCH] Update to MC 1.21 --- build.gradle | 14 +- gradle.properties | 6 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../org/cyclops/flopper/RegistryEntries.java | 6 +- .../cyclops/flopper/block/BlockFlopper.java | 147 ++++++++++-------- .../blockentity/BlockEntityFlopper.java | 13 +- .../blockentity/FluidHandlerBlock.java | 6 +- .../blockentity/RenderBlockEntityFlopper.java | 8 +- .../{mods.toml => neoforge.mods.toml} | 0 9 files changed, 108 insertions(+), 94 deletions(-) rename src/main/resources/META-INF/{mods.toml => neoforge.mods.toml} (100%) diff --git a/build.gradle b/build.gradle index 96031e9..9c591b6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'net.neoforged.gradle.userdev' version '7.0.97' + id 'net.neoforged.gradle.userdev' version '7.0.145' id 'net.darkhax.curseforgegradle' version '1.0.8' id 'com.diffplug.spotless' version '5.14.3' id 'com.modrinth.minotaur' version '2.+' @@ -31,7 +31,7 @@ base { } // Set Java details -java.toolchain.languageVersion = JavaLanguageVersion.of(17) +java.toolchain.languageVersion = JavaLanguageVersion.of(21) compileJava.options.compilerArgs << "-Xmaxerrs" << "9999" println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) @@ -75,10 +75,10 @@ dependencies { } // Project lombok - compileOnly 'org.projectlombok:lombok:1.18.22' - annotationProcessor 'org.projectlombok:lombok:1.18.22' - testCompileOnly 'org.projectlombok:lombok:1.18.22' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.22' + compileOnly 'org.projectlombok:lombok:1.18.30' + annotationProcessor 'org.projectlombok:lombok:1.18.30' + testCompileOnly 'org.projectlombok:lombok:1.18.30' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.30' } runs { @@ -261,6 +261,8 @@ publishing { idea { module { + downloadSources = true + downloadJavadoc = true for (String excludeDirName in ["run", "out", "logs", "gradle"]) { File excludeDir = new File(projectDir, excludeDirName) excludeDirs.add(excludeDir) diff --git a/gradle.properties b/gradle.properties index 6cf6cfe..83d0712 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ mod_id=flopper mod_version=1.1.5 -minecraft_version=1.20.4 -neoforge_version=20.4.160-beta -cyclopscore_version=1.19.0-408 +minecraft_version=1.21 +neoforge_version=21.0.43-beta +cyclopscore_version=1.19.1-451 release_type=release fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..20db9ad 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/org/cyclops/flopper/RegistryEntries.java b/src/main/java/org/cyclops/flopper/RegistryEntries.java index b5ce514..feb1f8f 100644 --- a/src/main/java/org/cyclops/flopper/RegistryEntries.java +++ b/src/main/java/org/cyclops/flopper/RegistryEntries.java @@ -14,8 +14,8 @@ */ public class RegistryEntries { - public static final DeferredHolder ITEM_FLOPPER = DeferredHolder.create(Registries.ITEM, new ResourceLocation("flopper:flopper")); - public static final DeferredHolder BLOCK_FLOPPER = DeferredHolder.create(Registries.BLOCK, new ResourceLocation("flopper:flopper")); - public static final DeferredHolder, BlockEntityType> BLOCK_ENTITY_FLOPPER = DeferredHolder.create(Registries.BLOCK_ENTITY_TYPE, new ResourceLocation("flopper:flopper")); + public static final DeferredHolder ITEM_FLOPPER = DeferredHolder.create(Registries.ITEM, ResourceLocation.parse("flopper:flopper")); + public static final DeferredHolder BLOCK_FLOPPER = DeferredHolder.create(Registries.BLOCK, ResourceLocation.parse("flopper:flopper")); + public static final DeferredHolder, BlockEntityType> BLOCK_ENTITY_FLOPPER = DeferredHolder.create(Registries.BLOCK_ENTITY_TYPE, ResourceLocation.parse("flopper:flopper")); } diff --git a/src/main/java/org/cyclops/flopper/block/BlockFlopper.java b/src/main/java/org/cyclops/flopper/block/BlockFlopper.java index d600668..5f1ba9d 100644 --- a/src/main/java/org/cyclops/flopper/block/BlockFlopper.java +++ b/src/main/java/org/cyclops/flopper/block/BlockFlopper.java @@ -8,6 +8,7 @@ import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; @@ -21,7 +22,6 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.entity.Hopper; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; @@ -33,17 +33,16 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.neoforged.bus.api.Event; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.common.SoundActions; +import net.neoforged.neoforge.common.util.TriState; import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import net.neoforged.neoforge.fluids.FluidActionResult; import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.FluidUtil; import net.neoforged.neoforge.fluids.capability.IFluidHandler; -import net.neoforged.neoforge.items.ItemHandlerHelper; import org.cyclops.cyclopscore.block.BlockWithEntity; import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity; import org.cyclops.cyclopscore.helper.BlockEntityHelpers; @@ -68,20 +67,21 @@ public class BlockFlopper extends BlockWithEntity { public static final BooleanProperty ENABLED = BlockStateProperties.ENABLED; // Copied from HopperBlock, to avoid conflicts with other mods messing with the hopper - private static final VoxelShape INPUT_SHAPE = Block.box(0.0D, 10.0D, 0.0D, 16.0D, 16.0D, 16.0D); - private static final VoxelShape MIDDLE_SHAPE = Block.box(4.0D, 4.0D, 4.0D, 12.0D, 10.0D, 12.0D); - private static final VoxelShape INPUT_MIDDLE_SHAPE = Shapes.or(MIDDLE_SHAPE, INPUT_SHAPE); - private static final VoxelShape BASE_SHAPE = Shapes.join(INPUT_MIDDLE_SHAPE, Hopper.INSIDE, BooleanOp.ONLY_FIRST); - private static final VoxelShape DOWN_SHAPE = Shapes.or(BASE_SHAPE, Block.box(6.0D, 0.0D, 6.0D, 10.0D, 4.0D, 10.0D)); - private static final VoxelShape EAST_SHAPE = Shapes.or(BASE_SHAPE, Block.box(12.0D, 4.0D, 6.0D, 16.0D, 8.0D, 10.0D)); - private static final VoxelShape NORTH_SHAPE = Shapes.or(BASE_SHAPE, Block.box(6.0D, 4.0D, 0.0D, 10.0D, 8.0D, 4.0D)); - private static final VoxelShape SOUTH_SHAPE = Shapes.or(BASE_SHAPE, Block.box(6.0D, 4.0D, 12.0D, 10.0D, 8.0D, 16.0D)); - private static final VoxelShape WEST_SHAPE = Shapes.or(BASE_SHAPE, Block.box(0.0D, 4.0D, 6.0D, 4.0D, 8.0D, 10.0D)); - private static final VoxelShape DOWN_RAYTRACE_SHAPE = Hopper.INSIDE; - private static final VoxelShape EAST_RAYTRACE_SHAPE = Shapes.or(Hopper.INSIDE, Block.box(12.0D, 8.0D, 6.0D, 16.0D, 10.0D, 10.0D)); - private static final VoxelShape NORTH_RAYTRACE_SHAPE = Shapes.or(Hopper.INSIDE, Block.box(6.0D, 8.0D, 0.0D, 10.0D, 10.0D, 4.0D)); - private static final VoxelShape SOUTH_RAYTRACE_SHAPE = Shapes.or(Hopper.INSIDE, Block.box(6.0D, 8.0D, 12.0D, 10.0D, 10.0D, 16.0D)); - private static final VoxelShape WEST_RAYTRACE_SHAPE = Shapes.or(Hopper.INSIDE, Block.box(0.0D, 8.0D, 6.0D, 4.0D, 10.0D, 10.0D)); + private static final VoxelShape TOP = Block.box(0.0, 10.0, 0.0, 16.0, 16.0, 16.0); + private static final VoxelShape FUNNEL = Block.box(4.0, 4.0, 4.0, 12.0, 10.0, 12.0); + private static final VoxelShape CONVEX_BASE = Shapes.or(FUNNEL, TOP); + private static final VoxelShape INSIDE = box(2.0, 11.0, 2.0, 14.0, 16.0, 14.0); + private static final VoxelShape BASE = Shapes.join(CONVEX_BASE, INSIDE, BooleanOp.ONLY_FIRST); + private static final VoxelShape DOWN_SHAPE = Shapes.or(BASE, Block.box(6.0, 0.0, 6.0, 10.0, 4.0, 10.0)); + private static final VoxelShape EAST_SHAPE = Shapes.or(BASE, Block.box(12.0, 4.0, 6.0, 16.0, 8.0, 10.0)); + private static final VoxelShape NORTH_SHAPE = Shapes.or(BASE, Block.box(6.0, 4.0, 0.0, 10.0, 8.0, 4.0)); + private static final VoxelShape SOUTH_SHAPE = Shapes.or(BASE, Block.box(6.0, 4.0, 12.0, 10.0, 8.0, 16.0)); + private static final VoxelShape WEST_SHAPE = Shapes.or(BASE, Block.box(0.0, 4.0, 6.0, 4.0, 8.0, 10.0)); + private static final VoxelShape DOWN_INTERACTION_SHAPE = INSIDE; + private static final VoxelShape EAST_INTERACTION_SHAPE = Shapes.or(INSIDE, Block.box(12.0, 8.0, 6.0, 16.0, 10.0, 10.0)); + private static final VoxelShape NORTH_INTERACTION_SHAPE = Shapes.or(INSIDE, Block.box(6.0, 8.0, 0.0, 10.0, 10.0, 4.0)); + private static final VoxelShape SOUTH_INTERACTION_SHAPE = Shapes.or(INSIDE, Block.box(6.0, 8.0, 12.0, 10.0, 10.0, 16.0)); + private static final VoxelShape WEST_INTERACTION_SHAPE = Shapes.or(INSIDE, Block.box(0.0, 8.0, 6.0, 4.0, 10.0, 10.0)); public BlockFlopper(Properties properties, BiFunction blockEntitySupplier) { super(properties, blockEntitySupplier); @@ -122,7 +122,7 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, case EAST: return EAST_SHAPE; default: - return BASE_SHAPE; + return BASE; } } @@ -131,17 +131,17 @@ public VoxelShape getInteractionShape(BlockState state, BlockGetter worldIn, Blo // Copied from HopperBlock, to avoid conflicts with other mods messing with the hopper switch((Direction)state.getValue(FACING)) { case DOWN: - return DOWN_RAYTRACE_SHAPE; + return DOWN_INTERACTION_SHAPE; case NORTH: - return NORTH_RAYTRACE_SHAPE; + return NORTH_INTERACTION_SHAPE; case SOUTH: - return SOUTH_RAYTRACE_SHAPE; + return SOUTH_INTERACTION_SHAPE; case WEST: - return WEST_RAYTRACE_SHAPE; + return WEST_INTERACTION_SHAPE; case EAST: - return EAST_RAYTRACE_SHAPE; + return EAST_INTERACTION_SHAPE; default: - return Hopper.INSIDE; + return INSIDE; } } @@ -192,62 +192,73 @@ public BlockState mirror(BlockState state, Mirror mirrorIn) { } @Override - public boolean isPathfindable(BlockState state, BlockGetter worldIn, BlockPos pos, PathComputationType type) { + public boolean isPathfindable(BlockState state, PathComputationType type) { return false; } @Override - public InteractionResult use(BlockState blockState, Level world, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult rayTraceResult) { - InteractionResult activatedSuper = super.use(blockState, world, blockPos, player, hand, rayTraceResult); + protected InteractionResult useWithoutItem(BlockState blockState, Level level, BlockPos pos, Player player, BlockHitResult rayTraceResult) { + InteractionResult activatedSuper = super.useWithoutItem(blockState, level, pos, player, rayTraceResult); if (activatedSuper.consumesAction()) { return activatedSuper; } - return BlockEntityHelpers.getCapability(world, blockPos, Capabilities.FluidHandler.BLOCK) + + return BlockEntityHelpers.getCapability(level, pos, Capabilities.FluidHandler.BLOCK) .map(fluidHandler -> { - ItemStack itemStack = player.getItemInHand(hand); - if (itemStack.isEmpty()) { - if (BlockFlopperConfig.showContentsStatusMessageOnClick) { - // If the hand is empty, show the tank contents - FluidStack fluidStack = fluidHandler.drain(Integer.MAX_VALUE, IFluidHandler.FluidAction.SIMULATE); - if (fluidStack.isEmpty()) { - player.displayClientMessage(Component.literal("0 / " - + String.format("%,d", fluidHandler.getTankCapacity(0))), true); - } else { - player.displayClientMessage(Component.translatable(fluidStack.getTranslationKey()) - .append(Component.literal(": " - + String.format("%,d", fluidStack.getAmount()) + " / " - + String.format("%,d", fluidHandler.getTankCapacity(0)))), true); - } - return InteractionResult.SUCCESS; + if (BlockFlopperConfig.showContentsStatusMessageOnClick) { + // If the hand is empty, show the tank contents + FluidStack fluidStack = fluidHandler.drain(Integer.MAX_VALUE, IFluidHandler.FluidAction.SIMULATE); + if (fluidStack.isEmpty()) { + player.displayClientMessage(Component.literal("0 / " + + String.format("%,d", fluidHandler.getTankCapacity(0))), true); + } else { + player.displayClientMessage(fluidStack.getHoverName().plainCopy() + .append(Component.literal(": " + + String.format("%,d", fluidStack.getAmount()) + " / " + + String.format("%,d", fluidHandler.getTankCapacity(0)))), true); } - } else { - if (!player.isCrouching() - && tryEmptyContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, false).isSuccess()) { - // Move fluid from the item into the tank if not sneaking - FluidActionResult result = FluidUtil.tryEmptyContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, true); - if (result.isSuccess()) { - ItemStack drainedItem = result.getResult(); - if (!player.isCreative()) { - InventoryHelpers.tryReAddToStack(player, itemStack, drainedItem, hand); - } + return InteractionResult.SUCCESS; + } + return InteractionResult.PASS; + }) + .orElse(InteractionResult.PASS); + } + + @Override + protected ItemInteractionResult useItemOn(ItemStack itemStack, BlockState blockState, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult rayTraceResult) { + ItemInteractionResult activatedSuper = super.useItemOn(itemStack, blockState, level, pos, player, hand, rayTraceResult); + if (activatedSuper.consumesAction()) { + return activatedSuper; + } + + return BlockEntityHelpers.getCapability(level, pos, Capabilities.FluidHandler.BLOCK) + .map(fluidHandler -> { + if (!player.isCrouching() + && tryEmptyContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, false).isSuccess()) { + // Move fluid from the item into the tank if not sneaking + FluidActionResult result = FluidUtil.tryEmptyContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, true); + if (result.isSuccess()) { + ItemStack drainedItem = result.getResult(); + if (!player.isCreative()) { + InventoryHelpers.tryReAddToStack(player, itemStack, drainedItem, hand); } - return InteractionResult.SUCCESS; - } else if (player.isCrouching() - && FluidUtil.tryFillContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, false).isSuccess()) { - // Move fluid from the tank into the item if sneaking - FluidActionResult result = FluidUtil.tryFillContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, true); - if (result.isSuccess()) { - ItemStack filledItem = result.getResult(); - if (!player.isCreative()) { - InventoryHelpers.tryReAddToStack(player, itemStack, filledItem, hand); - } + } + return ItemInteractionResult.SUCCESS; + } else if (player.isCrouching() + && FluidUtil.tryFillContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, false).isSuccess()) { + // Move fluid from the tank into the item if sneaking + FluidActionResult result = FluidUtil.tryFillContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, true); + if (result.isSuccess()) { + ItemStack filledItem = result.getResult(); + if (!player.isCreative()) { + InventoryHelpers.tryReAddToStack(player, itemStack, filledItem, hand); } - return InteractionResult.SUCCESS; } + return ItemInteractionResult.SUCCESS; } - return InteractionResult.PASS; + return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; }) - .orElse(InteractionResult.PASS); + .orElse(ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION); } // A modified/fixed version of FluidUtil#tryEmptyContainer @@ -255,7 +266,7 @@ && tryEmptyContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player @Nonnull public static FluidActionResult tryEmptyContainer(@Nonnull ItemStack container, IFluidHandler fluidDestination, int maxAmount, @Nullable Player player, boolean doDrain) { - ItemStack containerCopy = ItemHandlerHelper.copyStackWithSize(container, 1); // do not modify the input + ItemStack containerCopy = container.copyWithCount(1); // do not modify the input return FluidUtil.getFluidHandler(containerCopy) .map(containerFluidHandler -> { FluidStack transfer = FluidUtil.tryFluidTransfer(fluidDestination, containerFluidHandler, maxAmount, doDrain); @@ -294,7 +305,7 @@ public void onRightClick(PlayerInteractEvent.RightClickBlock event) { if (!event.getItemStack().isEmpty() && event.getLevel().getBlockState(event.getPos()).getBlock() == this && event.getItemStack().getCapability(Capabilities.FluidHandler.ITEM) != null) { - event.setUseBlock(Event.Result.ALLOW); + event.setUseBlock(TriState.TRUE); } } diff --git a/src/main/java/org/cyclops/flopper/blockentity/BlockEntityFlopper.java b/src/main/java/org/cyclops/flopper/blockentity/BlockEntityFlopper.java index 9fe878e..92567d2 100644 --- a/src/main/java/org/cyclops/flopper/blockentity/BlockEntityFlopper.java +++ b/src/main/java/org/cyclops/flopper/blockentity/BlockEntityFlopper.java @@ -2,6 +2,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundSource; @@ -66,16 +67,16 @@ public int getTransferCooldown() { } @Override - public void read(CompoundTag tag) { - super.read(tag); - tank.readFromNBT(tag.getCompound("tank")); + public void read(CompoundTag tag, HolderLookup.Provider provider) { + super.read(tag, provider); + tank.readFromNBT(provider, tag.getCompound("tank")); } @Override - public void saveAdditional(CompoundTag tag) { - super.saveAdditional(tag); + public void saveAdditional(CompoundTag tag, HolderLookup.Provider provider) { + super.saveAdditional(tag, provider); CompoundTag tagTank = new CompoundTag(); - tank.writeToNBT(tagTank); + tank.writeToNBT(provider, tagTank); tag.put("tank", tagTank); } diff --git a/src/main/java/org/cyclops/flopper/blockentity/FluidHandlerBlock.java b/src/main/java/org/cyclops/flopper/blockentity/FluidHandlerBlock.java index 24a3f46..f58b7bd 100644 --- a/src/main/java/org/cyclops/flopper/blockentity/FluidHandlerBlock.java +++ b/src/main/java/org/cyclops/flopper/blockentity/FluidHandlerBlock.java @@ -42,7 +42,7 @@ public int getTanks() { public FluidStack getFluidInTank(int tank) { Block block = this.state.getBlock(); if (block instanceof LiquidBlock && this.state.getValue(LiquidBlock.LEVEL) == 0) { - return new FluidStack(((LiquidBlock) block).getFluid(), FluidHelpers.BUCKET_VOLUME); + return new FluidStack(((LiquidBlock) block).fluid, FluidHelpers.BUCKET_VOLUME); } else if (this.state.hasProperty(BlockStateProperties.WATERLOGGED) && this.state.getValue(BlockStateProperties.WATERLOGGED)) { return new FluidStack(Fluids.WATER, FluidHelpers.BUCKET_VOLUME); } else { @@ -70,7 +70,7 @@ public int fill(FluidStack resource, FluidAction action) { public FluidStack drain(FluidStack resource, FluidAction action) { Block block = this.state.getBlock(); if (block instanceof LiquidBlock - && ((LiquidBlock) block).getFluid() == resource.getFluid()) { + && ((LiquidBlock) block).fluid == resource.getFluid()) { return this.drain(resource.getAmount(), action); } else if (this.state.hasProperty(BlockStateProperties.WATERLOGGED) && this.state.getValue(BlockStateProperties.WATERLOGGED) @@ -90,7 +90,7 @@ public FluidStack drain(int maxDrain, FluidAction action) { if (action.execute()) { this.world.setBlock(this.blockPos, Blocks.AIR.defaultBlockState(), 11); } - return new FluidStack(((LiquidBlock) block).getFluid(), FluidHelpers.BUCKET_VOLUME); + return new FluidStack(((LiquidBlock) block).fluid, FluidHelpers.BUCKET_VOLUME); } else if (this.state.hasProperty(BlockStateProperties.WATERLOGGED) && this.state.getValue(BlockStateProperties.WATERLOGGED) && block instanceof SimpleWaterloggedBlock diff --git a/src/main/java/org/cyclops/flopper/client/render/blockentity/RenderBlockEntityFlopper.java b/src/main/java/org/cyclops/flopper/client/render/blockentity/RenderBlockEntityFlopper.java index 763c7f7..8d9bc1f 100644 --- a/src/main/java/org/cyclops/flopper/client/render/blockentity/RenderBlockEntityFlopper.java +++ b/src/main/java/org/cyclops/flopper/client/render/blockentity/RenderBlockEntityFlopper.java @@ -44,10 +44,10 @@ public void render(BlockEntityFlopper tile, float partialTicks, PoseStack matrix VertexConsumer vb = buffer.getBuffer(RenderType.text(icon.atlasLocation())); Matrix4f matrix = matrixStack.last().pose(); - vb.vertex(matrix, 0.125F, height, 0.125F).color(color.getLeft(), color.getMiddle(), color.getRight(), 1).uv(icon.getU0(), icon.getV1()).uv2(l2, i3).endVertex(); - vb.vertex(matrix, 0.125F, height, 0.875F).color(color.getLeft(), color.getMiddle(), color.getRight(), 1).uv(icon.getU0(), icon.getV0()).uv2(l2, i3).endVertex(); - vb.vertex(matrix, 0.875F, height, 0.875F).color(color.getLeft(), color.getMiddle(), color.getRight(), 1).uv(icon.getU1(), icon.getV0()).uv2(l2, i3).endVertex(); - vb.vertex(matrix, 0.875F, height, 0.125F).color(color.getLeft(), color.getMiddle(), color.getRight(), 1).uv(icon.getU1(), icon.getV1()).uv2(l2, i3).endVertex(); + vb.addVertex(matrix, 0.125F, height, 0.125F).setColor(color.getLeft(), color.getMiddle(), color.getRight(), 1).setUv(icon.getU0(), icon.getV1()).setUv2(l2, i3); + vb.addVertex(matrix, 0.125F, height, 0.875F).setColor(color.getLeft(), color.getMiddle(), color.getRight(), 1).setUv(icon.getU0(), icon.getV0()).setUv2(l2, i3); + vb.addVertex(matrix, 0.875F, height, 0.875F).setColor(color.getLeft(), color.getMiddle(), color.getRight(), 1).setUv(icon.getU1(), icon.getV0()).setUv2(l2, i3); + vb.addVertex(matrix, 0.875F, height, 0.125F).setColor(color.getLeft(), color.getMiddle(), color.getRight(), 1).setUv(icon.getU1(), icon.getV1()).setUv2(l2, i3); }); } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/neoforge.mods.toml similarity index 100% rename from src/main/resources/META-INF/mods.toml rename to src/main/resources/META-INF/neoforge.mods.toml