Search in sources :

Example 91 with SubscribeEvent

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();
        }
    }
}
Also used : MutableBlockPos(net.minecraft.util.math.BlockPos.MutableBlockPos) BlockPos(net.minecraft.util.math.BlockPos) RenderManager(net.minecraft.client.renderer.entity.RenderManager) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 92 with SubscribeEvent

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);
        }
    }
}
Also used : GuiCelestialSelection(micdoodle8.mods.galacticraft.core.client.gui.screen.GuiCelestialSelection) ResourceLocation(net.minecraft.util.ResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 93 with SubscribeEvent

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());
    }
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 94 with SubscribeEvent

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"));
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 95 with SubscribeEvent

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);
    }
}
Also used : ToolSkill(net.silentchaos512.gems.skills.ToolSkill) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) ToolSkillDigger(net.silentchaos512.gems.skills.ToolSkillDigger) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1135 ItemStack (net.minecraft.item.ItemStack)316 EntityPlayer (net.minecraft.entity.player.EntityPlayer)314 World (net.minecraft.world.World)196 BlockPos (net.minecraft.util.math.BlockPos)179 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)136 IBlockState (net.minecraft.block.state.IBlockState)120 ResourceLocation (net.minecraft.util.ResourceLocation)102 Entity (net.minecraft.entity.Entity)93 Block (net.minecraft.block.Block)86 EntityLivingBase (net.minecraft.entity.EntityLivingBase)84 Minecraft (net.minecraft.client.Minecraft)72 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)66 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)64 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)55 Item (net.minecraft.item.Item)53 EntityItem (net.minecraft.entity.item.EntityItem)48 TileEntity (net.minecraft.tileentity.TileEntity)46 TextComponentString (net.minecraft.util.text.TextComponentString)42 Random (java.util.Random)37