mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +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
@@ -10,122 +10,105 @@ import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.*;
|
||||
import tconstruct.tools.logic.EquipLogic;
|
||||
|
||||
public class BattleSign extends Weapon
|
||||
{
|
||||
public BattleSign()
|
||||
{
|
||||
public class BattleSign extends Weapon {
|
||||
public BattleSign() {
|
||||
super(1);
|
||||
this.setUnlocalizedName("InfiTool.Battlesign");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolName ()
|
||||
{
|
||||
public String getToolName() {
|
||||
return "Battlesign";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
public Item getHeadItem() {
|
||||
return TinkerTools.signHead;
|
||||
}
|
||||
|
||||
@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 "_battlesign_head";
|
||||
case 1:
|
||||
return "_battlesign_head_broken";
|
||||
case 2:
|
||||
return "_battlesign_handle";
|
||||
default:
|
||||
return "";
|
||||
public String getIconSuffix(int partType) {
|
||||
switch (partType) {
|
||||
case 0:
|
||||
return "_battlesign_head";
|
||||
case 1:
|
||||
return "_battlesign_head_broken";
|
||||
case 2:
|
||||
return "_battlesign_handle";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEffectSuffix ()
|
||||
{
|
||||
public String getEffectSuffix() {
|
||||
return "_battlesign_effect";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultFolder ()
|
||||
{
|
||||
public String getDefaultFolder() {
|
||||
return "battlesign";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)
|
||||
{
|
||||
if (side == 0 || !player.isSneaking())
|
||||
{
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float clickX,
|
||||
float clickY,
|
||||
float clickZ) {
|
||||
if (side == 0 || !player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
else if (!world.getBlock(x, y, z).getMaterial().isSolid())
|
||||
{
|
||||
} else if (!world.getBlock(x, y, z).getMaterial().isSolid()) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
} else {
|
||||
if (side == 1) {
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
{
|
||||
if (side == 2) {
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
{
|
||||
if (side == 3) {
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
{
|
||||
if (side == 4) {
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
{
|
||||
if (side == 5) {
|
||||
++x;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||
{
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack)) {
|
||||
return false;
|
||||
}
|
||||
else if (!TinkerTools.battlesignBlock.canPlaceBlockAt(world, x, y, z))
|
||||
{
|
||||
} else if (!TinkerTools.battlesignBlock.canPlaceBlockAt(world, x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
world.setBlock(x, y, z, TinkerTools.battlesignBlock, 0, 3);
|
||||
TinkerTools.battlesignBlock.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
|
||||
@@ -133,8 +116,7 @@ public class BattleSign extends Weapon
|
||||
logic.setEquipmentItem(stack);
|
||||
--stack.stackSize;
|
||||
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
||||
{
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
player.openGui(TConstruct.instance, ToolProxyClient.battlesignTextID, world, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user