2018-10-13 23:46:30 +02:00
|
|
|
package de.ellpeck.naturesaura.blocks.tiles;
|
|
|
|
|
2018-11-12 01:29:33 +01:00
|
|
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
2018-11-11 13:26:19 +01:00
|
|
|
import de.ellpeck.naturesaura.api.aura.container.IAuraContainer;
|
|
|
|
import de.ellpeck.naturesaura.api.aura.container.NaturalAuraContainer;
|
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
|
|
|
|
2019-01-29 11:46:38 +01:00
|
|
|
private final NaturalAuraContainer container = new NaturalAuraContainer(NaturesAuraAPI.TYPE_OVERWORLD, 2000, 500) {
|
2018-10-14 14:27:18 +02:00
|
|
|
@Override
|
|
|
|
public int getAuraColor() {
|
2019-01-30 17:51:39 +01:00
|
|
|
return 0xCE5489;
|
2018-10-14 14:27:18 +02:00
|
|
|
}
|
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
|
2018-11-04 16:38:09 +01:00
|
|
|
public void writeNBT(NBTTagCompound compound, SaveType type) {
|
|
|
|
super.writeNBT(compound, type);
|
|
|
|
if (type != SaveType.BLOCK)
|
|
|
|
this.container.writeNBT(compound);
|
2018-10-14 14:27:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-11-04 16:38:09 +01:00
|
|
|
public void readNBT(NBTTagCompound compound, SaveType type) {
|
|
|
|
super.readNBT(compound, type);
|
|
|
|
if (type != SaveType.BLOCK)
|
|
|
|
this.container.readNBT(compound);
|
2018-10-14 14:27:18 +02:00
|
|
|
}
|
2018-10-13 23:46:30 +02:00
|
|
|
}
|