use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.
the class BlockInfectedSponge method randomDisplayTick.
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
if (state.getValue(WET).booleanValue()) {
EnumFacing enumfacing = EnumFacing.random(rand);
if (enumfacing != EnumFacing.UP && !world.getBlockState(pos.offset(enumfacing)).isSideSolid(world, pos.offset(enumfacing), EnumFacing.UP)) {
double d0 = pos.getX();
double d1 = pos.getY();
double d2 = pos.getZ();
if (enumfacing == EnumFacing.DOWN) {
d1 -= 0.05D;
d0 += rand.nextDouble();
d2 += rand.nextDouble();
} else {
d1 += rand.nextDouble() * 0.8D;
if (enumfacing.getAxis() == EnumFacing.Axis.X) {
d2 += rand.nextDouble();
if (enumfacing == EnumFacing.EAST) {
++d0;
} else {
d0 += 0.05D;
}
} else {
d0 += rand.nextDouble();
if (enumfacing == EnumFacing.SOUTH) {
++d2;
} else {
d2 += 0.05D;
}
}
}
MorePlanetsCore.PROXY.spawnParticle(EnumParticleTypesMP.INFECTED_WATER_DRIP, d0, d1, d2);
}
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.
the class ItemElectricSwordMP method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, @Nullable World world, List<String> list, ITooltipFlag flag) {
TextFormatting color = null;
float joules = this.getElectricityStored(itemStack);
if (joules <= this.getMaxElectricityStored(itemStack) / 3) {
color = TextFormatting.DARK_RED;
} else if (joules > this.getMaxElectricityStored(itemStack) * 2 / 3) {
color = TextFormatting.DARK_GREEN;
} else {
color = TextFormatting.GOLD;
}
list.add(color + EnergyDisplayHelper.getEnergyDisplayS(joules) + "/" + EnergyDisplayHelper.getEnergyDisplayS(this.getMaxElectricityStored(itemStack)));
}
use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.
the class ItemBlockDarkEnergyGenerator method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, @Nullable World world, List<String> list, ITooltipFlag flag) {
if (this.getBlock() instanceof IBlockDescription) {
if (CommonRegisterHelper.isShiftKeyDown()) {
((IBlockDescription) this.block).getDescription().addDescription(itemStack, list);
} else {
if (this.getBlock() instanceof BlockTileGC) {
TileEntity te = ((BlockTileGC) this.getBlock()).createTileEntity(null, this.getBlock().getStateFromMeta(itemStack.getItemDamage() & 12));
if (te instanceof TileBaseElectricBlock) {
float powerDrawn = ((TileBaseElectricBlock) te).storage.getMaxExtract();
if (powerDrawn > 0) {
list.add(TextFormatting.GREEN + GCCoreUtil.translateWithFormat("item_desc.powerdraw.name", EnergyDisplayHelper.getEnergyDisplayS(powerDrawn * 20)));
}
}
if (te instanceof TileBaseUniversalElectrical) {
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("EnergyStored")) {
int power = (int) itemStack.getTagCompound().getFloat("EnergyStored");
list.add(TextFormatting.GREEN + GCCoreUtil.translateWithFormat("desc.energy_stored.name", EnergyDisplayHelper.getEnergyDisplayS(power)));
}
}
if (te instanceof TileEntityDarkEnergyGenerator) {
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("DarkEnergyFuel")) {
int power = itemStack.getTagCompound().getInteger("DarkEnergyFuel");
power = power * 100 / 1000;
list.add(TextFormatting.GREEN + GCCoreUtil.translateWithFormat("desc.dark_energy_fuel.name", power) + "%");
}
}
} else if (this.getBlock() instanceof BlockAdvancedTile) {
TileEntity te = ((BlockAdvancedTile) this.getBlock()).createTileEntity(world, this.getBlock().getStateFromMeta(itemStack.getItemDamage() & 12));
if (te instanceof TileBaseElectricBlock) {
float powerDrawn = ((TileBaseElectricBlock) te).storage.getMaxExtract();
if (powerDrawn > 0) {
list.add(TextFormatting.GREEN + GCCoreUtil.translateWithFormat("item_desc.powerdraw.name", EnergyDisplayHelper.getEnergyDisplayS(powerDrawn * 20)));
}
}
}
list.add(GCCoreUtil.translate("desc.shift_info.name"));
}
}
}
use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.
the class ItemTier4Rocket method addDescription.
@Override
@SideOnly(Side.CLIENT)
protected void addDescription(ItemStack itemStack, List<String> list) {
EntityTier4Rocket rocket = new EntityTier4Rocket(Minecraft.getMinecraft().world, 0, 0, 0, CachedEnumUtil.valuesRocketCached()[itemStack.getItemDamage()]);
list.add(GCCoreUtil.translate("gui.message.fuel.name") + ": " + itemStack.getTagCompound().getInteger("RocketFuel") + " / " + rocket.fuelTank.getCapacity());
}
use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.
the class ItemBlockSlabMP method canPlaceBlockOnSide.
@Override
@SideOnly(Side.CLIENT)
public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack itemStack) {
if (this.block instanceof ISlabBlock) {
ISlabBlock singleSlab = (ISlabBlock) this.block;
BlockPos blockpos1 = pos;
IProperty<?> iproperty = singleSlab.getHalf().getVariantProperty();
Comparable object = singleSlab.getHalf().getTypeForItem(itemStack);
IBlockState state = world.getBlockState(pos);
if (state.getBlock() == singleSlab.getHalf()) {
boolean flag = state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP;
if ((side == EnumFacing.UP && !flag || side == EnumFacing.DOWN && flag) && object == state.getValue(iproperty)) {
return true;
}
}
pos = pos.offset(side);
IBlockState state1 = world.getBlockState(pos);
return state1.getBlock() == singleSlab.getHalf() && object == state1.getValue(iproperty) ? true : super.canPlaceBlockOnSide(world, blockpos1, side, player, itemStack);
}
return super.canPlaceBlockOnSide(world, pos, side, player, itemStack);
}
Aggregations