use of micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer in project MorePlanets by SteveKunG.
the class TileEntityJuicerEggRenderer method renderJuicer.
private void renderJuicer(float partialTicks) {
EntityJuicer juicer = new EntityJuicer(Minecraft.getMinecraft().world);
Minecraft.getMinecraft().getRenderManager().renderEntity(juicer, 0.0F, 0.1F, 0.0F, 0.0F, partialTicks, false);
}
use of micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer in project MorePlanets by SteveKunG.
the class EntityEventHandler method onLivingUpdate.
@SubscribeEvent
public void onLivingUpdate(LivingUpdateEvent event) {
EntityLivingBase living = event.getEntityLiving();
World world = living.world;
if (living.isDead) {
int id = GCCoreUtil.getDimensionID(living.world);
PacketSimpleMP.sendToAllAround(new PacketSimpleMP(EnumSimplePacketMP.C_REMOVE_ENTITY_ID, id, String.valueOf(living.getEntityId())), living.world, id, living.getPosition(), 64);
}
if (living instanceof EntityPlayerMP) {
EntityPlayerMP player = (EntityPlayerMP) living;
if (ConfigManagerMP.enableStartedPlanet && !WorldTickEventHandler.startedDimensionData.startedDimension && !(ConfigManagerMP.startedPlanet.equals("planet.") || ConfigManagerMP.startedPlanet.equals("moon.") || ConfigManagerMP.startedPlanet.equals("satellite."))) {
MPLog.debug("Start teleporting player to dimension {}", ConfigManagerMP.startedPlanet);
TeleportUtil.startNewDimension(player);
WorldTickEventHandler.startedDimensionData.startedDimension = true;
WorldTickEventHandler.startedDimensionData.planetToBack = ConfigManagerMP.startedPlanet;
WorldTickEventHandler.startedDimensionData.setDirty(true);
}
if (player.isPotionActive(MPPotions.INFECTED_SPORE_PROTECTION) || this.isInOxygen(world, player)) {
player.removePotionEffect(MPPotions.INFECTED_SPORE);
}
if (player.isPotionActive(MPPotions.DARK_ENERGY_PROTECTION)) {
player.removePotionEffect(MPPotions.DARK_ENERGY);
}
if (world.provider instanceof WorldProviderNibiru) {
if (world.isRainingAt(player.getPosition()) && !this.isGodPlayer(player) && !player.isPotionActive(MPPotions.INFECTED_SPORE_PROTECTION) && world.getBiome(player.getPosition()) != MPBiomes.GREEN_VEIN) {
player.addPotionEffect(new PotionEffect(MPPotions.INFECTED_SPORE, 40));
}
if (player.ticksExisted % 128 == 0 && !this.isGodPlayer(player) && !this.isInOxygen(world, player) && !player.isPotionActive(MPPotions.INFECTED_SPORE_PROTECTION) && world.getBiome(player.getPosition()) != MPBiomes.GREEN_VEIN) {
player.addPotionEffect(new PotionEffect(MPPotions.INFECTED_SPORE, 80));
}
}
if (world.provider instanceof IMeteorType) {
// this.spawnMeteor(world, player, (IMeteorType)world.provider);
}
}
if (world.provider instanceof WorldProviderNibiru) {
if (!(living instanceof EntityPlayer) && !EntityEffectHelper.isGalacticraftMob(living) && !(living instanceof EntityJuicer)) {
if (living.ticksExisted % 128 == 0 && world.getBiome(living.getPosition()) != MPBiomes.GREEN_VEIN) {
living.addPotionEffect(new PotionEffect(MPPotions.INFECTED_SPORE, 80));
}
if (world.isRainingAt(living.getPosition()) && world.getBiome(living.getPosition()) != MPBiomes.GREEN_VEIN) {
living.addPotionEffect(new PotionEffect(MPPotions.INFECTED_SPORE, 40));
}
}
}
}
use of micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer in project MorePlanets by SteveKunG.
the class TileEntityJuicerEgg method update.
@Override
public void update() {
super.update();
if (!this.world.isRemote) {
double radius = 1.05D;
double radiusPlayer = 5.0D;
List<Entity> list = this.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(this.pos.getX() - radius, this.pos.getY() - radius, this.pos.getZ() - radius, this.pos.getX() + radius, this.pos.getY() + radius, this.pos.getZ() + radius));
List<EntityPlayer> playerList = this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - radiusPlayer, this.pos.getY() - radiusPlayer, this.pos.getZ() - radiusPlayer, this.pos.getX() + radiusPlayer, this.pos.getY() + radiusPlayer, this.pos.getZ() + radiusPlayer));
if (!list.isEmpty()) {
for (Entity entity : list) {
if (entity instanceof EntityArrow) {
EntityArrow arrow = (EntityArrow) entity;
if (arrow.inTile == NibiruBlocks.JUICER_EGG) {
arrow.setDead();
this.world.destroyBlock(this.pos, false);
if (this.world.rand.nextInt(5) == 0) {
EntityJuicer juicer = new EntityJuicer(this.world);
juicer.setLocationAndAngles(this.pos.getX() + 0.5D, this.pos.getY() + 1.0D, this.pos.getZ() + 0.5D, 0.0F, 0.0F);
this.world.spawnEntity(juicer);
}
if (this.world.rand.nextInt(10) == 0) {
if (!playerList.isEmpty()) {
for (EntityPlayer player : playerList) {
EntityJuicer juicer = new EntityJuicer(this.world);
juicer.setLocationAndAngles(this.pos.getX() + 0.5D, this.pos.getY() + 1.0D, this.pos.getZ() + 0.5D, 0.0F, 0.0F);
this.world.spawnEntity(juicer);
juicer.startRiding(player);
}
}
}
}
}
}
}
}
}
use of micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer in project MorePlanets by SteveKunG.
the class TileEntityJuicerEggRenderer method renderItem.
public static void renderItem(ItemCameraTransforms.TransformType type, boolean render) {
GlStateManager.pushMatrix();
GlStateManager.translate(0.5F, 1.35F, 0.5F);
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
RenderManager manager = Minecraft.getMinecraft().getRenderManager();
EntityJuicer juicer = new EntityJuicer(Minecraft.getMinecraft().world);
manager.renderEntity(juicer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
if (type != null && type == ItemCameraTransforms.TransformType.GUI || render) {
GlStateManager.enableRescaleNormal();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.disableLighting();
ClientRendererUtil.renderLightState(false);
}
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.popMatrix();
}
use of micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer in project MorePlanets by SteveKunG.
the class BlockJuicerEgg method onBlockDestroyedByPlayer.
@Override
public void onBlockDestroyedByPlayer(World world, BlockPos pos, IBlockState state) {
if (!world.isRemote) {
if (world.rand.nextInt(5) == 0) {
EntityJuicer juicer = new EntityJuicer(world);
juicer.setLocationAndAngles(pos.getX() + 0.5D, pos.getY() + 1.0D, pos.getZ() + 0.5D, 0.0F, 0.0F);
world.spawnEntity(juicer);
}
if (world.rand.nextInt(10) == 0) {
double radiusPlayer = 5.0D;
List<EntityPlayer> playerList = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() - radiusPlayer, pos.getY() - radiusPlayer, pos.getZ() - radiusPlayer, pos.getX() + radiusPlayer, pos.getY() + radiusPlayer, pos.getZ() + radiusPlayer));
if (!playerList.isEmpty()) {
for (EntityPlayer player : playerList) {
EntityJuicer juicer = new EntityJuicer(world);
juicer.setLocationAndAngles(pos.getX() + 0.5D, pos.getY() + 1.0D, pos.getZ() + 0.5D, 0.0F, 0.0F);
world.spawnEntity(juicer);
juicer.startRiding(player);
}
}
}
}
}
Aggregations