mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-24 22:14:29 +00:00
Compare commits
33
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92bf2aba66 | ||
|
|
e781d2e49a | ||
|
|
2f4397f236 | ||
|
|
23015aa613 | ||
|
|
83c54ec6c6 | ||
|
|
688c2c1f36 | ||
|
|
22280ea320 | ||
|
|
6df14438c5 | ||
|
|
0b1019bdf0 | ||
|
|
a811d20299 | ||
|
|
4e1835ed12 | ||
|
|
1db5809cde | ||
|
|
fa4411ad2e | ||
|
|
80f7455e7f | ||
|
|
b9cac67ec7 | ||
|
|
41a6cc0711 | ||
|
|
319ed409f1 | ||
|
|
ad153f1c0a | ||
|
|
e340423b28 | ||
|
|
7b0feb16f9 | ||
|
|
e0b34e8b9a | ||
|
|
c533f6f1b5 | ||
|
|
140977be2e | ||
|
|
8a13af1969 | ||
|
|
d6d50a968d | ||
|
|
43459d4b41 | ||
|
|
2a1aff073b | ||
|
|
73eea57d11 | ||
|
|
9b84ea7804 | ||
|
|
de42a43b2c | ||
|
|
b89734f3e6 | ||
|
|
7445d96531 | ||
|
|
dc997626c1 |
No files matched your search
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.api.IBookmarkContainerHandler;
|
||||
@@ -13,14 +12,15 @@ public class DefaultBookmarkContainerHandler implements IBookmarkContainerHandle
|
||||
|
||||
@Override
|
||||
public void pullBookmarkItemsFromContainer(GuiContainer guiContainer, ArrayList<ItemStack> bookmarkItems) {
|
||||
final List<Slot> slots = guiContainer.inventorySlots.inventorySlots;
|
||||
final FastTransferManager manager = new FastTransferManager();
|
||||
final List<ItemStack> containerStacks = getStorageStacks(guiContainer);
|
||||
|
||||
for (ItemStack bookmarkItem : bookmarkItems) {
|
||||
for (int i = 0; i < slots.size() - 4 * 9; i++) {
|
||||
final Slot slot = slots.get(i);
|
||||
if (slot.getHasStack() && bookmarkItem.isItemEqual(slot.getStack())) {
|
||||
final int transferAmount = Math.min(bookmarkItem.stackSize, slot.getStack().stackSize);
|
||||
for (int i = 0; i < containerStacks.size() && bookmarkItem.stackSize > 0; i++) {
|
||||
final ItemStack containerItem = containerStacks.get(i);
|
||||
|
||||
if (bookmarkItem.isItemEqual(containerItem)) {
|
||||
final int transferAmount = Math.min(bookmarkItem.stackSize, containerItem.stackSize);
|
||||
manager.transferItems(guiContainer, i, transferAmount);
|
||||
bookmarkItem.stackSize -= transferAmount;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -34,22 +33,7 @@ public class ItemMobSpawner extends ItemBlock {
|
||||
private static final Map<Class<? extends Entity>, String> ENTITY_CLASS_TO_NAME_CACHE = new ConcurrentHashMap<>();
|
||||
|
||||
public static int idPig = 90;
|
||||
private static volatile boolean loaded = false;
|
||||
|
||||
// For asm
|
||||
public static int placedX;
|
||||
public static int placedY;
|
||||
public static int placedZ;
|
||||
|
||||
public static void setLastPlacedPosition(int x, int y, int z) {
|
||||
placedX = x;
|
||||
placedY = y;
|
||||
placedZ = z;
|
||||
}
|
||||
|
||||
public static int[] getLastPlacedPosition() {
|
||||
return new int[] { placedX, placedY, placedZ };
|
||||
}
|
||||
private static boolean loaded = false;
|
||||
|
||||
public ItemMobSpawner() {
|
||||
super(Blocks.mob_spawner);
|
||||
@@ -65,22 +49,15 @@ public class ItemMobSpawner extends ItemBlock {
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int x, int y, int z, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
|
||||
placedX = x;
|
||||
placedY = y;
|
||||
placedZ = z;
|
||||
|
||||
boolean placed = super.onItemUse(itemstack, entityplayer, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
|
||||
if (placed && !world.isRemote) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (tileEntity instanceof TileEntityMobSpawner) {
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tileEntity;
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityMobSpawner) {
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) world.getTileEntity(x, y, z);
|
||||
String mobType = getMobTypeFromItemStack(itemstack);
|
||||
if (mobType != null) {
|
||||
spawner.func_145881_a().setEntityName(mobType);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
NEICPH.sendMobSpawnerID(x, y, z, mobType);
|
||||
spawner.func_145881_a().setEntityName(mobType);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -230,6 +207,10 @@ public class ItemMobSpawner extends ItemBlock {
|
||||
}
|
||||
|
||||
synchronized (ItemMobSpawner.class) {
|
||||
if (loaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
for (Map.Entry<Class<? extends Entity>, String> entry : ((Map<Class<? extends Entity>, String>) EntityList.classToStringMapping)
|
||||
.entrySet()) {
|
||||
|
||||
Reference in new issue
Block a user