Make RBMK slotted elements have OC accessible inventories, and added a OC outgasser function that allows seeing the item that is being processed.

This commit is contained in:
Kellen Hurrey 2025-09-19 10:51:32 -06:00
parent f6c74ce98e
commit ebd7ffc827
No known key found for this signature in database
GPG Key ID: CF1E5CF3DB06C0D3
2 changed files with 56 additions and 37 deletions

View File

@ -273,6 +273,15 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
return new Object[] {progress};
}
@Callback(direct = true, doc = "Returns the unlocalized name and size of the stack that the outgasser is crafting (the input), or nil, nil if there is no stack")
@Optional.Method(modid = "OpenComputers")
public Object[] getCrafting(Context context, Arguments args) {
if (slots[0] == null)
return new Object[] { null, null };
else
return new Object[]{slots[0].getUnlocalizedName(), slots[0].stackSize};
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getCoordinates(Context context, Arguments args) {

View File

@ -2,6 +2,7 @@ package com.hbm.tileentity.machine.rbmk;
import com.hbm.tileentity.IGUIProvider;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -87,6 +88,15 @@ public abstract class TileEntityRBMKSlottedBase extends TileEntityRBMKActiveBase
return false;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
return false;
} else {
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 128;
}
}
@Override
public ItemStack decrStackSize(int slot, int amount) {
if(slots[slot] != null) {