Fix JABBA-related issues with crafting station slots (#54)

* Fix shift-merging tools voiding items

fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392>

* Change 0-sized ItemStacks into null stacks in crafting station attached slots

Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425>

* Update buildscript

* spotlessApply
This commit is contained in:
Raven Szewczyk authored and GitHub committed 2022-09-22 20:51:23 +02:00
1 parent 18bfeaff32
commit 39be06c23b
571 files changed
+25959 -28223

No files matched your search

@@ -1,14 +1,12 @@
package tconstruct.tools.items;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.books.BookData;
import mantle.client.gui.GuiManual;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -17,24 +15,22 @@ import tconstruct.achievements.TAchievements;
import tconstruct.client.TProxyClient;
import tconstruct.library.TConstructRegistry;
public class Manual extends CraftingItem
{
static String[] name = new String[] { "beginner", "toolstation", "smeltery", "diary", "weaponry" };
static String[] textureName = new String[] { "tinkerbook_diary", "tinkerbook_toolstation", "tinkerbook_smeltery", "tinkerbook_blue", "tinkerbook_green" };
public class Manual extends CraftingItem {
static String[] name = new String[] {"beginner", "toolstation", "smeltery", "diary", "weaponry"};
static String[] textureName = new String[] {
"tinkerbook_diary", "tinkerbook_toolstation", "tinkerbook_smeltery", "tinkerbook_blue", "tinkerbook_green"
};
public Manual()
{
public Manual() {
super(name, textureName, "", "tinker", TConstructRegistry.materialTab);
setUnlocalizedName("tconstruct.manual");
}
@Override
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
{
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
TAchievements.triggerAchievement(player, "tconstruct.beginner");
if(world.isRemote) {
if (world.isRemote) {
openBook(stack, world, player);
}
return stack;
@@ -46,45 +42,40 @@ public class Manual extends CraftingItem
FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(stack, getData(stack)));
}
private BookData getData (ItemStack stack)
{
switch (stack.getItemDamage())
{
case 0:
return TProxyClient.manualData.beginner;
case 1:
return TProxyClient.manualData.toolStation;
case 2:
return TProxyClient.manualData.smeltery;
case 4:
return TProxyClient.manualData.weaponry;
default:
return TProxyClient.manualData.diary;
private BookData getData(ItemStack stack) {
switch (stack.getItemDamage()) {
case 0:
return TProxyClient.manualData.beginner;
case 1:
return TProxyClient.manualData.toolStation;
case 2:
return TProxyClient.manualData.smeltery;
case 4:
return TProxyClient.manualData.weaponry;
default:
return TProxyClient.manualData.diary;
}
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
switch (stack.getItemDamage())
{
case 0:
list.add("\u00a7o" + StatCollector.translateToLocal("manual1.tooltip"));
break;
case 1:
list.add("\u00a7o" + StatCollector.translateToLocal("manual2.tooltip"));
break;
case 2:
list.add("\u00a7o" + StatCollector.translateToLocal("manual3.tooltip"));
break;
case 4:
list.add("\u00a7o" + StatCollector.translateToLocal("manual4.tooltip"));
break;
default:
list.add("\u00a7o" + StatCollector.translateToLocal("manual5.tooltip"));
break;
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
switch (stack.getItemDamage()) {
case 0:
list.add("\u00a7o" + StatCollector.translateToLocal("manual1.tooltip"));
break;
case 1:
list.add("\u00a7o" + StatCollector.translateToLocal("manual2.tooltip"));
break;
case 2:
list.add("\u00a7o" + StatCollector.translateToLocal("manual3.tooltip"));
break;
case 4:
list.add("\u00a7o" + StatCollector.translateToLocal("manual4.tooltip"));
break;
default:
list.add("\u00a7o" + StatCollector.translateToLocal("manual5.tooltip"));
break;
}
}
}