use of stevekung.mods.moreplanets.tileentity.TileEntityAlienDefenderBeacon in project MorePlanets by SteveKunG.
the class BlockAlienDefenderBeacon method onBlockPlacedBy.
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack itemStack) {
TileEntity tile = world.getTileEntity(pos);
world.setBlockState(pos, this.getDefaultState());
if (!world.isRemote) {
if (placer instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) placer;
if (tile instanceof TileEntityAlienDefenderBeacon) {
TileEntityAlienDefenderBeacon beacon = (TileEntityAlienDefenderBeacon) tile;
beacon.creativeSpawn = player.capabilities.isCreativeMode;
}
}
}
}
use of stevekung.mods.moreplanets.tileentity.TileEntityAlienDefenderBeacon in project MorePlanets by SteveKunG.
the class TileEntityItemStackRendererMP method renderByItem.
@Override
public void renderByItem(ItemStack itemStack) {
Block block = Block.getBlockFromItem(itemStack.getItem());
if (block == DionaBlocks.DIONA_ANCIENT_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityDionaAncientChest());
} else if (block == DionaBlocks.DIONA_TREASURE_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityDionaTreasureChest());
} else if (block == ChalosBlocks.CHALOS_ANCIENT_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityChalosAncientChest());
} else if (block == ChalosBlocks.CHALOS_TREASURE_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityChalosTreasureChest());
} else if (block == DionaBlocks.ZELIUS_EGG) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityZeliusEgg());
GlStateManager.enableBlend();
} else if (block == DionaBlocks.LARGE_INFECTED_CRYSTALLIZE) {
TileEntityLargeInfectedCrystallizeRenderer.INSTANCE.render();
} else if (block == MPBlocks.DARK_ENERGY_RECEIVER) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityDarkEnergyReceiver());
} else if (itemStack.getItem() == DionaItems.INFECTED_CRYSTALLIZE_BOMB) {
RenderInfectedCrystallizeBomb.INSTANCE.render();
} else if (block == NibiruBlocks.NIBIRU_ANCIENT_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityNibiruAncientChest());
} else if (block == NibiruBlocks.NIBIRU_TREASURE_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityNibiruTreasureChest());
} else if (block == ChalosBlocks.CHEESE_SPORE_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityCheeseSporeChest());
} else if (block == NibiruBlocks.INFECTED_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityInfectedChest());
} else if (block == NibiruBlocks.MULTALIC_CRYSTAL) {
TileEntityMultalicCrystalRenderer.INSTANCE.render();
} else if (block == DionaBlocks.DARK_ENERGY_CORE) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityDarkEnergyCore());
GlStateManager.enableBlend();
} else if (block == NibiruBlocks.ALIEN_BERRY_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityAlienBerryChest());
} else if (block == NibiruBlocks.JUICER_EGG) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityJuicerEgg());
TileEntityJuicerEggRenderer.renderItem(null, true);
} else if (block == NibiruBlocks.NUCLEAR_WASTE_TANK) {
TileEntityNuclearWasteTankRenderer.INSTANCE.render();
} else if (block == NibiruBlocks.VEIN_FRAME) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityVeinFrame());
GlStateManager.enableBlend();
} else if (block == DionaBlocks.DARK_ENERGY_GENERATOR) {
TileEntityDarkEnergyGeneratorRenderer.INSTANCE.render();
} else if (block == MPBlocks.BLACK_HOLE_STORAGE) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityBlackHoleStorage());
GlStateManager.enableBlend();
} else if (block == MPBlocks.ALIEN_DEFENDER_BEACON) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityAlienDefenderBeacon());
GlStateManager.enableBlend();
GlStateManager.enableCull();
} else if (block == MPBlocks.SHIELD_GENERATOR) {
TileEntityShieldGeneratorRenderer.INSTANCE.render();
} else {
this.old.renderByItem(itemStack);
}
}
use of stevekung.mods.moreplanets.tileentity.TileEntityAlienDefenderBeacon in project MorePlanets by SteveKunG.
the class RenderAlienDefenderBeacon method renderItem.
@Override
public void renderItem(ItemStack itemStack, ItemCameraTransforms.TransformType type) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityAlienDefenderBeacon());
GlStateManager.enableBlend();
GlStateManager.enableCull();
}
use of stevekung.mods.moreplanets.tileentity.TileEntityAlienDefenderBeacon in project MorePlanets by SteveKunG.
the class ItemAlienDefenderReinforcement method onItemRightClick.
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
ItemStack itemStack = player.getHeldItem(hand);
int range = 16;
Vec3d playerEye = player.getPositionEyes(1.0F);
Vec3d playerLook = player.getLook(1.0F);
Vec3d lookRange = playerEye.addVector(playerLook.x * range, playerLook.y * range, playerLook.z * range);
RayTraceResult moving = world.rayTraceBlocks(playerEye, lookRange);
boolean disable = false;
if (moving != null && disable) {
BlockPos pos = moving.getBlockPos();
if (world.isAirBlock(pos.up())) {
if (world.isRemote) {
FMLClientHandler.instance().getClient().ingameGUI.setOverlayMessage(new JsonUtil().text(I18n.format("gui.alien_defender_beacon.message")).setStyle(new JsonUtil().colorFromConfig("yellow")).getFormattedText(), false);
player.swingArm(hand);
} else {
world.setBlockState(pos.up(), MPBlocks.ALIEN_DEFENDER_BEACON.getDefaultState());
TileEntityAlienDefenderBeacon beacon = (TileEntityAlienDefenderBeacon) world.getTileEntity(pos.up());
beacon.bossCountdown = 200 + world.rand.nextInt(400);
if (!player.capabilities.isCreativeMode) {
itemStack.shrink(1);
}
}
} else {
if (world.isRemote) {
FMLClientHandler.instance().getClient().ingameGUI.setOverlayMessage(new JsonUtil().text(I18n.format("gui.not_air_block.message")).setStyle(new JsonUtil().red()).getFormattedText(), false);
player.swingArm(hand);
}
}
} else {
if (world.isRemote && disable) {
FMLClientHandler.instance().getClient().ingameGUI.setOverlayMessage(new JsonUtil().text(I18n.format("gui.target_too_far.message", range)).setStyle(new JsonUtil().red()).getFormattedText(), false);
player.swingArm(hand);
}
}
return new ActionResult<>(EnumActionResult.PASS, itemStack);
}
Aggregations