Another pass at the 1.7 update - more to come tomorrow

This commit is contained in:
pahimar 2014-03-27 22:21:21 -04:00
parent 9070ad038b
commit 059d9614c1
34 changed files with 59 additions and 29 deletions

View file

@ -14,6 +14,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.Random;

View file

@ -2,6 +2,7 @@ package com.pahimar.ee3.client.audio;
import com.pahimar.ee3.helper.LogHelper;
import com.pahimar.ee3.lib.Sounds;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
/**
@ -13,24 +14,23 @@ import net.minecraftforge.client.event.sound.SoundLoadEvent;
*/
public class SoundHandler
{
@ForgeSubscribe
@SubscribeEvent
public void onSoundLoad(SoundLoadEvent event)
{
// FIXME Load custom sounds into Minecraft
// For each custom sound file we have defined in Sounds
for (String soundFile : Sounds.soundFiles)
{
// Try to add the custom sound file to the pool of sounds
try
{
event.manager.addSound(soundFile);
}
// If we cannot add the custom sound file to the pool, log the exception
catch (Exception e)
{
LogHelper.warn("Failed loading sound file: " + soundFile);
}
}
// for (String soundFile : Sounds.soundFiles)
// {
// // Try to add the custom sound file to the pool of sounds
// try
// {
// event.manager.addSound(soundFile);
// }
// // If we cannot add the custom sound file to the pool, log the exception
// catch (Exception e)
// {
// LogHelper.warn("Failed loading sound file: " + soundFile);
// }
// }
}
}

View file

@ -3,11 +3,13 @@ package com.pahimar.ee3.client.handler;
import com.pahimar.ee3.item.IChargeable;
import com.pahimar.ee3.lib.Textures;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@ -75,7 +77,7 @@ public class DrawBlockHighlightHandler
return pulse;
}
@ForgeSubscribe
@SubscribeEvent
public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event)
{
/**

View file

@ -3,6 +3,8 @@ package com.pahimar.ee3.client.handler;
import com.pahimar.ee3.api.WrappedStack;
import com.pahimar.ee3.emc.EmcRegistry;
import com.pahimar.ee3.emc.EmcValue;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
@ -23,7 +25,7 @@ public class ItemTooltipEventHandler
private static DecimalFormat emcDecimalFormat = new DecimalFormat("###,###,###,###,###.###");
@SuppressWarnings("unused")
@ForgeSubscribe(priority = EventPriority.LOWEST)
@SubscribeEvent(priority = EventPriority.LOWEST)
public void handleItemTooltipEvent(ItemTooltipEvent event)
{
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT))

View file

@ -14,6 +14,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
/**
@ -69,7 +70,7 @@ public class TileEntityAludelRenderer extends TileEntitySpecialRenderer
*/
GL11.glPushMatrix();
TileEntity tileGlassBell = tileAludel.worldObj.getBlockTileEntity(tileAludel.xCoord, tileAludel.yCoord + 1, tileAludel.zCoord);
TileEntity tileGlassBell = tileAludel.getWorldObj().getTileEntity(tileAludel.xCoord, tileAludel.yCoord + 1, tileAludel.zCoord);
if (tileGlassBell instanceof TileGlassBell)
{
@ -78,7 +79,7 @@ public class TileEntityAludelRenderer extends TileEntitySpecialRenderer
float scaleFactor = getGhostItemScaleFactor(tileAludel.outputItemStack);
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
EntityItem ghostEntityItem = new EntityItem(tileAludel.worldObj);
EntityItem ghostEntityItem = new EntityItem(tileAludel.getWorldObj());
ghostEntityItem.hoverStart = 0.0F;
ghostEntityItem.setEntityItemStack(tileAludel.outputItemStack);

View file

@ -13,6 +13,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
/**
@ -78,7 +79,7 @@ public class TileEntityGlassBellRenderer extends TileEntitySpecialRenderer
float scaleFactor = getGhostItemScaleFactor(tileGlassBell.outputItemStack);
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
EntityItem ghostEntityItem = new EntityItem(tileGlassBell.worldObj);
EntityItem ghostEntityItem = new EntityItem(tileGlassBell.getWorldObj());
ghostEntityItem.hoverStart = 0.0F;
ghostEntityItem.setEntityItemStack(tileGlassBell.outputItemStack);

View file

@ -1,6 +1,7 @@
package com.pahimar.ee3.handler;
import com.pahimar.ee3.event.ActionRequestEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
/**
* Equivalent-Exchange-3
@ -11,8 +12,7 @@ import com.pahimar.ee3.event.ActionRequestEvent;
*/
public class ActionRequestHandler
{
@ForgeSubscribe
@SubscribeEvent
public void onModActionEvent(ActionRequestEvent event)
{

View file

@ -2,6 +2,7 @@ package com.pahimar.ee3.handler;
import com.pahimar.ee3.helper.ItemStackNBTHelper;
import com.pahimar.ee3.lib.Strings;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.item.EntityItem;
import net.minecraftforge.event.entity.item.ItemTossEvent;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
@ -16,7 +17,7 @@ import net.minecraftforge.event.entity.player.PlayerDropsEvent;
*/
public class ItemEventHandler
{
@ForgeSubscribe
@SubscribeEvent
@SuppressWarnings("unused")
public void onItemPickup(EntityItemPickupEvent event)
{
@ -34,7 +35,7 @@ public class ItemEventHandler
}
}
@ForgeSubscribe
@SubscribeEvent
@SuppressWarnings("unused")
public void onItemToss(ItemTossEvent event)
{
@ -52,7 +53,7 @@ public class ItemEventHandler
}
}
@ForgeSubscribe
@SubscribeEvent
@SuppressWarnings("unused")
public void onPlayerDrop(PlayerDropsEvent event)
{

View file

@ -1,11 +1,12 @@
package com.pahimar.ee3.handler;
import com.pahimar.ee3.helper.EmcInitializationHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.world.WorldEvent;
public class WorldEventHandler
{
@ForgeSubscribe
@SubscribeEvent
public void onWorldLoaded(WorldEvent.Load event)
{
EmcInitializationHelper.initEmcRegistry();

View file

@ -1,5 +1,6 @@
package com.pahimar.ee3.handler;
import com.google.common.eventbus.Subscribe;
import com.pahimar.ee3.configuration.ConfigurationSettings;
import com.pahimar.ee3.event.ActionEvent;
import com.pahimar.ee3.event.ActionEvent.ActionResult;
@ -14,10 +15,13 @@ import com.pahimar.ee3.network.PacketTypeHandler;
import com.pahimar.ee3.network.packet.PacketItemUpdate;
import com.pahimar.ee3.network.packet.PacketSoundEvent;
import com.pahimar.ee3.network.packet.PacketSpawnParticle;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Equivalent-Exchange-3
@ -108,7 +112,7 @@ public class WorldTransmutationHandler
actionRequestEvent = new ActionRequestEvent(thePlayer, actionEvent, originX + x, originY + y, originZ + z, sideHit);
MinecraftForge.EVENT_BUS.post(actionRequestEvent);
if (actionRequestEvent.allowEvent != Result.DENY)
if (actionRequestEvent.allowEvent != Event.Result.DENY)
{
MinecraftForge.EVENT_BUS.post(actionEvent);
}
@ -147,7 +151,7 @@ public class WorldTransmutationHandler
}
}
@ForgeSubscribe
@SubscribeEvent
public void onWorldTransmutationEvent(WorldTransmutationEvent event)
{

View file

@ -0,0 +1,17 @@
{
"chargeDown": {"category": "master","sounds": [{"name": "chargeDown","stream": false}]},
"chargeUp": {"category": "master","sounds": [{"name": "chargeUp","stream": false}]},
"destruct": {"category": "master","sounds": [{"name": "destruct","stream": false}]},
"fail": {"category": "master","sounds": [{"name": "fail","stream": false}]},
"gust": {"category": "master","sounds": [{"name": "gust","stream": false}]},
"heal": {"category": "master","sounds": [{"name": "heal","stream": false}]},
"kinesis": {"category": "master","sounds": [{"name": "kinesis","stream": false}]},
"launch": {"category": "master","sounds": [{"name": "launch","stream": false}]},
"nova": {"category": "master","sounds": [{"name": "nova","stream": false}]},
"philball": {"category": "master","sounds": [{"name": "philball","stream": false}]},
"tock": {"category": "master","sounds": [{"name": "tock","stream": false}]},
"transmute": {"category": "master","sounds": [{"name": "transmute","stream": false}]},
"wall": {"category": "master","sounds": [{"name": "wall","stream": false}]},
"waterball": {"category": "master","sounds": [{"name": "waterball","stream": false}]},
"wind": {"category": "master","sounds": [{"name": "wind","stream": false}]}
}