2018-10-13 23:46:30 +02:00
|
|
|
package de.ellpeck.naturesaura.blocks.tiles;
|
|
|
|
|
2018-10-21 12:51:13 +02:00
|
|
|
import de.ellpeck.naturesaura.aura.container.FiniteAuraContainer;
|
|
|
|
import de.ellpeck.naturesaura.aura.container.IAuraContainer;
|
2018-10-14 14:27:18 +02:00
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2018-10-20 21:19:08 +02:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2018-10-14 14:27:18 +02:00
|
|
|
|
2018-10-20 21:19:08 +02:00
|
|
|
public class TileEntityAncientLeaves extends TileEntityImpl {
|
2018-10-14 14:27:18 +02:00
|
|
|
|
2018-10-20 21:19:08 +02:00
|
|
|
private final FiniteAuraContainer container = new FiniteAuraContainer(20, false) {
|
2018-10-14 14:27:18 +02:00
|
|
|
@Override
|
|
|
|
public int getAuraColor() {
|
|
|
|
return 0xc46df9;
|
|
|
|
}
|
2018-10-14 16:12:33 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public int drainAura(int amountToDrain, boolean simulate) {
|
|
|
|
int amount = super.drainAura(amountToDrain, simulate);
|
|
|
|
if (amount > 0 && !simulate) {
|
|
|
|
TileEntityAncientLeaves.this.sendToClients();
|
|
|
|
}
|
|
|
|
return amount;
|
|
|
|
}
|
2018-10-14 14:27:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
@Override
|
2018-10-20 21:19:08 +02:00
|
|
|
public IAuraContainer getAuraContainer(EnumFacing facing) {
|
2018-10-14 14:27:18 +02:00
|
|
|
return this.container;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeNBT(NBTTagCompound compound, boolean syncing) {
|
|
|
|
super.writeNBT(compound, syncing);
|
|
|
|
this.container.writeNBT(compound);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void readNBT(NBTTagCompound compound, boolean syncing) {
|
|
|
|
super.readNBT(compound, syncing);
|
|
|
|
this.container.readNBT(compound);
|
|
|
|
}
|
2018-10-13 23:46:30 +02:00
|
|
|
}
|