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,12 +1,9 @@
package tconstruct.weaponry.weapons;
import tconstruct.weaponry.TinkerWeaponry;
import tconstruct.weaponry.client.CrosshairType;
import tconstruct.client.IconFlipped;
import tconstruct.weaponry.entity.ShurikenEntity;
import tconstruct.library.weaponry.AmmoWeapon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Iterator;
import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -15,9 +12,11 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import java.util.Iterator;
import java.util.Map;
import tconstruct.client.IconFlipped;
import tconstruct.library.weaponry.AmmoWeapon;
import tconstruct.weaponry.TinkerWeaponry;
import tconstruct.weaponry.client.CrosshairType;
import tconstruct.weaponry.entity.ShurikenEntity;
public class Shuriken extends AmmoWeapon {
@@ -52,8 +51,7 @@ public class Shuriken extends AmmoWeapon {
@Override
public String getIconSuffix(int partType) {
switch (partType)
{
switch (partType) {
case 0:
return "_shuriken";
case 1:
@@ -116,8 +114,7 @@ public class Shuriken extends AmmoWeapon {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(getAmmoCount(stack) <= 0)
return stack;
if (getAmmoCount(stack) <= 0) return stack;
launchProjectile(stack, world, player, 1);
@@ -160,8 +157,7 @@ public class Shuriken extends AmmoWeapon {
// now we flip all the different part icons, so we only need 1 graphic for 4 different orientations \o/
// handle first: flip x
Iterator<Map.Entry<Integer, IIcon>> iter = handleIcons.entrySet().iterator();
while(iter.hasNext())
{
while (iter.hasNext()) {
Map.Entry<Integer, IIcon> entry = iter.next();
entry.setValue(new IconFlipped(entry.getValue(), true, false));
// the entry object should reference the direct object in the map, no further updating needed
@@ -169,16 +165,14 @@ public class Shuriken extends AmmoWeapon {
// accessory: flip y
iter = accessoryIcons.entrySet().iterator();
while(iter.hasNext())
{
while (iter.hasNext()) {
Map.Entry<Integer, IIcon> entry = iter.next();
entry.setValue(new IconFlipped(entry.getValue(), false, true));
}
// extra: flip x and y
iter = extraIcons.entrySet().iterator();
while(iter.hasNext())
{
while (iter.hasNext()) {
Map.Entry<Integer, IIcon> entry = iter.next();
entry.setValue(new IconFlipped(entry.getValue(), true, true));
}
@@ -189,6 +183,4 @@ public class Shuriken extends AmmoWeapon {
public CrosshairType getCrosshairType() {
return CrosshairType.TIP;
}
}