mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-25 22:44:23 +00:00
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:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -1,14 +1,10 @@
|
||||
package tconstruct.gadgets;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import java.util.Locale;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -16,6 +12,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.gadgets.item.ItemSlimeBoots;
|
||||
import tconstruct.gadgets.item.ItemSlimeSling;
|
||||
@@ -25,58 +23,54 @@ import tconstruct.library.TConstructRegistry;
|
||||
@Pulse(id = "Tinkers' Gadgets", description = "All the fun toys.")
|
||||
public class TinkerGadgets {
|
||||
|
||||
public static final String PulseId = "TinkerGadgets";
|
||||
public static final Logger log = LogManager.getLogger(PulseId);
|
||||
public static final String PulseId = "TinkerGadgets";
|
||||
public static final Logger log = LogManager.getLogger(PulseId);
|
||||
|
||||
// Gadgets
|
||||
public static ItemSlimeSling slimeSling;
|
||||
public static ItemSlimeBoots slimeBoots;
|
||||
// Gadgets
|
||||
public static ItemSlimeSling slimeSling;
|
||||
public static ItemSlimeBoots slimeBoots;
|
||||
|
||||
@Handler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
@Handler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
SlimeBounceHandler.init();
|
||||
slimeSling = registerItem(new ItemSlimeSling(), "slimesling");
|
||||
slimeBoots = registerItem(new ItemSlimeBoots(), "slime_boots");
|
||||
SlimeBounceHandler.init();
|
||||
slimeSling = registerItem(new ItemSlimeSling(), "slimesling");
|
||||
slimeBoots = registerItem(new ItemSlimeBoots(), "slime_boots");
|
||||
}
|
||||
|
||||
}
|
||||
@Handler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
String ore = "blockSlime";
|
||||
|
||||
@Handler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
String ore = "blockSlime";
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(new ItemStack(slimeBoots), " ", "s s", "b b", 's', "slimeball", 'b', ore));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(slimeSling), "fbf", "s s", " s ", 'f', Items.string, 's', "slimeball", 'b', ore));
|
||||
TConstructRegistry.gadgetsTab.init(new ItemStack(slimeBoots));
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(new ItemStack(slimeBoots), " ", "s s", "b b", 's', "slimeball", 'b', ore));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(slimeSling), "fbf", "s s", " s ", 'f', Items.string,
|
||||
's', "slimeball", 'b', ore));
|
||||
TConstructRegistry.gadgetsTab.init(new ItemStack(slimeBoots));
|
||||
@Handler
|
||||
public void postInit(FMLPostInitializationEvent evt) {}
|
||||
|
||||
}
|
||||
public static String resource(String res) {
|
||||
return String.format("%s:%s", "tinker", res);
|
||||
}
|
||||
|
||||
@Handler
|
||||
public void postInit(FMLPostInitializationEvent evt) {
|
||||
public static ResourceLocation getResource(String res) {
|
||||
return new ResourceLocation("tinker", res);
|
||||
}
|
||||
|
||||
}
|
||||
public static String prefix(String name) {
|
||||
return String.format("%s.%s", TConstruct.modID, name.toLowerCase(Locale.US));
|
||||
}
|
||||
|
||||
public static String resource(String res) {
|
||||
return String.format("%s:%s", "tinker", res);
|
||||
}
|
||||
|
||||
public static ResourceLocation getResource(String res) {
|
||||
return new ResourceLocation("tinker", res);
|
||||
}
|
||||
|
||||
public static String prefix(String name) {
|
||||
return String.format("%s.%s", TConstruct.modID, name.toLowerCase(Locale.US));
|
||||
}
|
||||
|
||||
protected static <T extends Item> T registerItem(T item, String name) {
|
||||
if (!name.equals(name.toLowerCase(Locale.US))) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Unlocalized names need to be all lowercase! Item: %s", name));
|
||||
}
|
||||
item.setUnlocalizedName(prefix(name));
|
||||
GameRegistry.registerItem(item, name);
|
||||
return item;
|
||||
}
|
||||
protected static <T extends Item> T registerItem(T item, String name) {
|
||||
if (!name.equals(name.toLowerCase(Locale.US))) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Unlocalized names need to be all lowercase! Item: %s", name));
|
||||
}
|
||||
item.setUnlocalizedName(prefix(name));
|
||||
GameRegistry.registerItem(item, name);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user