Fixed an issue with repairs taking items not related with the repaired one
parent
32b1194eec
commit
141217b365
|
@ -9,7 +9,7 @@ import java.util.HashMap;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.Player;
|
||||
import net.minecraft.item.ItemInstance;
|
||||
import net.minecraft.tile.Tile;
|
||||
import net.minecraft.item.ItemType;
|
||||
|
||||
public class WyHelper {
|
||||
|
||||
|
@ -90,8 +90,10 @@ public class WyHelper {
|
|||
}
|
||||
|
||||
public static void cheatCommand(Player player) {
|
||||
player.dropItem(new ItemInstance(Tile.LADDER, 64));
|
||||
player.dropItem(new ItemInstance(Tile.WOOD, 64));
|
||||
player.dropItem(new ItemInstance(ItemType.pickaxeIron, 1, 100));
|
||||
player.dropItem(new ItemInstance(ItemType.pickaxeIron, 1, 150));
|
||||
player.dropItem(new ItemInstance(ItemType.pickaxeDiamond, 1, 150));
|
||||
// player.dropItem(new ItemInstance(Tile.WOOD, 64));
|
||||
// player.dropItem(new ItemInstance(ItemType.snowball, 60));
|
||||
|
||||
player.level.setLevelTime(0);
|
||||
|
|
|
@ -26,7 +26,12 @@ public class CraftingContainerMixin {
|
|||
int damage = 0;
|
||||
|
||||
for (int i = 0; i < inventory.getInvSize(); i++) {
|
||||
ItemInstance item = inventory.getInvItem(i);
|
||||
ItemInstance item = inventory.getInvItem(i);
|
||||
if ((item != null && item.method_723() <= 0) || (item != null && resultItem != null && item.itemId != resultItem.itemId)) {
|
||||
resultItem = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (item != null && item.method_723() > 0) {
|
||||
if (resultItem == null) {
|
||||
resultItem = new ItemInstance(item.itemId, 1, item.getDamage());
|
||||
|
|
Loading…
Reference in New Issue