mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
faster chemplant ejector
This commit is contained in:
parent
b548b90bb3
commit
6b34f06324
@ -19,3 +19,4 @@
|
|||||||
* Fixed PWR fuel rods not having any radiation value assigned to them
|
* Fixed PWR fuel rods not having any radiation value assigned to them
|
||||||
* Fixed trenchmaster helmet not having gas mask protection
|
* Fixed trenchmaster helmet not having gas mask protection
|
||||||
* Fixed large thermobaric artillery rocket still using the wrong slag block
|
* Fixed large thermobaric artillery rocket still using the wrong slag block
|
||||||
|
* Fixed some of the assembly templates having broken names due to using the wrong way of translating the output
|
||||||
|
|||||||
@ -106,7 +106,7 @@ public class ItemAssemblyTemplate extends Item {
|
|||||||
return EnumChatFormatting.RED + "Broken Template" + EnumChatFormatting.RESET;
|
return EnumChatFormatting.RED + "Broken Template" + EnumChatFormatting.RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
String s1 = ("" + StatCollector.translateToLocal(out.getUnlocalizedName() + ".name")).trim();
|
String s1 = out.getDisplayName().trim();
|
||||||
|
|
||||||
if(s1 != null) {
|
if(s1 != null) {
|
||||||
s = s + " " + s1;
|
s = s + " " + s1;
|
||||||
|
|||||||
@ -428,41 +428,50 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
|
|||||||
ISidedInventory sided = inv instanceof ISidedInventory ? (ISidedInventory) inv : null;
|
ISidedInventory sided = inv instanceof ISidedInventory ? (ISidedInventory) inv : null;
|
||||||
int[] access = sided != null ? sided.getAccessibleSlotsFromSide(dir.ordinal()) : null;
|
int[] access = sided != null ? sided.getAccessibleSlotsFromSide(dir.ordinal()) : null;
|
||||||
|
|
||||||
for(int i = 5; i <= 8; i++) {
|
boolean shouldOutput = true;
|
||||||
|
|
||||||
ItemStack out = slots[i];
|
while(shouldOutput) {
|
||||||
|
shouldOutput = false;
|
||||||
|
outer:
|
||||||
|
for(int i = 5; i <= 8; i++) {
|
||||||
|
|
||||||
if(out != null) {
|
ItemStack out = slots[i];
|
||||||
|
|
||||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
if(out != null) {
|
||||||
|
|
||||||
int slot = access != null ? access[j] : j;
|
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||||
|
|
||||||
if(!inv.isItemValidForSlot(slot, out))
|
int slot = access != null ? access[j] : j;
|
||||||
continue;
|
|
||||||
|
|
||||||
ItemStack target = inv.getStackInSlot(slot);
|
if(!inv.isItemValidForSlot(slot, out))
|
||||||
|
continue;
|
||||||
|
|
||||||
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < target.getMaxStackSize()) {
|
ItemStack target = inv.getStackInSlot(slot);
|
||||||
this.decrStackSize(i, 1);
|
|
||||||
target.stackSize++;
|
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < Math.min(target.getMaxStackSize(), inv.getInventoryStackLimit())) {
|
||||||
return;
|
int toDec = Math.min(out.stackSize, Math.min(target.getMaxStackSize(), inv.getInventoryStackLimit()) - target.stackSize);
|
||||||
|
this.decrStackSize(i, toDec);
|
||||||
|
target.stackSize += toDec;
|
||||||
|
shouldOutput = true;
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||||
|
|
||||||
int slot = access != null ? access[j] : j;
|
int slot = access != null ? access[j] : j;
|
||||||
|
|
||||||
if(!inv.isItemValidForSlot(slot, out))
|
if(!inv.isItemValidForSlot(slot, out))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(inv.getStackInSlot(slot) == null && (sided != null ? sided.canInsertItem(slot, out, dir.ordinal()) : inv.isItemValidForSlot(slot, out))) {
|
if(inv.getStackInSlot(slot) == null && (sided != null ? sided.canInsertItem(slot, out, dir.ordinal()) : inv.isItemValidForSlot(slot, out))) {
|
||||||
ItemStack copy = out.copy();
|
ItemStack copy = out.copy();
|
||||||
copy.stackSize = 1;
|
copy.stackSize = 1;
|
||||||
inv.setInventorySlotContents(slot, copy);
|
inv.setInventorySlotContents(slot, copy);
|
||||||
this.decrStackSize(i, 1);
|
this.decrStackSize(i, 1);
|
||||||
return;
|
shouldOutput = true;
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -272,41 +272,49 @@ public abstract class TileEntityMachineChemplantBase extends TileEntityMachineBa
|
|||||||
ISidedInventory sided = inv instanceof ISidedInventory ? (ISidedInventory) inv : null;
|
ISidedInventory sided = inv instanceof ISidedInventory ? (ISidedInventory) inv : null;
|
||||||
int[] access = sided != null ? sided.getAccessibleSlotsFromSide(coord.getDir().ordinal()) : null;
|
int[] access = sided != null ? sided.getAccessibleSlotsFromSide(coord.getDir().ordinal()) : null;
|
||||||
|
|
||||||
for(int i = indices[2]; i <= indices[3]; i++) {
|
boolean shouldOutput = true;
|
||||||
|
while(shouldOutput) {
|
||||||
|
shouldOutput = false;
|
||||||
|
outer:
|
||||||
|
for(int i = indices[2]; i <= indices[3]; i++) {
|
||||||
|
|
||||||
ItemStack out = slots[i];
|
ItemStack out = slots[i];
|
||||||
|
|
||||||
if(out != null) {
|
if(out != null) {
|
||||||
|
|
||||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||||
|
|
||||||
int slot = access != null ? access[j] : j;
|
int slot = access != null ? access[j] : j;
|
||||||
|
|
||||||
if(!inv.isItemValidForSlot(slot, out))
|
if(!inv.isItemValidForSlot(slot, out))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ItemStack target = inv.getStackInSlot(slot);
|
ItemStack target = inv.getStackInSlot(slot);
|
||||||
|
|
||||||
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < target.getMaxStackSize() && target.stackSize < inv.getInventoryStackLimit()) {
|
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < target.getMaxStackSize() && target.stackSize < inv.getInventoryStackLimit()) {
|
||||||
this.decrStackSize(i, 1);
|
int toDec = Math.min(out.stackSize, Math.min(target.getMaxStackSize(), inv.getInventoryStackLimit()) - target.stackSize);
|
||||||
target.stackSize++;
|
this.decrStackSize(i, toDec);
|
||||||
return;
|
target.stackSize += toDec;
|
||||||
|
shouldOutput = true;
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||||
|
|
||||||
int slot = access != null ? access[j] : j;
|
int slot = access != null ? access[j] : j;
|
||||||
|
|
||||||
if(!inv.isItemValidForSlot(slot, out))
|
if(!inv.isItemValidForSlot(slot, out))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(inv.getStackInSlot(slot) == null && (sided != null ? sided.canInsertItem(slot, out, coord.getDir().ordinal()) : inv.isItemValidForSlot(slot, out))) {
|
if(inv.getStackInSlot(slot) == null && (sided != null ? sided.canInsertItem(slot, out, coord.getDir().ordinal()) : inv.isItemValidForSlot(slot, out))) {
|
||||||
ItemStack copy = out.copy();
|
ItemStack copy = out.copy();
|
||||||
copy.stackSize = 1;
|
copy.stackSize = 1;
|
||||||
inv.setInventorySlotContents(slot, copy);
|
inv.setInventorySlotContents(slot, copy);
|
||||||
this.decrStackSize(i, 1);
|
this.decrStackSize(i, 1);
|
||||||
return;
|
shouldOutput = true;
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user