diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2017-06-17 08:12:18 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2017-06-17 08:12:18 +0300 |
| commit | dc3df3edd5843bde0c1335d6a8e460b2c832aa48 (patch) | |
| tree | af13bfeee567f2351e35e1ef176d168fe37c8aac /ihl/enviroment/LaserHitMirrorEventHandler.java | |
| parent | 1da8dcd58647e34c9af94ceeecaeaf3b0d08c48c (diff) | |
full project files
Diffstat (limited to 'ihl/enviroment/LaserHitMirrorEventHandler.java')
| -rw-r--r-- | ihl/enviroment/LaserHitMirrorEventHandler.java | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/ihl/enviroment/LaserHitMirrorEventHandler.java b/ihl/enviroment/LaserHitMirrorEventHandler.java deleted file mode 100644 index 6cd61fc..0000000 --- a/ihl/enviroment/LaserHitMirrorEventHandler.java +++ /dev/null @@ -1,48 +0,0 @@ -package ihl.enviroment;
-
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import ic2.api.event.LaserEvent;
-import ic2.core.item.tool.EntityMiningLaser;
-import net.minecraft.entity.Entity;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class LaserHitMirrorEventHandler
-{
- public LaserHitMirrorEventHandler(){}
-
- @SubscribeEvent
- public void onLaserHit(LaserEvent.LaserHitsBlockEvent event)
- {
- TileEntity te = event.world.getTileEntity(event.x, event.y, event.z);
- if(te instanceof MirrorTileEntity)
- {
- ForgeDirection mirrorDirection = ForgeDirection.getOrientation(((MirrorTileEntity)te).getFacing());
- Entity ls = event.lasershot;
- if((ls.motionX*mirrorDirection.offsetX+ls.motionY*mirrorDirection.offsetY+ls.motionZ*mirrorDirection.offsetZ)<0)
- {
- if(mirrorDirection.offsetX!=0)
- {
- ls.motionX=-ls.motionX;
- }
- if(mirrorDirection.offsetY!=0)
- {
- ls.motionY=-ls.motionY;
- }
- if(mirrorDirection.offsetZ!=0)
- {
- ls.motionZ=-ls.motionZ;
- }
- if(!event.world.isRemote)
- {
- EntityMiningLaser tLaser = new EntityMiningLaser(event.world, event.owner, event.range, event.power, event.blockBreaks, event.explosive, 0, 0, ls.posY);
- tLaser.setPosition(ls.posX, ls.posY, ls.posZ);
- tLaser.setLaserHeading(ls.motionX, ls.motionY, ls.motionZ, 1d);
- ls.setDead();
- event.world.spawnEntityInWorld(tLaser);
- }
- event.setCanceled(true);
- }
- }
- }
-}
|
