use of se.gory_moon.horsepower.tileentity.TileEntityChopper in project HorsePower by GoryMoon.
the class BlockHPChoppingBase method writeDataOntoItemstack.
private void writeDataOntoItemstack(@Nonnull ItemStack item, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull IBlockState state, boolean inventorySave) {
// get block data from the block
TileEntity te = world.getTileEntity(pos);
if (te != null && (te instanceof TileEntityChopper || te instanceof TileEntityManualChopper)) {
NBTTagCompound tag = item.hasTagCompound() ? item.getTagCompound() : new NBTTagCompound();
// texture
NBTTagCompound data = te.getTileData().getCompoundTag("textureBlock");
if (!data.hasNoTags()) {
tag.setTag("textureBlock", data);
}
if (!tag.hasNoTags()) {
item.setTagCompound(tag);
}
}
}
use of se.gory_moon.horsepower.tileentity.TileEntityChopper in project HorsePower by GoryMoon.
the class BlockChopper method addProbeInfo.
// The One Probe Integration
@Optional.Method(modid = "theoneprobe")
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
TileEntityChopper tileEntity = getTileEntity(world, data.getPos());
if (tileEntity != null) {
double totalWindup = Configs.general.pointsForWindup > 0 ? Configs.general.pointsForWindup : 1;
probeInfo.progress((long) ((((double) tileEntity.getField(2)) / totalWindup) * 100L), 100L, new ProgressStyle().prefix(Localization.TOP.WINDUP_PROGRESS.translate() + " ").suffix("%"));
if (tileEntity.getField(0) > 1)
probeInfo.progress((long) ((((double) tileEntity.getField(1)) / ((double) tileEntity.getField(0))) * 100L), 100L, new ProgressStyle().prefix(Localization.TOP.CHOPPING_PROGRESS.translate() + " ").suffix("%"));
}
}
Aggregations