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

@@ -9,88 +9,77 @@ import net.minecraft.world.World;
import tconstruct.library.tools.*;
import tconstruct.tools.TinkerTools;
public class Hatchet extends HarvestTool
{
public Hatchet()
{
public class Hatchet extends HarvestTool {
public Hatchet() {
super(3);
this.setUnlocalizedName("InfiTool.Axe");
}
@Override
protected Material[] getEffectiveMaterials ()
{
protected Material[] getEffectiveMaterials() {
return materials;
}
@Override
protected String getHarvestType ()
{
protected String getHarvestType() {
return "axe";
}
@Override
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
{
if (block != null && block.getMaterial() == Material.leaves)
return false;
public boolean onBlockDestroyed(
ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player) {
if (block != null && block.getMaterial() == Material.leaves) return false;
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
}
static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.gourd };
static Material[] materials = {
Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.gourd
};
@Override
public Item getHeadItem ()
{
public Item getHeadItem() {
return TinkerTools.hatchetHead;
}
@Override
public Item getAccessoryItem ()
{
public Item getAccessoryItem() {
return null;
}
@Override
public int getPartAmount ()
{
public int getPartAmount() {
return 2;
}
@Override
public void registerPartPaths (int index, String[] location)
{
public void registerPartPaths(int index, String[] location) {
headStrings.put(index, location[0]);
brokenPartStrings.put(index, location[1]);
handleStrings.put(index, location[2]);
}
@Override
public String getIconSuffix (int partType)
{
switch (partType)
{
case 0:
return "_axe_head";
case 1:
return "_axe_head_broken";
case 2:
return "_axe_handle";
default:
return "";
public String getIconSuffix(int partType) {
switch (partType) {
case 0:
return "_axe_head";
case 1:
return "_axe_head_broken";
case 2:
return "_axe_handle";
default:
return "";
}
}
@Override
public String getEffectSuffix ()
{
public String getEffectSuffix() {
return "_axe_effect";
}
@Override
public String getDefaultFolder ()
{
public String getDefaultFolder() {
return "axe";
}
}