diff --git a/build.properties b/build.properties index aa4f168a..81b3f98b 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,4 @@ -mod_version=1.1.0-alpha4 +mod_version=1.1.0-alpha5 mod_name=Taam mod_group=net.teamio.taam mc_version=1.12.2 diff --git a/common/net/teamio/taam/Taam.java b/common/net/teamio/taam/Taam.java index b40b9e5f..ca57d2da 100644 --- a/common/net/teamio/taam/Taam.java +++ b/common/net/teamio/taam/Taam.java @@ -1,12 +1,9 @@ package net.teamio.taam; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.util.ITooltipFlag; -import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.IStringSerializable; import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.teamio.taam.content.common.BlockOre; @@ -30,9 +27,6 @@ import net.teamio.taam.util.TaamUtil; import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -345,8 +339,8 @@ public boolean isDirectionSupported(EnumFacing dir) { } @Override - public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { - // So far, no additional info + public String[] getTooltip() { + return null; } } @@ -505,10 +499,8 @@ public String unlocalizedName() { } @Override - public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { - if (info != null) { - Collections.addAll(tooltip, info); - } + public String[] getTooltip() { + return info; } /* diff --git a/common/net/teamio/taam/content/conveyors/ItemAppliance.java b/common/net/teamio/taam/content/conveyors/ItemAppliance.java index fe6e374e..b6e73b91 100644 --- a/common/net/teamio/taam/content/conveyors/ItemAppliance.java +++ b/common/net/teamio/taam/content/conveyors/ItemAppliance.java @@ -64,15 +64,15 @@ public void getSubItems(CreativeTabs tab, NonNullList items) { @Override public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, - float hitX, float hitY, float hitZ, IBlockState newState) { + float hitX, float hitY, float hitZ, IBlockState newState) { EnumFacing dir = side.getOpposite(); int meta = stack.getMetadata(); IConveyorApplianceMetaInfo info = getInfo(meta); // If the player clicked the top or bottom & that is not supported // use the player's facing direction - if(!info.isDirectionSupported(dir)) { - if(dir.getAxis() == EnumFacing.Axis.Y) { + if (!info.isDirectionSupported(dir)) { + if (dir.getAxis() == EnumFacing.Axis.Y) { dir = player.getAdjustedHorizontalFacing(); } else { return false; @@ -105,8 +105,10 @@ public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn); - + String[] getTooltip(); } diff --git a/common/net/teamio/taam/machines/IMachineMetaInfo.java b/common/net/teamio/taam/machines/IMachineMetaInfo.java index e8a84877..5844566b 100644 --- a/common/net/teamio/taam/machines/IMachineMetaInfo.java +++ b/common/net/teamio/taam/machines/IMachineMetaInfo.java @@ -1,12 +1,6 @@ package net.teamio.taam.machines; -import net.minecraft.client.util.ITooltipFlag; -import net.minecraft.item.ItemStack; import net.minecraft.util.IStringSerializable; -import net.minecraft.world.World; - -import javax.annotation.Nullable; -import java.util.List; public interface IMachineMetaInfo extends IStringSerializable { IMachine createMachine(IMachineWrapper wrapper); @@ -15,5 +9,5 @@ public interface IMachineMetaInfo extends IStringSerializable { String unlocalizedName(); - void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn); + String[] getTooltip(); } diff --git a/common/net/teamio/taam/machines/MachineItemBlock.java b/common/net/teamio/taam/machines/MachineItemBlock.java index 91a2ca7e..097d5dc4 100644 --- a/common/net/teamio/taam/machines/MachineItemBlock.java +++ b/common/net/teamio/taam/machines/MachineItemBlock.java @@ -16,6 +16,7 @@ import net.teamio.taam.content.IRotatable; import javax.annotation.Nullable; +import java.util.Collections; import java.util.List; public class MachineItemBlock extends ItemBlock { @@ -34,8 +35,10 @@ public int getMetadata(int damage) { @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { int meta = stack.getMetadata(); - IMachineMetaInfo info = MachineTileEntity.getInfo(meta); - info.addInformation(stack, worldIn, tooltip, flagIn); + String[] ttip = MachineTileEntity.getInfo(meta).getTooltip(); + if (ttip != null) { + Collections.addAll(tooltip, ttip); + } } @Override