mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 14:59:22 +01:00
display the amount of items in the adept hopper
This commit is contained in:
parent
da498aea97
commit
d555904411
4 changed files with 21 additions and 6 deletions
|
@ -19,7 +19,7 @@ import java.util.List;
|
|||
|
||||
public class TileEntityGratedChute extends TileEntityImpl implements ITickable {
|
||||
|
||||
private final ItemStackHandlerNA items = new ItemStackHandlerNA(1, this, false) {
|
||||
private final ItemStackHandlerNA items = new ItemStackHandlerNA(1, this, true) {
|
||||
@Override
|
||||
protected boolean canExtract(ItemStack stack, int slot, int amount) {
|
||||
return TileEntityGratedChute.this.redstonePower <= 0;
|
||||
|
@ -124,15 +124,19 @@ public class TileEntityGratedChute extends TileEntityImpl implements ITickable {
|
|||
@Override
|
||||
public void writeNBT(NBTTagCompound compound, SaveType type) {
|
||||
super.writeNBT(compound, type);
|
||||
if (type != SaveType.BLOCK)
|
||||
if (type != SaveType.BLOCK) {
|
||||
compound.setInteger("cooldown", this.cooldown);
|
||||
compound.setTag("items", this.items.serializeNBT());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNBT(NBTTagCompound compound, SaveType type) {
|
||||
super.readNBT(compound, type);
|
||||
if (type != SaveType.BLOCK)
|
||||
if (type != SaveType.BLOCK) {
|
||||
this.cooldown = compound.getInteger("cooldown");
|
||||
this.items.deserializeNBT(compound.getCompoundTag("items"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,13 +9,13 @@ import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
|
|||
import de.ellpeck.naturesaura.api.aura.container.IAuraContainer;
|
||||
import de.ellpeck.naturesaura.api.aura.type.IAuraType;
|
||||
import de.ellpeck.naturesaura.api.render.IVisualizable;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityGratedChute;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityNatureAltar;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityRFConverter;
|
||||
import de.ellpeck.naturesaura.compat.Compat;
|
||||
import de.ellpeck.naturesaura.items.ItemRangeVisualizer;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.particles.ParticleHandler;
|
||||
import de.ellpeck.naturesaura.particles.ParticleMagic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -37,7 +37,6 @@ import net.minecraft.world.biome.BiomeColorHelper;
|
|||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.energy.EnergyStorage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
@ -365,6 +364,17 @@ public class ClientEvents {
|
|||
this.drawContainerInfo(storage.getEnergyStored(), storage.getMaxEnergyStored(), 0xcc4916,
|
||||
mc, res, 35, I18n.format("tile.naturesaura.rf_converter.name"),
|
||||
storage.getEnergyStored() + " / " + storage.getMaxEnergyStored() + " RF");
|
||||
} else if (tile instanceof TileEntityGratedChute) {
|
||||
ItemStack stack = ((TileEntityGratedChute) tile).getItemHandler(null).getStackInSlot(0);
|
||||
|
||||
int x = res.getScaledWidth() / 2;
|
||||
int y = res.getScaledHeight() / 2;
|
||||
if (stack.isEmpty())
|
||||
mc.fontRenderer.drawString(
|
||||
TextFormatting.GRAY.toString() + TextFormatting.ITALIC + I18n.format("info.naturesaura.empty"),
|
||||
x + 5, y - 11, 0xFFFFFF, true);
|
||||
else
|
||||
Helper.renderItemInGui(stack, x + 2, y - 18, 1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@ info.naturesaura.connected=You made a connection
|
|||
info.naturesaura.same_position=This seems to be the position from your notes...
|
||||
info.naturesaura.too_far=The distance seems too great...
|
||||
info.naturesaura.stored_pos_gone=Your notes seem out of date...
|
||||
info.naturesaura.empty=Empty
|
||||
|
||||
advancement.naturesaura.root=Nature's Aura
|
||||
advancement.naturesaura.root.desc=Becoming a magical botanist
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
},
|
||||
{
|
||||
"type": "crafting",
|
||||
"text": "Creating the $(item)Adept Hopper$()",
|
||||
"text": "Creating the $(item)Adept Hopper$()$(p)It should be noted that, when equipping an $(l:items/eye)Environmental Eye$(), the amount of items currently stored in the hopper can be seen.",
|
||||
"recipe": "naturesaura:grated_chute"
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue