use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project MorePlanets by SteveKunG.
the class ClientEventHandler method onRenderWorldLast.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onRenderWorldLast(RenderWorldLastEvent event) {
RenderManager manager = this.mc.getRenderManager();
if (!ClientEventHandler.receiverRenderPos.isEmpty()) {
for (BlockPos renderPos : ClientEventHandler.receiverRenderPos) {
GlStateManager.pushMatrix();
GlStateManager.blendFunc(770, 771);
DarkEnergyReceiverMultiblockRenderer.render(renderPos.getX() - manager.renderPosX, renderPos.getY() - manager.renderPosY, renderPos.getZ() - manager.renderPosZ);
GlStateManager.popMatrix();
}
}
if (!ClientEventHandler.wasteRenderPos.isEmpty()) {
for (BlockPos renderPos : ClientEventHandler.wasteRenderPos) {
GlStateManager.pushMatrix();
GlStateManager.blendFunc(770, 771);
NuclearWasteGeneratorMultiblockRenderer.render(renderPos.getX() - manager.renderPosX, renderPos.getY() - manager.renderPosY, renderPos.getZ() - manager.renderPosZ);
GlStateManager.popMatrix();
}
}
}
use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project MorePlanets by SteveKunG.
the class ClientEventHandler method onRenderCelestialPost.
@SubscribeEvent
public void onRenderCelestialPost(CelestialBodyRenderEvent.Post event) {
if (this.mc.currentScreen instanceof GuiCelestialSelection) {
GuiCelestialSelection gui = (GuiCelestialSelection) this.mc.currentScreen;
boolean enable = false;
if (event.celestialBody == GalacticraftCore.planetOverworld && enable) {
float size = GuiCelestialSelection.getWidthForCelestialBodyStatic(event.celestialBody) / 16.0F;
float orbitTick = MathHelper.sin(this.partialTicks * 0.2F) / 10.0F + 0.5F;
GlStateManager.rotate(this.partialTicks, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(orbitTick + 5.0F, 5.0F, 0.0F);
this.mc.renderEngine.bindTexture(new ResourceLocation("moreplanets:textures/gui/celestialbodies/ion_cannon.png"));
gui.drawTexturedModalRect(-7.5F * size, -1.75F * size, 2.0F, 2.0F, 0, 0, 32, 32, false, false, 32, 32);
}
}
}
use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project MorePlanets by SteveKunG.
the class CapabilityHandlerMP method onPlayerClone.
@SubscribeEvent
public void onPlayerClone(PlayerEvent.Clone event) {
if (event.isWasDeath()) {
EntityPlayer player = event.getEntityPlayer();
MorePlanetsCapabilityData currentData = player.getCapability(CapabilityProviderMP.MORE_PLANETS_CAP, null);
MorePlanetsCapabilityData oldData = event.getOriginal().getCapability(CapabilityProviderMP.MORE_PLANETS_CAP, null);
currentData.setStartCelestial(oldData.getStartCelestial());
}
}
use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project SilentGems by SilentChaos512.
the class GemsClientEvents method stitchTexture.
@SubscribeEvent
public void stitchTexture(TextureStitchEvent.Pre pre) {
SilentGems.instance.logHelper.info("Stitching misc textures into the map - M4thG33k");
pre.getMap().registerSprite(new ResourceLocation("silentgems", "blocks/ChaosPylonPassive"));
pre.getMap().registerSprite(new ResourceLocation("silentgems", "blocks/ChaosPylonBurner"));
pre.getMap().registerSprite(new ResourceLocation("silentgems", "blocks/ChaosAltar"));
}
use of net.minecraftforge.fml.common.eventhandler.SubscribeEvent in project SilentGems by SilentChaos512.
the class GemsCommonEvents method onGetBreakSpeed.
@SubscribeEvent
public void onGetBreakSpeed(PlayerEvent.BreakSpeed event) {
EntityPlayer player = event.getEntityPlayer();
ItemStack mainHand = player.getHeldItem(EnumHand.MAIN_HAND);
if (StackHelper.isValid(mainHand)) {
// Shears on Fluffy Blocks
if (event.getState() == ModBlocks.fluffyBlock) {
ModBlocks.fluffyBlock.onGetBreakSpeed(event);
}
// Gravity enchantment.
int gravityLevel = EnchantmentHelper.getEnchantmentLevel(ModEnchantments.gravity, mainHand);
if (gravityLevel > 0)
ModEnchantments.gravity.onGetBreakSpeed(event, mainHand, gravityLevel);
// Reduce speed for Area Miner and Lumberjack.
ToolSkill skill = ToolHelper.getSuperSkill(mainHand);
if (skill instanceof ToolSkillDigger && ToolHelper.isSpecialAbilityEnabled(mainHand))
((ToolSkillDigger) skill).onGetBreakSpeed(event);
}
}
Aggregations