diff --git a/.gitignore b/.gitignore index 2141f23..2bdcc3c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ build # other eclipse run +logs/ # Files from Forge MDK forge*changelog.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index a95f03c..11df36b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Refined Pipes Changelog -## 0.4.3 +## 0.5 +- Port to Minecraft 1.16 (raoulvdberge) - Added Russian translation (KhottyManatee55) ## 0.4.2 diff --git a/README.md b/README.md index e96f9fa..20cfaee 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Refined Pipes [![Build Status](https://ci.refinedmods.com/buildStatus/icon?job=refinedpipes-mc1.15)](https://ci.refinedmods.com/job/refinedpipes-mc1.15/) [![CurseForge](http://cf.way2muchnoise.eu/full_370696_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/refined-pipes) +# Refined Pipes [![Build Status](https://ci.refinedmods.com/buildStatus/icon?job=refinedpipes-mc1.16)](https://ci.refinedmods.com/job/refinedpipes-mc1.16/) [![CurseForge](http://cf.way2muchnoise.eu/full_370696_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/refined-pipes) Refined Pipes is a Minecraft mod that adds item, fluid and energy pipes. diff --git a/build.gradle b/build.gradle index 93f5ab4..86b720b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,3 @@ -import java.nio.file.Files -import java.nio.file.Paths - buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } @@ -23,7 +20,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '0.4.3' +version = '0.5' def env = System.getenv() if (env.BUILD_NUMBER) { version = version + "+" + "${env.BUILD_NUMBER}" @@ -36,7 +33,7 @@ sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = co compileJava.options.encoding = 'UTF-8' minecraft { - mappings channel: 'snapshot', version: '20200225-1.15.1' + mappings channel: 'snapshot', version: '20200723-1.16.1' runs { client { @@ -96,13 +93,13 @@ processResources { } dependencies { - minecraft 'net.minecraftforge:forge:1.15.2-31.1.39' + minecraft 'net.minecraftforge:forge:1.16.3-34.1.0' - runtimeOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2") - runtimeOnly fg.deobf("not_used:Mekanism-1.15.2:9.9.17.409") - runtimeOnly fg.deobf("com.github.mcjty:mcjtylib:1.15-4.0.3-alpha") - runtimeOnly fg.deobf("com.github.mcjty:rftoolsbase:1.15-1.0.1-alpha") - runtimeOnly fg.deobf("com.github.mcjty:rftoolspower:1.15-2.0.1-alpha") + runtimeOnly fg.deobf("mezz.jei:jei-1.16.3:7.3.2.36") + // runtimeOnly fg.deobf("not_used:Mekanism-1.15.2:9.9.17.409") + // runtimeOnly fg.deobf("com.github.mcjty:mcjtylib:1.15-4.0.3-alpha") + // runtimeOnly fg.deobf("com.github.mcjty:rftoolsbase:1.15-1.0.1-alpha") + // runtimeOnly fg.deobf("com.github.mcjty:rftoolspower:1.15-2.0.1-alpha") } jar { diff --git a/src/main/java/com/refinedmods/refinedpipes/RefinedPipesNetwork.java b/src/main/java/com/refinedmods/refinedpipes/RefinedPipesNetwork.java index 1742d5d..0ac6567 100644 --- a/src/main/java/com/refinedmods/refinedpipes/RefinedPipesNetwork.java +++ b/src/main/java/com/refinedmods/refinedpipes/RefinedPipesNetwork.java @@ -38,7 +38,7 @@ public void sendInArea(World world, BlockPos pos, int radius, Object message) { pos.getY(), pos.getZ(), radius, - world.getDimension().getType() + world.func_234923_W_() )), message); } diff --git a/src/main/java/com/refinedmods/refinedpipes/block/PipeBlock.java b/src/main/java/com/refinedmods/refinedpipes/block/PipeBlock.java index 76a22af..6ff37fd 100644 --- a/src/main/java/com/refinedmods/refinedpipes/block/PipeBlock.java +++ b/src/main/java/com/refinedmods/refinedpipes/block/PipeBlock.java @@ -26,9 +26,9 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; @@ -212,7 +212,7 @@ public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockRea } @Nullable - public Direction getAttachmentDirectionClicked(BlockPos pos, Vec3d hit) { + public Direction getAttachmentDirectionClicked(BlockPos pos, Vector3d hit) { if (Raytracer.inclusiveContains(PipeShapeProps.NORTH_ATTACHMENT_SHAPE.getBoundingBox().offset(pos), hit)) { return Direction.NORTH; } diff --git a/src/main/java/com/refinedmods/refinedpipes/item/EnergyPipeBlockItem.java b/src/main/java/com/refinedmods/refinedpipes/item/EnergyPipeBlockItem.java index e40135a..8fa0f86 100644 --- a/src/main/java/com/refinedmods/refinedpipes/item/EnergyPipeBlockItem.java +++ b/src/main/java/com/refinedmods/refinedpipes/item/EnergyPipeBlockItem.java @@ -5,7 +5,10 @@ import com.refinedmods.refinedpipes.util.StringUtil; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; -import net.minecraft.util.text.*; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; import javax.annotation.Nullable; @@ -24,16 +27,16 @@ public EnergyPipeBlockItem(EnergyPipeBlock block) { public void addInformation(ItemStack stack, @Nullable World world, List tooltip, ITooltipFlag flag) { super.addInformation(stack, world, tooltip, flag); - tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).setStyle(new Style().setColor(TextFormatting.YELLOW))); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).mergeStyle(TextFormatting.YELLOW)); tooltip.add(new TranslationTextComponent( "tooltip.refinedpipes.energy_pipe.capacity", - new StringTextComponent(StringUtil.formatNumber(type.getCapacity()) + " FE").setStyle(new Style().setColor(TextFormatting.WHITE)) - ).setStyle(new Style().setColor(TextFormatting.GRAY))); + new StringTextComponent(StringUtil.formatNumber(type.getCapacity()) + " FE").mergeStyle(TextFormatting.WHITE) + ).mergeStyle(TextFormatting.GRAY)); tooltip.add(new TranslationTextComponent( "tooltip.refinedpipes.energy_pipe.transfer_rate", - new StringTextComponent(StringUtil.formatNumber(type.getTransferRate()) + " FE/t").setStyle(new Style().setColor(TextFormatting.WHITE)) - ).setStyle(new Style().setColor(TextFormatting.GRAY))); + new StringTextComponent(StringUtil.formatNumber(type.getTransferRate()) + " FE/t").mergeStyle(TextFormatting.WHITE) + ).mergeStyle(TextFormatting.GRAY)); } } diff --git a/src/main/java/com/refinedmods/refinedpipes/item/FluidPipeBlockItem.java b/src/main/java/com/refinedmods/refinedpipes/item/FluidPipeBlockItem.java index d92a0c2..840299e 100644 --- a/src/main/java/com/refinedmods/refinedpipes/item/FluidPipeBlockItem.java +++ b/src/main/java/com/refinedmods/refinedpipes/item/FluidPipeBlockItem.java @@ -5,7 +5,10 @@ import com.refinedmods.refinedpipes.util.StringUtil; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; -import net.minecraft.util.text.*; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; import javax.annotation.Nullable; @@ -24,16 +27,16 @@ public FluidPipeBlockItem(FluidPipeBlock block) { public void addInformation(ItemStack stack, @Nullable World world, List tooltip, ITooltipFlag flag) { super.addInformation(stack, world, tooltip, flag); - tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).setStyle(new Style().setColor(TextFormatting.YELLOW))); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).mergeStyle(TextFormatting.YELLOW)); tooltip.add(new TranslationTextComponent( "tooltip.refinedpipes.fluid_pipe.capacity", - new StringTextComponent(StringUtil.formatNumber(type.getCapacity()) + " mB").setStyle(new Style().setColor(TextFormatting.WHITE)) - ).setStyle(new Style().setColor(TextFormatting.GRAY))); + new StringTextComponent(StringUtil.formatNumber(type.getCapacity()) + " mB").mergeStyle(TextFormatting.WHITE) + ).mergeStyle(TextFormatting.GRAY)); tooltip.add(new TranslationTextComponent( "tooltip.refinedpipes.fluid_pipe.transfer_rate", - new StringTextComponent(StringUtil.formatNumber(type.getTransferRate()) + " mB/t").setStyle(new Style().setColor(TextFormatting.WHITE)) - ).setStyle(new Style().setColor(TextFormatting.GRAY))); + new StringTextComponent(StringUtil.formatNumber(type.getTransferRate()) + " mB/t").mergeStyle(TextFormatting.WHITE) + ).mergeStyle(TextFormatting.GRAY)); } } diff --git a/src/main/java/com/refinedmods/refinedpipes/item/ItemPipeBlockItem.java b/src/main/java/com/refinedmods/refinedpipes/item/ItemPipeBlockItem.java index 7532dc1..f56f394 100644 --- a/src/main/java/com/refinedmods/refinedpipes/item/ItemPipeBlockItem.java +++ b/src/main/java/com/refinedmods/refinedpipes/item/ItemPipeBlockItem.java @@ -4,7 +4,10 @@ import com.refinedmods.refinedpipes.network.pipe.item.ItemPipeType; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; -import net.minecraft.util.text.*; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; import javax.annotation.Nullable; @@ -23,11 +26,11 @@ public ItemPipeBlockItem(ItemPipeBlock block) { public void addInformation(ItemStack stack, @Nullable World world, List tooltip, ITooltipFlag flag) { super.addInformation(stack, world, tooltip, flag); - tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).setStyle(new Style().setColor(TextFormatting.YELLOW))); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).mergeStyle(TextFormatting.YELLOW)); tooltip.add(new TranslationTextComponent( "tooltip.refinedpipes.item_pipe.speed", - new StringTextComponent(type.getSpeedComparedToBasicTier() + "%").setStyle(new Style().setColor(TextFormatting.WHITE)) - ).setStyle(new Style().setColor(TextFormatting.GRAY))); + new StringTextComponent(type.getSpeedComparedToBasicTier() + "%").mergeStyle(TextFormatting.WHITE) + ).mergeStyle(TextFormatting.GRAY)); } } diff --git a/src/main/java/com/refinedmods/refinedpipes/network/NetworkManager.java b/src/main/java/com/refinedmods/refinedpipes/network/NetworkManager.java index 1476789..4054e53 100644 --- a/src/main/java/com/refinedmods/refinedpipes/network/NetworkManager.java +++ b/src/main/java/com/refinedmods/refinedpipes/network/NetworkManager.java @@ -31,9 +31,7 @@ public static NetworkManager get(World world) { } public static NetworkManager get(ServerWorld world) { - String name = NAME + "_" + world.getDimension().getType().getRegistryName().getNamespace() + "_" + world.getDimension().getType().getRegistryName().getPath(); - - return world.getSavedData().getOrCreate(() -> new NetworkManager(name, world), name); + return world.getSavedData().getOrCreate(() -> new NetworkManager(NAME, world), NAME); } private final World world; diff --git a/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachmentFactory.java b/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachmentFactory.java index 9b356ec..5e4827a 100644 --- a/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachmentFactory.java +++ b/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachmentFactory.java @@ -11,7 +11,10 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.*; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.TranslationTextComponent; import java.util.List; @@ -85,41 +88,41 @@ public ResourceLocation getModelLocation() { @Override public void addInformation(List tooltip) { - tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).setStyle(new Style().setColor(TextFormatting.YELLOW))); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).mergeStyle(TextFormatting.YELLOW)); ITextComponent itemsToExtract = new StringTextComponent(StringUtil.formatNumber(type.getItemsToExtract()) + " ") - .appendSibling(new TranslationTextComponent("misc.refinedpipes.item" + (type.getItemsToExtract() == 1 ? "" : "s"))) - .setStyle(new Style().setColor(TextFormatting.WHITE)); + .append(new TranslationTextComponent("misc.refinedpipes.item" + (type.getItemsToExtract() == 1 ? "" : "s"))) + .mergeStyle(TextFormatting.WHITE); float itemSecondsInterval = type.getItemTickInterval() / 20F; ITextComponent itemTickInterval = new StringTextComponent(StringUtil.formatNumber(itemSecondsInterval) + " ") - .appendSibling(new TranslationTextComponent("misc.refinedpipes.second" + (itemSecondsInterval == 1 ? "" : "s"))) - .setStyle(new Style().setColor(TextFormatting.WHITE)); + .append(new TranslationTextComponent("misc.refinedpipes.second" + (itemSecondsInterval == 1 ? "" : "s"))) + .mergeStyle(TextFormatting.WHITE); tooltip.add(new TranslationTextComponent( "tooltip.refinedpipes.extractor_attachment.item_extraction_rate", itemsToExtract, itemTickInterval - ).setStyle(new Style().setColor(TextFormatting.GRAY))); + ).mergeStyle(TextFormatting.GRAY)); ITextComponent fluidsToExtract = new StringTextComponent(StringUtil.formatNumber(type.getFluidsToExtract()) + " mB") - .setStyle(new Style().setColor(TextFormatting.WHITE)); + .mergeStyle(TextFormatting.WHITE); float fluidSecondsInterval = type.getFluidTickInterval() / 20F; ITextComponent fluidTickInterval = new StringTextComponent(StringUtil.formatNumber(fluidSecondsInterval) + " ") - .appendSibling(new TranslationTextComponent("misc.refinedpipes.second" + (fluidSecondsInterval == 1 ? "" : "s"))) - .setStyle(new Style().setColor(TextFormatting.WHITE)); + .append(new TranslationTextComponent("misc.refinedpipes.second" + (fluidSecondsInterval == 1 ? "" : "s"))) + .mergeStyle(TextFormatting.WHITE); tooltip.add(new TranslationTextComponent( "tooltip.refinedpipes.extractor_attachment.fluid_extraction_rate", fluidsToExtract, fluidTickInterval - ).setStyle(new Style().setColor(TextFormatting.GRAY))); + ).mergeStyle(TextFormatting.GRAY)); tooltip.add(new TranslationTextComponent( "tooltip.refinedpipes.extractor_attachment.filter_slots", - new StringTextComponent("" + type.getFilterSlots()).setStyle(new Style().setColor(TextFormatting.WHITE)) - ).setStyle(new Style().setColor(TextFormatting.GRAY))); + new StringTextComponent("" + type.getFilterSlots()).mergeStyle(TextFormatting.WHITE) + ).mergeStyle(TextFormatting.GRAY)); addAbilityToInformation(tooltip, type.getCanSetRedstoneMode(), "misc.refinedpipes.redstone_mode"); addAbilityToInformation(tooltip, type.getCanSetWhitelistBlacklist(), "misc.refinedpipes.mode"); @@ -129,8 +132,8 @@ public void addInformation(List tooltip) { private void addAbilityToInformation(List tooltip, boolean possible, String key) { tooltip.add( - new StringTextComponent(possible ? "✓ " : "❌ ").appendSibling(new TranslationTextComponent(key)) - .setStyle(new Style().setColor(possible ? TextFormatting.GREEN : TextFormatting.RED)) + new StringTextComponent(possible ? "✓ " : "❌ ").append(new TranslationTextComponent(key)) + .mergeStyle(possible ? TextFormatting.GREEN : TextFormatting.RED) ); } diff --git a/src/main/java/com/refinedmods/refinedpipes/network/pipe/shape/PipeShapeCache.java b/src/main/java/com/refinedmods/refinedpipes/network/pipe/shape/PipeShapeCache.java index ffbc82c..8aff2dc 100644 --- a/src/main/java/com/refinedmods/refinedpipes/network/pipe/shape/PipeShapeCache.java +++ b/src/main/java/com/refinedmods/refinedpipes/network/pipe/shape/PipeShapeCache.java @@ -15,10 +15,10 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; import org.apache.commons.lang3.tuple.Pair; @@ -64,7 +64,7 @@ private VoxelShape addFakeAttachmentShape(Block block, BlockPos pos, Entity enti return shape; } - Pair vec = Raytracer.getVectors(entity); + Pair vec = Raytracer.getVectors(entity); Raytracer.AdvancedRayTraceResult result = Raytracer.collisionRayTrace(pos, vec.getLeft(), vec.getRight(), attachmentShapes); if (result != null) { diff --git a/src/main/java/com/refinedmods/refinedpipes/render/ItemPipeTileEntityRenderer.java b/src/main/java/com/refinedmods/refinedpipes/render/ItemPipeTileEntityRenderer.java index 06e9647..72bc8ee 100644 --- a/src/main/java/com/refinedmods/refinedpipes/render/ItemPipeTileEntityRenderer.java +++ b/src/main/java/com/refinedmods/refinedpipes/render/ItemPipeTileEntityRenderer.java @@ -5,11 +5,11 @@ import com.refinedmods.refinedpipes.tile.ItemPipeTileEntity; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; -import net.minecraft.client.renderer.Quaternion; import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; +import net.minecraft.util.math.vector.Quaternion; public class ItemPipeTileEntityRenderer extends TileEntityRenderer { public ItemPipeTileEntityRenderer(TileEntityRendererDispatcher dispatcher) { diff --git a/src/main/java/com/refinedmods/refinedpipes/render/PipeBakedModel.java b/src/main/java/com/refinedmods/refinedpipes/render/PipeBakedModel.java index b084511..912bcea 100644 --- a/src/main/java/com/refinedmods/refinedpipes/render/PipeBakedModel.java +++ b/src/main/java/com/refinedmods/refinedpipes/render/PipeBakedModel.java @@ -1,20 +1,18 @@ package com.refinedmods.refinedpipes.render; import com.google.common.collect.ImmutableList; - import com.refinedmods.refinedpipes.block.PipeBlock; import com.refinedmods.refinedpipes.tile.PipeTileEntity; - import net.minecraft.block.BlockState; -import net.minecraft.client.renderer.Quaternion; -import net.minecraft.client.renderer.TransformationMatrix; -import net.minecraft.client.renderer.Vector3f; import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.vector.Quaternion; +import net.minecraft.util.math.vector.TransformationMatrix; +import net.minecraft.util.math.vector.Vector3f; import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.pipeline.BakedQuadBuilder; diff --git a/src/main/java/com/refinedmods/refinedpipes/screen/BaseScreen.java b/src/main/java/com/refinedmods/refinedpipes/screen/BaseScreen.java index 30c524d..701d760 100644 --- a/src/main/java/com/refinedmods/refinedpipes/screen/BaseScreen.java +++ b/src/main/java/com/refinedmods/refinedpipes/screen/BaseScreen.java @@ -1,5 +1,6 @@ package com.refinedmods.refinedpipes.screen; +import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import com.refinedmods.refinedpipes.container.BaseContainer; import com.refinedmods.refinedpipes.container.slot.FluidFilterSlot; @@ -7,6 +8,8 @@ import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.ITextProperties; +import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.client.gui.GuiUtils; @@ -14,16 +17,16 @@ import java.util.List; public abstract class BaseScreen extends ContainerScreen { - private final List fluidTooltip = new ArrayList<>(1); + private final List fluidTooltip = new ArrayList<>(1); public BaseScreen(T screenContainer, PlayerInventory inv, ITextComponent title) { super(screenContainer, inv, title); - fluidTooltip.add(""); + fluidTooltip.add(StringTextComponent.EMPTY); } @Override - protected void drawGuiContainerBackgroundLayer(float renderPartialTicks, int mouseX, int mouseY) { + protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); for (FluidFilterSlot slot : container.getFluidSlots()) { @@ -37,9 +40,7 @@ protected void drawGuiContainerBackgroundLayer(float renderPartialTicks, int mou } @Override - protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - super.drawGuiContainerForegroundLayer(mouseX, mouseY); - + protected void drawGuiContainerForegroundLayer(MatrixStack matrixStack, int mouseX, int mouseY) { for (FluidFilterSlot slot : container.getFluidSlots()) { FluidStack stack = slot.getFluidInventory().getFluid(slot.getSlotIndex()); if (stack.isEmpty()) { @@ -50,9 +51,9 @@ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { continue; } - fluidTooltip.set(0, stack.getDisplayName().getFormattedText()); + fluidTooltip.set(0, stack.getDisplayName()); - GuiUtils.drawHoveringText(fluidTooltip, mouseX - guiLeft, mouseY - guiTop, width, height, -1, font); + GuiUtils.drawHoveringText(matrixStack, fluidTooltip, mouseX - guiLeft, mouseY - guiTop, width, height, -1, font); } } } diff --git a/src/main/java/com/refinedmods/refinedpipes/screen/ExtractorAttachmentScreen.java b/src/main/java/com/refinedmods/refinedpipes/screen/ExtractorAttachmentScreen.java index 61b59c1..f248fe0 100644 --- a/src/main/java/com/refinedmods/refinedpipes/screen/ExtractorAttachmentScreen.java +++ b/src/main/java/com/refinedmods/refinedpipes/screen/ExtractorAttachmentScreen.java @@ -1,5 +1,6 @@ package com.refinedmods.refinedpipes.screen; +import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import com.refinedmods.refinedpipes.RefinedPipes; import com.refinedmods.refinedpipes.container.ExtractorAttachmentContainer; @@ -14,8 +15,7 @@ import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.*; import net.minecraftforge.fml.client.gui.GuiUtils; import javax.annotation.Nullable; @@ -25,7 +25,7 @@ public class ExtractorAttachmentScreen extends BaseScreen { private static final ResourceLocation RESOURCE = new ResourceLocation(RefinedPipes.ID, "textures/gui/extractor_attachment.png"); - private final List tooltip = new ArrayList<>(); + private final List tooltip = new ArrayList<>(); private Button redstoneModeButton; private Button blacklistWhitelistButton; @@ -104,7 +104,7 @@ protected void init() { IconButtonPreset.SMALL, 198, 19, - "+", + new StringTextComponent("+"), btn -> updateStackSize(1) )); @@ -114,7 +114,7 @@ protected void init() { IconButtonPreset.SMALL, 198, 34, - "-", + new StringTextComponent("-"), btn -> updateStackSize(-1) )); @@ -156,8 +156,8 @@ private int getRedstoneModeX(RedstoneMode redstoneMode) { } } - private String getRedstoneModeText(RedstoneMode redstoneMode) { - return I18n.format("misc.refinedpipes.redstone_mode." + redstoneMode.toString().toLowerCase()); + private IFormattableTextComponent getRedstoneModeText(RedstoneMode redstoneMode) { + return new TranslationTextComponent("misc.refinedpipes.redstone_mode." + redstoneMode.toString().toLowerCase()); } private void setRedstoneMode(IconButton button, RedstoneMode redstoneMode) { @@ -178,8 +178,8 @@ private int getBlacklistWhitelistX(BlacklistWhitelist blacklistWhitelist) { } } - private String getBlacklistWhitelistText(BlacklistWhitelist blacklistWhitelist) { - return I18n.format("misc.refinedpipes.mode." + blacklistWhitelist.toString().toLowerCase()); + private IFormattableTextComponent getBlacklistWhitelistText(BlacklistWhitelist blacklistWhitelist) { + return new TranslationTextComponent("misc.refinedpipes.mode." + blacklistWhitelist.toString().toLowerCase()); } private void setBlacklistWhitelist(IconButton button, BlacklistWhitelist blacklistWhitelist) { @@ -204,8 +204,8 @@ private int getRoutingModeX(RoutingMode routingMode) { } } - private String getRoutingModeText(RoutingMode routingMode) { - return I18n.format("misc.refinedpipes.routing_mode." + routingMode.toString().toLowerCase()); + private IFormattableTextComponent getRoutingModeText(RoutingMode routingMode) { + return new TranslationTextComponent("misc.refinedpipes.routing_mode." + routingMode.toString().toLowerCase()); } private void setRoutingMode(IconButton button, RoutingMode routingMode) { @@ -219,8 +219,8 @@ private int getExactModeX(boolean exactMode) { return exactMode ? 177 : 198; } - private String getExactModeText(boolean exactMode) { - return I18n.format("misc.refinedpipes.exact_mode." + (exactMode ? "on" : "off")); + private IFormattableTextComponent getExactModeText(boolean exactMode) { + return new TranslationTextComponent("misc.refinedpipes.exact_mode." + (exactMode ? "on" : "off")); } private void setExactMode(IconButton button, boolean exactMode) { @@ -231,54 +231,54 @@ private void setExactMode(IconButton button, boolean exactMode) { } @Override - protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - font.drawString(title.getFormattedText(), 7, 7, 4210752); - font.drawString(I18n.format("container.inventory"), 7, 103 - 4, 4210752); + protected void drawGuiContainerForegroundLayer(MatrixStack matrixStack, int mouseX, int mouseY) { + font.drawString(matrixStack, title.getString(), 7, 7, 4210752); + font.drawString(matrixStack, I18n.format("container.inventory"), 7, 103 - 4, 4210752); if (!container.isFluidMode()) { - font.drawString("" + container.getStackSize(), 143, 83, 4210752); + font.drawString(matrixStack, "" + container.getStackSize(), 143, 83, 4210752); } - renderHoveredToolTip(mouseX - guiLeft, mouseY - guiTop); + func_230459_a_(matrixStack, mouseX - guiLeft, mouseY - guiTop); tooltip.clear(); if (blacklistWhitelistButton.isHovered()) { - tooltip.add(I18n.format("misc.refinedpipes.mode")); - tooltip.add(TextFormatting.GRAY + getBlacklistWhitelistText(container.getBlacklistWhitelist())); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.mode")); + tooltip.add(getBlacklistWhitelistText(container.getBlacklistWhitelist()).mergeStyle(TextFormatting.GRAY)); } else if (redstoneModeButton.isHovered()) { - tooltip.add(I18n.format("misc.refinedpipes.redstone_mode")); - tooltip.add(TextFormatting.GRAY + getRedstoneModeText(container.getRedstoneMode())); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.redstone_mode")); + tooltip.add(getRedstoneModeText(container.getRedstoneMode()).mergeStyle(TextFormatting.GRAY)); } else if (routingModeButton != null && routingModeButton.isHovered()) { - tooltip.add(I18n.format("misc.refinedpipes.routing_mode")); - tooltip.add(TextFormatting.GRAY + getRoutingModeText(container.getRoutingMode())); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.routing_mode")); + tooltip.add(getRoutingModeText(container.getRoutingMode()).mergeStyle(TextFormatting.GRAY)); } else if (exactModeButton.isHovered()) { - tooltip.add(I18n.format("misc.refinedpipes.exact_mode")); - tooltip.add(TextFormatting.GRAY + getExactModeText(container.isExactMode())); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.exact_mode")); + tooltip.add(getExactModeText(container.isExactMode()).mergeStyle(TextFormatting.GRAY)); } if (!tooltip.isEmpty()) { - GuiUtils.drawHoveringText(tooltip, mouseX - guiLeft, mouseY - guiTop, width, height, -1, Minecraft.getInstance().fontRenderer); + GuiUtils.drawHoveringText(matrixStack, tooltip, mouseX - guiLeft, mouseY - guiTop, width, height, -1, Minecraft.getInstance().fontRenderer); } - super.drawGuiContainerForegroundLayer(mouseX, mouseY); + super.drawGuiContainerForegroundLayer(matrixStack, mouseX, mouseY); } @Override - protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { - renderBackground(); + protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) { + renderBackground(matrixStack); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.minecraft.getTextureManager().bindTexture(RESOURCE); int i = (this.width - this.xSize) / 2; int j = (this.height - this.ySize) / 2; - this.blit(i, j, 0, 0, this.xSize, this.ySize); + this.blit(matrixStack, i, j, 0, 0, this.xSize, this.ySize); int x = 43; int y = 18; for (int filterSlotId = 1; filterSlotId <= ExtractorAttachment.MAX_FILTER_SLOTS; ++filterSlotId) { if (filterSlotId > container.getExtractorAttachmentType().getFilterSlots()) { - this.blit(i + x, j + y, 198, 0, 18, 18); + this.blit(matrixStack, i + x, j + y, 198, 0, 18, 18); } if (filterSlotId % 5 == 0) { @@ -289,6 +289,6 @@ protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, i } } - super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY); + super.drawGuiContainerBackgroundLayer(matrixStack, partialTicks, mouseX, mouseY); } } diff --git a/src/main/java/com/refinedmods/refinedpipes/screen/widget/IconButton.java b/src/main/java/com/refinedmods/refinedpipes/screen/widget/IconButton.java index f9f46b5..19df996 100644 --- a/src/main/java/com/refinedmods/refinedpipes/screen/widget/IconButton.java +++ b/src/main/java/com/refinedmods/refinedpipes/screen/widget/IconButton.java @@ -1,10 +1,12 @@ package com.refinedmods.refinedpipes.screen.widget; +import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import com.refinedmods.refinedpipes.RefinedPipes; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.widget.button.Button; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; public class IconButton extends Button { private static final ResourceLocation RESOURCE = new ResourceLocation(RefinedPipes.ID, "textures/gui/extractor_attachment.png"); @@ -13,7 +15,7 @@ public class IconButton extends Button { private int overlayTexX; private int overlayTexY; - public IconButton(int x, int y, IconButtonPreset preset, int overlayTexX, int overlayTexY, String text, IPressable onPress) { + public IconButton(int x, int y, IconButtonPreset preset, int overlayTexX, int overlayTexY, ITextComponent text, IPressable onPress) { super(x, y, preset.getWidth(), preset.getHeight(), text, onPress); this.preset = preset; @@ -26,7 +28,7 @@ public void setOverlayTexX(int overlayTexX) { } @Override - public void renderButton(int mouseX, int mouseY, float partialTicks) { + public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { Minecraft minecraft = Minecraft.getInstance(); minecraft.getTextureManager().bindTexture(RESOURCE); @@ -39,10 +41,10 @@ public void renderButton(int mouseX, int mouseY, float partialTicks) { y = preset.getYTexHover(); } - blit(this.x, this.y, preset.getXTex(), y, this.width, this.height, 256, 256); + blit(matrixStack, this.x, this.y, preset.getXTex(), y, this.width, this.height, 256, 256); // Fiddling with -1 to remove the blue border - blit(this.x + 1, this.y + 1, overlayTexX + 1, overlayTexY + 1, this.width - 2, this.height - 2, 256, 256); + blit(matrixStack, this.x + 1, this.y + 1, overlayTexX + 1, overlayTexY + 1, this.width - 2, this.height - 2, 256, 256); RenderSystem.enableDepthTest(); } diff --git a/src/main/java/com/refinedmods/refinedpipes/setup/ClientSetup.java b/src/main/java/com/refinedmods/refinedpipes/setup/ClientSetup.java index c407696..cdc6402 100644 --- a/src/main/java/com/refinedmods/refinedpipes/setup/ClientSetup.java +++ b/src/main/java/com/refinedmods/refinedpipes/setup/ClientSetup.java @@ -13,21 +13,18 @@ import com.refinedmods.refinedpipes.render.ItemPipeTileEntityRenderer; import com.refinedmods.refinedpipes.render.PipeBakedModel; import com.refinedmods.refinedpipes.screen.ExtractorAttachmentScreen; - import net.minecraft.client.gui.ScreenManager; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.ModelResourceLocation; import net.minecraft.util.ResourceLocation; - import net.minecraftforge.client.event.ModelBakeEvent; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -47,31 +44,6 @@ public ClientSetup() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onModelBake); - } - - @SubscribeEvent - public void onClientSetup(FMLClientSetupEvent e) { - ScreenManager.registerFactory(RefinedPipesContainers.EXTRACTOR_ATTACHMENT, ExtractorAttachmentScreen::new); - - RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.BASIC_ITEM_PIPE, RenderType.getCutout()); - RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.IMPROVED_ITEM_PIPE, RenderType.getCutout()); - RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.ADVANCED_ITEM_PIPE, RenderType.getCutout()); - - RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.BASIC_FLUID_PIPE, RenderType.getCutout()); - RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.IMPROVED_FLUID_PIPE, RenderType.getCutout()); - RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.ADVANCED_FLUID_PIPE, RenderType.getCutout()); - RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.ELITE_FLUID_PIPE, RenderType.getCutout()); - RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.ULTIMATE_FLUID_PIPE, RenderType.getCutout()); - - ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.BASIC_ITEM_PIPE, ItemPipeTileEntityRenderer::new); - ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.IMPROVED_ITEM_PIPE, ItemPipeTileEntityRenderer::new); - ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.ADVANCED_ITEM_PIPE, ItemPipeTileEntityRenderer::new); - - ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.BASIC_FLUID_PIPE, FluidPipeTileEntityRenderer::new); - ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.IMPROVED_FLUID_PIPE, FluidPipeTileEntityRenderer::new); - ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.ADVANCED_FLUID_PIPE, FluidPipeTileEntityRenderer::new); - ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.ELITE_FLUID_PIPE, FluidPipeTileEntityRenderer::new); - ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.ULTIMATE_FLUID_PIPE, FluidPipeTileEntityRenderer::new); for (String type : new String[]{"item", "fluid", "energy"}) { ModelLoader.addSpecialModel(new ResourceLocation(RefinedPipes.ID + ":block/pipe/" + type + "/basic/core")); @@ -100,6 +72,31 @@ public void onClientSetup(FMLClientSetupEvent e) { ModelLoader.addSpecialModel(new ResourceLocation(RefinedPipes.ID + ":block/pipe/attachment/inventory_attachment")); } + @SubscribeEvent + public void onClientSetup(FMLClientSetupEvent e) { + ScreenManager.registerFactory(RefinedPipesContainers.EXTRACTOR_ATTACHMENT, ExtractorAttachmentScreen::new); + + RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.BASIC_ITEM_PIPE, RenderType.getCutout()); + RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.IMPROVED_ITEM_PIPE, RenderType.getCutout()); + RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.ADVANCED_ITEM_PIPE, RenderType.getCutout()); + + RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.BASIC_FLUID_PIPE, RenderType.getCutout()); + RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.IMPROVED_FLUID_PIPE, RenderType.getCutout()); + RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.ADVANCED_FLUID_PIPE, RenderType.getCutout()); + RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.ELITE_FLUID_PIPE, RenderType.getCutout()); + RenderTypeLookup.setRenderLayer(RefinedPipesBlocks.ULTIMATE_FLUID_PIPE, RenderType.getCutout()); + + ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.BASIC_ITEM_PIPE, ItemPipeTileEntityRenderer::new); + ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.IMPROVED_ITEM_PIPE, ItemPipeTileEntityRenderer::new); + ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.ADVANCED_ITEM_PIPE, ItemPipeTileEntityRenderer::new); + + ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.BASIC_FLUID_PIPE, FluidPipeTileEntityRenderer::new); + ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.IMPROVED_FLUID_PIPE, FluidPipeTileEntityRenderer::new); + ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.ADVANCED_FLUID_PIPE, FluidPipeTileEntityRenderer::new); + ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.ELITE_FLUID_PIPE, FluidPipeTileEntityRenderer::new); + ClientRegistry.bindTileEntityRenderer(RefinedPipesTileEntities.ULTIMATE_FLUID_PIPE, FluidPipeTileEntityRenderer::new); + } + @SubscribeEvent public void onModelBake(ModelBakeEvent e) { Map attachmentModels = new HashMap<>(); diff --git a/src/main/java/com/refinedmods/refinedpipes/tile/BaseTileEntity.java b/src/main/java/com/refinedmods/refinedpipes/tile/BaseTileEntity.java index 7562013..c1c2f1f 100644 --- a/src/main/java/com/refinedmods/refinedpipes/tile/BaseTileEntity.java +++ b/src/main/java/com/refinedmods/refinedpipes/tile/BaseTileEntity.java @@ -1,5 +1,6 @@ package com.refinedmods.refinedpipes.tile; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.play.server.SUpdateTileEntityPacket; import net.minecraft.tileentity.TileEntity; @@ -26,8 +27,8 @@ public final void onDataPacket(net.minecraft.network.NetworkManager net, SUpdate } @Override - public final void handleUpdateTag(CompoundNBT tag) { - super.read(tag); + public final void handleUpdateTag(BlockState state, CompoundNBT tag) { + super.read(state, tag); readUpdate(tag); } diff --git a/src/main/java/com/refinedmods/refinedpipes/util/Raytracer.java b/src/main/java/com/refinedmods/refinedpipes/util/Raytracer.java index 7f1b375..40d80f3 100644 --- a/src/main/java/com/refinedmods/refinedpipes/util/Raytracer.java +++ b/src/main/java/com/refinedmods/refinedpipes/util/Raytracer.java @@ -1,9 +1,10 @@ package com.refinedmods.refinedpipes.util; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.util.math.*; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraftforge.common.ForgeMod; import org.apache.commons.lang3.tuple.Pair; import java.util.Collection; @@ -11,10 +12,10 @@ // https://github.com/mekanism/Mekanism/blob/9a3fe1a5d78bb38fa963a3bcbc8d3846412315e4/src/main/java/mekanism/common/util/MultipartUtils.java public class Raytracer { - public static Pair getVectors(Entity entity) { + public static Pair getVectors(Entity entity) { float pitch = entity.rotationPitch; float yaw = entity.rotationYaw; - Vec3d start = new Vec3d(entity.getPosX(), entity.getPosY() + entity.getEyeHeight(), entity.getPosZ()); + Vector3d start = new Vector3d(entity.getPosX(), entity.getPosY() + entity.getEyeHeight(), entity.getPosZ()); float f1 = MathHelper.cos(-yaw * 0.017453292F - (float) Math.PI); float f2 = MathHelper.sin(-yaw * 0.017453292F - (float) Math.PI); float f3 = -MathHelper.cos(-pitch * 0.017453292F); @@ -23,13 +24,13 @@ public static Pair getVectors(Entity entity) { float f6 = f1 * f3; double d3 = 5.0D; if (entity instanceof ServerPlayerEntity) { - d3 = ((ServerPlayerEntity) entity).getAttribute(PlayerEntity.REACH_DISTANCE).getValue(); + d3 = ((ServerPlayerEntity) entity).getAttribute(ForgeMod.REACH_DISTANCE.get()).getValue(); } - Vec3d end = start.add(f5 * d3, f4 * d3, f6 * d3); + Vector3d end = start.add(f5 * d3, f4 * d3, f6 * d3); return Pair.of(start, end); } - public static AdvancedRayTraceResult collisionRayTrace(BlockPos pos, Vec3d start, Vec3d end, Collection boxes) { + public static AdvancedRayTraceResult collisionRayTrace(BlockPos pos, Vector3d start, Vector3d end, Collection boxes) { double minDistance = Double.POSITIVE_INFINITY; AdvancedRayTraceResult hit = null; int i = -1; @@ -49,7 +50,7 @@ public static AdvancedRayTraceResult collisionRayTrace(Bloc return hit; } - public static AdvancedRayTraceResult collisionRayTrace(BlockPos pos, Vec3d start, Vec3d end, AxisAlignedBB bounds, int subHit, Object hitInfo) { + public static AdvancedRayTraceResult collisionRayTrace(BlockPos pos, Vector3d start, Vector3d end, AxisAlignedBB bounds, int subHit, Object hitInfo) { BlockRayTraceResult result = AxisAlignedBB.rayTrace(Collections.singleton(bounds), start, end, pos); if (result == null) { return null; @@ -74,12 +75,12 @@ public boolean valid() { return hit != null && bounds != null; } - public double squareDistanceTo(Vec3d vec) { + public double squareDistanceTo(Vector3d vec) { return hit.getHitVec().squareDistanceTo(vec); } } - public static boolean inclusiveContains(AxisAlignedBB aabb, Vec3d hit) { + public static boolean inclusiveContains(AxisAlignedBB aabb, Vector3d hit) { return hit.x >= aabb.minX && hit.x <= aabb.maxX && hit.y >= aabb.minY diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 7e7fe70..e78820e 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,6 +1,7 @@ modLoader="javafml" -loaderVersion="[31,)" +loaderVersion="[34,)" issueTrackerURL="https://github.com/refinedmods/refinedpipes" +license="MIT" [[mods]] modId="refinedpipes" version="${version}" diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 7401164..bc8ac4d 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "description": "Refined Pipes resources", - "pack_format": 5 + "pack_format": 6 } -} \ No newline at end of file +}