Another pass at the 1.7 update - more to come tomorrow
This commit is contained in:
parent
9070ad038b
commit
059d9614c1
34 changed files with 59 additions and 29 deletions
|
@ -14,6 +14,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.pahimar.ee3.client.audio;
|
||||||
|
|
||||||
import com.pahimar.ee3.helper.LogHelper;
|
import com.pahimar.ee3.helper.LogHelper;
|
||||||
import com.pahimar.ee3.lib.Sounds;
|
import com.pahimar.ee3.lib.Sounds;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,24 +14,23 @@ import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||||
*/
|
*/
|
||||||
public class SoundHandler
|
public class SoundHandler
|
||||||
{
|
{
|
||||||
|
@SubscribeEvent
|
||||||
@ForgeSubscribe
|
|
||||||
public void onSoundLoad(SoundLoadEvent event)
|
public void onSoundLoad(SoundLoadEvent event)
|
||||||
{
|
{
|
||||||
|
// FIXME Load custom sounds into Minecraft
|
||||||
// For each custom sound file we have defined in Sounds
|
// For each custom sound file we have defined in Sounds
|
||||||
for (String soundFile : Sounds.soundFiles)
|
// for (String soundFile : Sounds.soundFiles)
|
||||||
{
|
// {
|
||||||
// Try to add the custom sound file to the pool of sounds
|
// // Try to add the custom sound file to the pool of sounds
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
event.manager.addSound(soundFile);
|
// event.manager.addSound(soundFile);
|
||||||
}
|
// }
|
||||||
// If we cannot add the custom sound file to the pool, log the exception
|
// // If we cannot add the custom sound file to the pool, log the exception
|
||||||
catch (Exception e)
|
// catch (Exception e)
|
||||||
{
|
// {
|
||||||
LogHelper.warn("Failed loading sound file: " + soundFile);
|
// LogHelper.warn("Failed loading sound file: " + soundFile);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,13 @@ package com.pahimar.ee3.client.handler;
|
||||||
import com.pahimar.ee3.item.IChargeable;
|
import com.pahimar.ee3.item.IChargeable;
|
||||||
import com.pahimar.ee3.lib.Textures;
|
import com.pahimar.ee3.lib.Textures;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.GL12;
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
|
@ -75,7 +77,7 @@ public class DrawBlockHighlightHandler
|
||||||
return pulse;
|
return pulse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ForgeSubscribe
|
@SubscribeEvent
|
||||||
public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event)
|
public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,6 +3,8 @@ package com.pahimar.ee3.client.handler;
|
||||||
import com.pahimar.ee3.api.WrappedStack;
|
import com.pahimar.ee3.api.WrappedStack;
|
||||||
import com.pahimar.ee3.emc.EmcRegistry;
|
import com.pahimar.ee3.emc.EmcRegistry;
|
||||||
import com.pahimar.ee3.emc.EmcValue;
|
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.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||||
|
@ -23,7 +25,7 @@ public class ItemTooltipEventHandler
|
||||||
private static DecimalFormat emcDecimalFormat = new DecimalFormat("###,###,###,###,###.###");
|
private static DecimalFormat emcDecimalFormat = new DecimalFormat("###,###,###,###,###.###");
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@ForgeSubscribe(priority = EventPriority.LOWEST)
|
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||||
public void handleItemTooltipEvent(ItemTooltipEvent event)
|
public void handleItemTooltipEvent(ItemTooltipEvent event)
|
||||||
{
|
{
|
||||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT))
|
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT))
|
||||||
|
|
|
@ -14,6 +14,7 @@ import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,7 +70,7 @@ public class TileEntityAludelRenderer extends TileEntitySpecialRenderer
|
||||||
*/
|
*/
|
||||||
GL11.glPushMatrix();
|
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)
|
if (tileGlassBell instanceof TileGlassBell)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +79,7 @@ public class TileEntityAludelRenderer extends TileEntitySpecialRenderer
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAludel.outputItemStack);
|
float scaleFactor = getGhostItemScaleFactor(tileAludel.outputItemStack);
|
||||||
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
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.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAludel.outputItemStack);
|
ghostEntityItem.setEntityItemStack(tileAludel.outputItemStack);
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,7 +79,7 @@ public class TileEntityGlassBellRenderer extends TileEntitySpecialRenderer
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileGlassBell.outputItemStack);
|
float scaleFactor = getGhostItemScaleFactor(tileGlassBell.outputItemStack);
|
||||||
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
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.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileGlassBell.outputItemStack);
|
ghostEntityItem.setEntityItemStack(tileGlassBell.outputItemStack);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.pahimar.ee3.handler;
|
package com.pahimar.ee3.handler;
|
||||||
|
|
||||||
import com.pahimar.ee3.event.ActionRequestEvent;
|
import com.pahimar.ee3.event.ActionRequestEvent;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent-Exchange-3
|
* Equivalent-Exchange-3
|
||||||
|
@ -11,8 +12,7 @@ import com.pahimar.ee3.event.ActionRequestEvent;
|
||||||
*/
|
*/
|
||||||
public class ActionRequestHandler
|
public class ActionRequestHandler
|
||||||
{
|
{
|
||||||
|
@SubscribeEvent
|
||||||
@ForgeSubscribe
|
|
||||||
public void onModActionEvent(ActionRequestEvent event)
|
public void onModActionEvent(ActionRequestEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.pahimar.ee3.handler;
|
||||||
|
|
||||||
import com.pahimar.ee3.helper.ItemStackNBTHelper;
|
import com.pahimar.ee3.helper.ItemStackNBTHelper;
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraftforge.event.entity.item.ItemTossEvent;
|
import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||||
|
@ -16,7 +17,7 @@ import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||||
*/
|
*/
|
||||||
public class ItemEventHandler
|
public class ItemEventHandler
|
||||||
{
|
{
|
||||||
@ForgeSubscribe
|
@SubscribeEvent
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public void onItemPickup(EntityItemPickupEvent event)
|
public void onItemPickup(EntityItemPickupEvent event)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +35,7 @@ public class ItemEventHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ForgeSubscribe
|
@SubscribeEvent
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public void onItemToss(ItemTossEvent event)
|
public void onItemToss(ItemTossEvent event)
|
||||||
{
|
{
|
||||||
|
@ -52,7 +53,7 @@ public class ItemEventHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ForgeSubscribe
|
@SubscribeEvent
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public void onPlayerDrop(PlayerDropsEvent event)
|
public void onPlayerDrop(PlayerDropsEvent event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package com.pahimar.ee3.handler;
|
package com.pahimar.ee3.handler;
|
||||||
|
|
||||||
import com.pahimar.ee3.helper.EmcInitializationHelper;
|
import com.pahimar.ee3.helper.EmcInitializationHelper;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.event.world.WorldEvent;
|
import net.minecraftforge.event.world.WorldEvent;
|
||||||
|
|
||||||
public class WorldEventHandler
|
public class WorldEventHandler
|
||||||
{
|
{
|
||||||
@ForgeSubscribe
|
@SubscribeEvent
|
||||||
public void onWorldLoaded(WorldEvent.Load event)
|
public void onWorldLoaded(WorldEvent.Load event)
|
||||||
{
|
{
|
||||||
EmcInitializationHelper.initEmcRegistry();
|
EmcInitializationHelper.initEmcRegistry();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.pahimar.ee3.handler;
|
package com.pahimar.ee3.handler;
|
||||||
|
|
||||||
|
import com.google.common.eventbus.Subscribe;
|
||||||
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
||||||
import com.pahimar.ee3.event.ActionEvent;
|
import com.pahimar.ee3.event.ActionEvent;
|
||||||
import com.pahimar.ee3.event.ActionEvent.ActionResult;
|
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.PacketItemUpdate;
|
||||||
import com.pahimar.ee3.network.packet.PacketSoundEvent;
|
import com.pahimar.ee3.network.packet.PacketSoundEvent;
|
||||||
import com.pahimar.ee3.network.packet.PacketSpawnParticle;
|
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.block.Block;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent-Exchange-3
|
* Equivalent-Exchange-3
|
||||||
|
@ -108,7 +112,7 @@ public class WorldTransmutationHandler
|
||||||
actionRequestEvent = new ActionRequestEvent(thePlayer, actionEvent, originX + x, originY + y, originZ + z, sideHit);
|
actionRequestEvent = new ActionRequestEvent(thePlayer, actionEvent, originX + x, originY + y, originZ + z, sideHit);
|
||||||
MinecraftForge.EVENT_BUS.post(actionRequestEvent);
|
MinecraftForge.EVENT_BUS.post(actionRequestEvent);
|
||||||
|
|
||||||
if (actionRequestEvent.allowEvent != Result.DENY)
|
if (actionRequestEvent.allowEvent != Event.Result.DENY)
|
||||||
{
|
{
|
||||||
MinecraftForge.EVENT_BUS.post(actionEvent);
|
MinecraftForge.EVENT_BUS.post(actionEvent);
|
||||||
}
|
}
|
||||||
|
@ -147,7 +151,7 @@ public class WorldTransmutationHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ForgeSubscribe
|
@SubscribeEvent
|
||||||
public void onWorldTransmutationEvent(WorldTransmutationEvent event)
|
public void onWorldTransmutationEvent(WorldTransmutationEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
17
src/main/resources/assets/ee3/sounds/sounds.json
Normal file
17
src/main/resources/assets/ee3/sounds/sounds.json
Normal 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}]}
|
||||||
|
}
|
Loading…
Reference in a new issue