2015-08-29 14:33:25 +02:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("TileEntityBase.java") is part of the Actually Additions mod for Minecraft.
|
2015-08-29 14:33:25 +02:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2015-08-29 14:33:25 +02:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2015-08-29 14:33:25 +02:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.tile;
|
2014-12-12 15:40:01 +01:00
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
2018-09-27 21:17:23 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.util.VanillaPacketDispatcher;
|
2016-06-17 13:25:15 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
|
2021-02-27 13:24:45 +01:00
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.client.renderer.texture.ITickable;
|
2021-02-26 22:15:48 +01:00
|
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
|
|
import net.minecraft.nbt.CompoundNBT;
|
2015-06-15 22:06:07 +02:00
|
|
|
import net.minecraft.network.NetworkManager;
|
2021-02-27 13:24:45 +01:00
|
|
|
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
|
2021-12-29 03:36:23 +01:00
|
|
|
import net.minecraft.tileentity.ITickableTileEntity;
|
2014-12-12 15:40:01 +01:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2021-02-27 13:24:45 +01:00
|
|
|
import net.minecraft.tileentity.TileEntityType;
|
|
|
|
import net.minecraft.util.Direction;
|
2016-03-18 23:47:22 +01:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2016-06-05 02:16:52 +02:00
|
|
|
import net.minecraftforge.common.capabilities.Capability;
|
2021-02-27 13:24:45 +01:00
|
|
|
import net.minecraftforge.common.util.LazyOptional;
|
2016-11-26 08:58:42 +01:00
|
|
|
import net.minecraftforge.energy.CapabilityEnergy;
|
|
|
|
import net.minecraftforge.energy.IEnergyStorage;
|
2016-06-05 02:16:52 +02:00
|
|
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
|
|
|
import net.minecraftforge.fluids.capability.IFluidHandler;
|
2016-12-04 00:10:52 +01:00
|
|
|
import net.minecraftforge.items.CapabilityItemHandler;
|
|
|
|
import net.minecraftforge.items.IItemHandler;
|
2014-12-12 15:40:01 +01:00
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
2021-12-29 03:36:23 +01:00
|
|
|
public abstract class TileEntityBase extends TileEntity implements ITickableTileEntity {
|
2015-06-15 22:06:07 +02:00
|
|
|
|
2016-06-01 00:39:35 +02:00
|
|
|
public boolean isRedstonePowered;
|
2016-07-02 15:01:46 +02:00
|
|
|
public boolean isPulseMode;
|
2016-11-27 23:04:26 +01:00
|
|
|
public boolean stopFromDropping;
|
2016-12-18 17:50:31 +01:00
|
|
|
protected int ticksElapsed;
|
2016-09-09 18:40:09 +02:00
|
|
|
protected TileEntity[] tilesAround = new TileEntity[6];
|
2016-10-29 12:00:00 +02:00
|
|
|
protected boolean hasSavedDataOnChangeOrWorldStart;
|
2016-09-09 18:40:09 +02:00
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
public TileEntityBase(TileEntityType<?> type) {
|
|
|
|
super(type);
|
2016-05-06 23:23:29 +02:00
|
|
|
}
|
|
|
|
|
2015-10-18 15:28:06 +02:00
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
public CompoundNBT save(CompoundNBT compound) {
|
2016-07-02 15:01:46 +02:00
|
|
|
this.writeSyncableNBT(compound, NBTType.SAVE_TILE);
|
2016-05-26 13:10:14 +02:00
|
|
|
return compound;
|
2015-10-18 15:28:06 +02:00
|
|
|
}
|
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
// TODO: [port] remove if the above is correct
|
|
|
|
// @Override
|
|
|
|
// public final CompoundNBT writeToNBT(CompoundNBT compound) {
|
|
|
|
// this.writeSyncableNBT(compound, NBTType.SAVE_TILE);
|
|
|
|
// return compound;
|
|
|
|
// }
|
|
|
|
|
2015-10-03 10:16:18 +02:00
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
public void load(BlockState state, CompoundNBT compound) {
|
2016-09-01 17:08:34 +02:00
|
|
|
this.readSyncableNBT(compound, NBTType.SAVE_TILE);
|
2015-10-03 10:16:18 +02:00
|
|
|
}
|
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
// TODO: [port] remove if the above is correct
|
|
|
|
// @Override
|
|
|
|
// public final void readFromNBT(CompoundNBT compound) {
|
|
|
|
// this.readSyncableNBT(compound, NBTType.SAVE_TILE);
|
|
|
|
// }
|
|
|
|
|
|
|
|
@Nullable
|
2015-10-03 10:16:18 +02:00
|
|
|
@Override
|
2021-02-27 13:24:45 +01:00
|
|
|
public SUpdateTileEntityPacket getUpdatePacket() {
|
2021-02-26 22:15:48 +01:00
|
|
|
CompoundNBT compound = new CompoundNBT();
|
2016-09-01 17:08:34 +02:00
|
|
|
this.writeSyncableNBT(compound, NBTType.SYNC);
|
2021-08-22 17:09:06 +02:00
|
|
|
return new SUpdateTileEntityPacket(this.worldPosition, -1, compound);
|
2015-10-03 10:16:18 +02:00
|
|
|
}
|
|
|
|
|
2016-09-01 17:08:34 +02:00
|
|
|
@Override
|
2021-02-27 13:24:45 +01:00
|
|
|
public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
|
2021-08-22 17:09:06 +02:00
|
|
|
this.readSyncableNBT(pkt.getTag(), NBTType.SYNC);
|
2016-02-01 17:49:55 +01:00
|
|
|
}
|
|
|
|
|
2016-05-26 13:10:14 +02:00
|
|
|
@Override
|
2021-02-26 22:15:48 +01:00
|
|
|
public final CompoundNBT getUpdateTag() {
|
|
|
|
CompoundNBT compound = new CompoundNBT();
|
2016-08-14 11:43:59 +02:00
|
|
|
this.writeSyncableNBT(compound, NBTType.SYNC);
|
|
|
|
return compound;
|
2016-02-01 17:49:55 +01:00
|
|
|
}
|
|
|
|
|
2016-06-04 00:26:33 +02:00
|
|
|
@Override
|
2021-02-27 13:24:45 +01:00
|
|
|
public void handleUpdateTag(BlockState state, CompoundNBT tag) {
|
|
|
|
this.readSyncableNBT(tag, NBTType.SYNC);
|
2016-06-04 00:26:33 +02:00
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public final void sendUpdate() {
|
2021-08-22 17:09:06 +02:00
|
|
|
if (this.level != null && !this.level.isClientSide) {
|
2021-02-26 22:15:48 +01:00
|
|
|
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
|
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
/*
|
2016-11-27 19:04:22 +01:00
|
|
|
if(this.world != null && !this.world.isRemote){
|
2021-02-26 22:15:48 +01:00
|
|
|
CompoundNBT compound = new CompoundNBT();
|
2016-09-01 17:08:34 +02:00
|
|
|
this.writeSyncableNBT(compound, NBTType.SYNC);
|
2019-05-02 10:43:27 +02:00
|
|
|
|
2021-02-26 22:15:48 +01:00
|
|
|
CompoundNBT data = new CompoundNBT();
|
2016-09-01 17:08:34 +02:00
|
|
|
data.setTag("Data", compound);
|
|
|
|
data.setInteger("X", this.pos.getX());
|
|
|
|
data.setInteger("Y", this.pos.getY());
|
|
|
|
data.setInteger("Z", this.pos.getZ());
|
2018-09-27 21:17:23 +02:00
|
|
|
PacketHandler.theNetwork.sendToAllTracking(new PacketServerToClient(data, PacketHandler.TILE_ENTITY_HANDLER), new TargetPoint(this.world.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 0));
|
|
|
|
}*/
|
2016-07-06 21:56:15 +02:00
|
|
|
}
|
|
|
|
|
2021-02-26 22:15:48 +01:00
|
|
|
public void writeSyncableNBT(CompoundNBT compound, NBTType type) {
|
|
|
|
if (type != NBTType.SAVE_BLOCK) {
|
2021-08-22 17:09:06 +02:00
|
|
|
super.save(compound);
|
2021-02-26 22:15:48 +01:00
|
|
|
}
|
2016-08-14 11:43:59 +02:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
if (type == NBTType.SAVE_TILE) {
|
2021-02-27 13:24:45 +01:00
|
|
|
compound.putBoolean("Redstone", this.isRedstonePowered);
|
|
|
|
compound.putInt("TicksElapsed", this.ticksElapsed);
|
|
|
|
compound.putBoolean("StopDrop", this.stopFromDropping);
|
2021-02-26 22:15:48 +01:00
|
|
|
} else if (type == NBTType.SYNC && this.stopFromDropping) {
|
2021-02-27 13:24:45 +01:00
|
|
|
compound.putBoolean("StopDrop", this.stopFromDropping);
|
2021-02-26 22:15:48 +01:00
|
|
|
}
|
2018-03-19 17:50:18 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
if (this.isRedstoneToggle() && (type != NBTType.SAVE_BLOCK || this.isPulseMode)) {
|
2021-02-27 13:24:45 +01:00
|
|
|
compound.putBoolean("IsPulseMode", this.isPulseMode);
|
2015-12-21 22:18:33 +01:00
|
|
|
}
|
2015-12-01 19:48:09 +01:00
|
|
|
}
|
|
|
|
|
2021-02-26 22:15:48 +01:00
|
|
|
public void readSyncableNBT(CompoundNBT compound, NBTType type) {
|
|
|
|
if (type != NBTType.SAVE_BLOCK) {
|
2021-08-22 17:09:06 +02:00
|
|
|
super.load(null, compound); // FIXME: [port] flag as possible crash source
|
2021-02-26 22:15:48 +01:00
|
|
|
}
|
2016-08-14 11:43:59 +02:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
if (type == NBTType.SAVE_TILE) {
|
2016-05-26 13:10:14 +02:00
|
|
|
this.isRedstonePowered = compound.getBoolean("Redstone");
|
2021-02-27 13:24:45 +01:00
|
|
|
this.ticksElapsed = compound.getInt("TicksElapsed");
|
2016-11-27 23:04:26 +01:00
|
|
|
this.stopFromDropping = compound.getBoolean("StopDrop");
|
2021-02-26 22:15:48 +01:00
|
|
|
} else if (type == NBTType.SYNC) {
|
|
|
|
this.stopFromDropping = compound.getBoolean("StopDrop");
|
|
|
|
}
|
2018-03-19 17:50:18 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
if (this.isRedstoneToggle()) {
|
2016-07-02 15:01:46 +02:00
|
|
|
this.isPulseMode = compound.getBoolean("IsPulseMode");
|
2015-12-21 22:18:33 +01:00
|
|
|
}
|
2015-10-21 00:22:50 +02:00
|
|
|
}
|
2015-10-18 15:31:01 +02:00
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
// TODO: [port] eval if still required in some way
|
|
|
|
// @Override
|
|
|
|
// public boolean shouldRefresh(World world, BlockPos pos, BlockState oldState, BlockState newState) {
|
|
|
|
// return !oldState.getBlock().isAssociatedBlock(newState.getBlock());
|
|
|
|
// }
|
2016-09-01 17:08:34 +02:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public String getNameForTranslation() {
|
2021-02-27 13:24:45 +01:00
|
|
|
return "removeme";// "container." + ActuallyAdditions.MODID + "." + this.name + ".name";
|
2016-11-20 13:46:35 +01:00
|
|
|
}
|
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
// @Override
|
|
|
|
// public ITextComponent getDisplayName() {
|
2021-05-04 18:47:45 +02:00
|
|
|
// return new TranslationTextComponent(this.getNameForTranslation());
|
2021-02-27 13:24:45 +01:00
|
|
|
// }
|
|
|
|
|
2016-09-01 17:08:34 +02:00
|
|
|
|
|
|
|
@Override
|
2021-02-27 13:24:45 +01:00
|
|
|
public void tick() {
|
2016-02-01 17:49:55 +01:00
|
|
|
this.updateEntity();
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public int getComparatorStrength() {
|
2016-11-28 12:51:45 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2018-09-27 21:17:23 +02:00
|
|
|
private boolean shareEnergy = this instanceof ISharingEnergyProvider;
|
|
|
|
private boolean shareFluid = this instanceof ISharingFluidHandler;
|
2016-11-28 12:51:45 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public void updateEntity() {
|
2016-02-01 17:49:55 +01:00
|
|
|
this.ticksElapsed++;
|
2016-06-17 13:25:15 +02:00
|
|
|
|
2021-08-22 17:09:06 +02:00
|
|
|
if (!this.level.isClientSide) {
|
2019-05-02 09:10:29 +02:00
|
|
|
if (this.shareEnergy) {
|
|
|
|
ISharingEnergyProvider provider = (ISharingEnergyProvider) this;
|
|
|
|
if (provider.doesShareEnergy()) {
|
2016-08-31 21:14:48 +02:00
|
|
|
int total = provider.getEnergyToSplitShare();
|
2019-05-02 09:10:29 +02:00
|
|
|
if (total > 0) {
|
2021-02-27 13:24:45 +01:00
|
|
|
Direction[] sides = provider.getEnergyShareSides();
|
2016-08-31 21:14:48 +02:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
int amount = total / sides.length;
|
|
|
|
if (amount <= 0) {
|
2016-08-31 21:14:48 +02:00
|
|
|
amount = total;
|
|
|
|
}
|
2016-09-09 18:40:09 +02:00
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
for (Direction side : sides) {
|
2016-09-09 18:40:09 +02:00
|
|
|
TileEntity tile = this.tilesAround[side.ordinal()];
|
2019-05-02 09:10:29 +02:00
|
|
|
if (tile != null && provider.canShareTo(tile)) {
|
2016-09-09 18:40:09 +02:00
|
|
|
WorldUtil.doEnergyInteraction(this, tile, side, amount);
|
|
|
|
}
|
2016-08-31 21:14:48 +02:00
|
|
|
}
|
2016-08-31 20:16:36 +02:00
|
|
|
}
|
|
|
|
}
|
2016-06-17 13:25:15 +02:00
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
if (this.shareFluid) {
|
|
|
|
ISharingFluidHandler handler = (ISharingFluidHandler) this;
|
|
|
|
if (handler.doesShareFluid()) {
|
2016-11-19 21:11:17 +01:00
|
|
|
int total = handler.getMaxFluidAmountToSplitShare();
|
2019-05-02 09:10:29 +02:00
|
|
|
if (total > 0) {
|
2021-02-27 13:24:45 +01:00
|
|
|
Direction[] sides = handler.getFluidShareSides();
|
2016-08-31 21:14:48 +02:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
int amount = total / sides.length;
|
|
|
|
if (amount <= 0) {
|
2016-08-31 21:14:48 +02:00
|
|
|
amount = total;
|
|
|
|
}
|
2016-09-09 18:40:09 +02:00
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
for (Direction side : sides) {
|
2016-09-09 18:40:09 +02:00
|
|
|
TileEntity tile = this.tilesAround[side.ordinal()];
|
2019-05-02 09:10:29 +02:00
|
|
|
if (tile != null) {
|
2016-09-09 18:40:09 +02:00
|
|
|
WorldUtil.doFluidInteraction(this, tile, side, amount);
|
|
|
|
}
|
2016-08-31 21:14:48 +02:00
|
|
|
}
|
2016-08-31 20:16:36 +02:00
|
|
|
}
|
|
|
|
}
|
2016-06-17 13:25:15 +02:00
|
|
|
}
|
2016-09-09 18:40:09 +02:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
if (!this.hasSavedDataOnChangeOrWorldStart) {
|
|
|
|
if (this.shouldSaveDataOnChangeOrWorldStart()) {
|
2016-10-29 12:00:00 +02:00
|
|
|
this.saveDataOnChangeOrWorldStart();
|
2016-09-09 18:40:09 +02:00
|
|
|
}
|
|
|
|
|
2016-10-29 12:00:00 +02:00
|
|
|
this.hasSavedDataOnChangeOrWorldStart = true;
|
2016-09-09 18:40:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public void saveDataOnChangeOrWorldStart() {
|
2021-02-27 13:24:45 +01:00
|
|
|
for (Direction side : Direction.values()) {
|
2021-08-22 17:09:06 +02:00
|
|
|
BlockPos pos = this.worldPosition.relative(side);
|
|
|
|
if (this.level.hasChunkAt(pos)) {
|
|
|
|
this.tilesAround[side.ordinal()] = this.level.getBlockEntity(pos);
|
2017-01-18 14:26:56 +01:00
|
|
|
}
|
2016-06-17 13:25:15 +02:00
|
|
|
}
|
2016-02-01 17:49:55 +01:00
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public boolean shouldSaveDataOnChangeOrWorldStart() {
|
2016-09-09 18:40:09 +02:00
|
|
|
return this instanceof ISharingEnergyProvider || this instanceof ISharingFluidHandler;
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public void setRedstonePowered(boolean powered) {
|
2015-12-19 10:30:39 +01:00
|
|
|
this.isRedstonePowered = powered;
|
2021-08-22 17:09:06 +02:00
|
|
|
this.setChanged();
|
2015-12-19 10:30:39 +01:00
|
|
|
}
|
|
|
|
|
2021-02-26 22:15:48 +01:00
|
|
|
public boolean canPlayerUse(PlayerEntity player) {
|
2021-08-22 17:09:06 +02:00
|
|
|
return player.distanceToSqr(this.getBlockPos().getX() + 0.5D, this.worldPosition.getY() + 0.5D, this.worldPosition.getZ() + 0.5D) <= 64 && !this.isRemoved() && this.level.getBlockEntity(this.worldPosition) == this;
|
2016-05-06 23:23:29 +02:00
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
protected boolean sendUpdateWithInterval() {
|
2021-12-29 03:36:23 +01:00
|
|
|
if (this.ticksElapsed % 5 == 0) { //TODO was a config TILE_ENTITY_UPDATE_INTERVAL
|
2015-12-01 17:28:50 +01:00
|
|
|
this.sendUpdate();
|
2015-11-19 22:13:52 +01:00
|
|
|
return true;
|
2019-05-02 09:10:29 +02:00
|
|
|
} else {
|
2015-11-19 22:13:52 +01:00
|
|
|
return false;
|
2015-11-18 23:11:24 +01:00
|
|
|
}
|
2015-10-18 15:28:06 +02:00
|
|
|
}
|
2015-12-01 17:28:50 +01:00
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
@Nonnull
|
2016-06-05 02:16:52 +02:00
|
|
|
@Override
|
2021-02-27 13:24:45 +01:00
|
|
|
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> capability, @Nullable Direction side) {
|
2019-05-02 09:10:29 +02:00
|
|
|
if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
|
2021-02-27 13:24:45 +01:00
|
|
|
return this.getItemHandler(side).cast();
|
2019-05-02 09:10:29 +02:00
|
|
|
} else if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
|
2021-02-27 13:24:45 +01:00
|
|
|
return this.getFluidHandler(side).cast();
|
2019-05-02 09:10:29 +02:00
|
|
|
} else if (capability == CapabilityEnergy.ENERGY) {
|
2021-02-27 13:24:45 +01:00
|
|
|
return this.getEnergyStorage(side).cast();
|
2016-11-26 08:58:42 +01:00
|
|
|
}
|
2021-02-27 13:24:45 +01:00
|
|
|
return LazyOptional.empty();
|
2016-06-05 02:16:52 +02:00
|
|
|
}
|
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
public LazyOptional<IFluidHandler> getFluidHandler(Direction facing) {
|
|
|
|
return LazyOptional.empty();
|
2016-06-05 02:16:52 +02:00
|
|
|
}
|
2016-07-02 15:01:46 +02:00
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
public LazyOptional<IEnergyStorage> getEnergyStorage(Direction facing) {
|
|
|
|
return LazyOptional.empty();
|
2016-11-26 08:58:42 +01:00
|
|
|
}
|
|
|
|
|
2021-02-27 13:24:45 +01:00
|
|
|
public LazyOptional<IItemHandler> getItemHandler(Direction facing) {
|
|
|
|
return LazyOptional.empty();
|
2016-12-04 00:10:52 +01:00
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public boolean isRedstoneToggle() {
|
2016-07-02 15:01:46 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public void activateOnPulse() {
|
2016-07-02 15:01:46 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public boolean respondsToPulses() {
|
2016-12-18 17:28:29 +01:00
|
|
|
return this.isRedstoneToggle() && this.isPulseMode;
|
|
|
|
}
|
|
|
|
|
2018-07-07 12:07:22 +02:00
|
|
|
public enum NBTType {
|
|
|
|
/**
|
|
|
|
* Use when normal writeToNBT/readToNBT is expected.
|
|
|
|
*/
|
2016-07-02 15:01:46 +02:00
|
|
|
SAVE_TILE,
|
2018-07-07 12:07:22 +02:00
|
|
|
/**
|
|
|
|
* Use when data needs to be sent to the client.
|
|
|
|
*/
|
2016-07-02 15:01:46 +02:00
|
|
|
SYNC,
|
2018-07-07 12:07:22 +02:00
|
|
|
/**
|
|
|
|
* Wat
|
|
|
|
*/
|
2016-07-02 15:01:46 +02:00
|
|
|
SAVE_BLOCK
|
|
|
|
}
|
2021-02-26 22:15:48 +01:00
|
|
|
}
|