diff --git a/src/main/java/assets/hbm/models/blocks/arrow.obj b/src/main/java/assets/hbm/models/blocks/arrow.obj index 52e9add4a..1652de2aa 100644 --- a/src/main/java/assets/hbm/models/blocks/arrow.obj +++ b/src/main/java/assets/hbm/models/blocks/arrow.obj @@ -1,80 +1,91 @@ -# Blender v2.76 (sub 0) OBJ File: '' +# Blender v2.79 (sub 0) OBJ File: '' # www.blender.org o Plane -v -0.250000 0.125000 -0.500000 -v 0.250000 0.125000 -0.500000 -v 0.500000 0.125000 0.000000 -v 0.000000 0.125000 0.500000 -v 0.000000 0.000000 0.500000 v -0.500000 0.000000 0.000000 -v 0.500000 0.000000 0.000000 -v 0.250000 0.000000 -0.500000 v -0.500000 0.125000 0.000000 -v -0.250000 0.000000 -0.500000 -v 0.250000 0.000000 0.000000 v -0.250000 0.125000 0.000000 -v -0.250000 0.000000 0.000000 +v 0.250000 0.000000 -0.500000 +v 0.250000 0.125000 -0.500000 v 0.250000 0.125000 0.000000 -vt 0.494975 0.819349 -vt 0.424264 0.819349 -vt 0.424264 0.638698 -vt 0.141422 1.000000 -vt 0.070711 1.000000 -vt 0.070711 0.638698 -vt 0.700000 0.510958 -vt 0.900000 0.255479 -vt 1.000000 0.638698 -vt 0.353554 1.000000 -vt 0.282843 1.000000 -vt 0.282843 0.638698 -vt 0.000000 1.000000 -vt 0.000000 0.638698 -vt 0.353554 0.819349 -vt 0.353554 0.638698 -vt 0.400000 0.255479 -vt 0.500000 0.638698 -vt 0.200000 0.510958 -vt 0.212132 1.000000 -vt 0.141422 0.638698 -vt 0.212132 0.638698 -vt 0.494975 0.638698 -vt 0.500000 0.255479 -vt 0.700000 0.000000 -vt 0.600000 0.638698 -vt 1.000000 0.127740 -vt 0.500000 0.127740 -vt 0.000000 0.255479 -vt 0.200000 0.000000 -vt 0.100000 0.638698 -vn 0.000000 0.000000 -1.000000 -vn 1.000000 0.000000 0.000000 -vn 0.000000 1.000000 0.000000 -vn -0.707100 0.000000 0.707100 -vn 0.707100 0.000000 0.707100 -vn 0.000000 -1.000000 0.000000 -vn -1.000000 0.000000 0.000000 -s off -f 6/1/1 9/2/1 12/3/1 -f 8/4/2 2/5/2 14/6/2 -f 14/7/3 12/8/3 4/9/3 -f 5/10/4 4/11/4 9/12/4 -f 7/5/5 3/13/5 4/14/5 -f 11/2/1 14/15/1 3/16/1 -f 11/17/6 5/18/6 13/19/6 -f 13/20/7 12/4/7 1/21/7 -f 10/22/1 1/12/1 2/11/1 -f 13/23/1 6/1/1 12/3/1 -f 11/21/2 8/4/2 14/6/2 -f 14/7/3 2/24/3 1/25/3 -f 4/9/3 3/26/3 14/7/3 -f 12/8/3 9/27/3 4/9/3 -f 14/7/3 1/25/3 12/8/3 -f 6/16/4 5/10/4 9/12/4 -f 5/6/5 7/5/5 4/14/5 -f 7/3/1 11/2/1 3/16/1 -f 11/17/6 7/28/6 5/18/6 -f 10/29/6 8/30/6 11/17/6 -f 5/18/6 6/31/6 13/19/6 -f 13/19/6 10/29/6 11/17/6 -f 10/22/7 13/20/7 1/21/7 -f 8/20/1 10/22/1 2/11/1 +v 0.000000 0.125000 0.500000 +v 0.000000 -0.000000 0.500000 +v 0.500000 0.000000 0.000000 +v 0.500000 0.125000 0.000000 +v 0.250000 0.000000 0.000000 +v -0.250000 0.000000 0.000000 +v -0.250000 0.125000 -0.500000 +v -0.250000 0.000000 -0.500000 +vt 0.333302 0.666510 +vt 0.000094 0.666510 +vt 0.000094 0.000094 +vt 0.176982 0.000077 +vt 0.353731 0.000077 +vt 0.353731 0.707075 +vt 0.250050 0.500000 +vt 0.749950 0.500000 +vt 0.500000 0.999900 +vt 0.999923 0.000077 +vt 0.999923 0.176827 +vt 0.000077 0.176827 +vt 0.000077 0.000077 +vt 0.176827 0.000077 +vt 0.176827 0.999923 +vt 0.000094 0.999906 +vt 0.000094 0.666698 +vt 0.666510 0.666698 +vt 0.749950 0.500000 +vt 0.500000 0.999900 +vt 0.250050 0.500000 +vt 0.176827 0.883979 +vt 0.000077 0.883979 +vt 0.000077 0.176982 +vt 0.000050 0.250025 +vt 0.000050 0.000050 +vt 0.999950 0.000050 +vt 0.333302 0.000094 +vt 0.176982 0.707075 +vt 0.250050 0.000100 +vt 0.749950 0.000100 +vt 0.000100 0.500000 +vt 0.999900 0.500000 +vt 0.000077 0.000077 +vt 0.000077 0.999923 +vt 0.666510 0.999906 +vt 0.999900 0.500000 +vt 0.250050 0.000100 +vt 0.749950 0.000100 +vt 0.000100 0.500000 +vt 0.176827 0.176982 +vt 0.999950 0.250025 +vn 0.0000 0.0000 -1.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 1.0000 0.0000 +vn -0.7071 0.0000 0.7071 +vn 0.7071 0.0000 0.7071 +vn 0.0000 -1.0000 -0.0000 +vn -1.0000 0.0000 0.0000 +s 1 +f 1/1/1 2/2/1 3/3/1 +f 4/4/2 5/5/2 6/6/2 +f 6/7/3 3/8/3 7/9/3 +f 8/10/4 7/11/4 2/12/4 +f 9/13/5 10/14/5 7/15/5 +f 11/16/1 6/17/1 10/18/1 +f 11/19/6 8/20/6 12/21/6 +f 12/22/7 3/23/7 13/24/7 +f 14/25/1 13/26/1 5/27/1 +f 12/28/1 1/1/1 3/3/1 +f 11/29/2 4/4/2 6/6/2 +f 6/7/3 5/30/3 13/31/3 +f 7/9/3 10/32/3 6/7/3 +f 3/8/3 2/33/3 7/9/3 +f 6/7/3 13/31/3 3/8/3 +f 1/34/4 8/10/4 2/12/4 +f 8/35/5 9/13/5 7/15/5 +f 9/36/1 11/16/1 10/18/1 +f 11/19/6 9/37/6 8/20/6 +f 14/38/6 4/39/6 11/19/6 +f 8/20/6 1/40/6 12/21/6 +f 12/21/6 14/38/6 11/19/6 +f 14/41/7 12/22/7 13/24/7 +f 4/42/1 14/25/1 5/27/1 diff --git a/src/main/java/assets/hbm/textures/armor/fau_cassette.png b/src/main/java/assets/hbm/textures/armor/fau_cassette.png index 7cda0822c..37df35c1e 100644 Binary files a/src/main/java/assets/hbm/textures/armor/fau_cassette.png and b/src/main/java/assets/hbm/textures/armor/fau_cassette.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/conveyor.png b/src/main/java/assets/hbm/textures/blocks/conveyor.png new file mode 100644 index 000000000..3a84ab620 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/conveyor.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/conveyor.png.mcmeta b/src/main/java/assets/hbm/textures/blocks/conveyor.png.mcmeta new file mode 100644 index 000000000..df9cfce6e --- /dev/null +++ b/src/main/java/assets/hbm/textures/blocks/conveyor.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": { } +} diff --git a/src/main/java/assets/hbm/textures/blocks/crane_in.png b/src/main/java/assets/hbm/textures/blocks/crane_in.png new file mode 100644 index 000000000..af0ea0d69 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/crane_in.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/crane_out.png b/src/main/java/assets/hbm/textures/blocks/crane_out.png new file mode 100644 index 000000000..157c24e4a Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/crane_out.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/crane_side.png b/src/main/java/assets/hbm/textures/blocks/crane_side.png new file mode 100644 index 000000000..7114de091 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/crane_side.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/crane_top.png b/src/main/java/assets/hbm/textures/blocks/crane_top.png new file mode 100644 index 000000000..de1c3261a Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/crane_top.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/crate_entangled_side.png b/src/main/java/assets/hbm/textures/blocks/crate_entangled_side.png new file mode 100644 index 000000000..bd9e5fc2e Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/crate_entangled_side.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/crate_entangled_top.png b/src/main/java/assets/hbm/textures/blocks/crate_entangled_top.png new file mode 100644 index 000000000..dc1866989 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/crate_entangled_top.png differ diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index b18ce42ba..7dd39cc37 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -1286,7 +1286,7 @@ public class ModBlocks { gas_duct_solid = new GasDuctSolid(Material.iron).setBlockName("gas_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":gas_duct_solid"); gas_duct = new BlockGasDuct(Material.iron).setBlockName("gas_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":gas_duct_icon"); fluid_duct = new BlockFluidDuct(Material.iron).setBlockName("fluid_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_icon"); - conveyor = new BlockConveyor(Material.iron).setBlockName("conveyor").setHardness(0.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_reiium"); + conveyor = new BlockConveyor(Material.iron).setBlockName("conveyor").setHardness(0.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor"); chain = new BlockChain(Material.iron).setBlockName("dungeon_chain").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":chain"); diff --git a/src/main/java/com/hbm/blocks/network/BlockConveyor.java b/src/main/java/com/hbm/blocks/network/BlockConveyor.java index 5a4ee956b..a1dbd97b8 100644 --- a/src/main/java/com/hbm/blocks/network/BlockConveyor.java +++ b/src/main/java/com/hbm/blocks/network/BlockConveyor.java @@ -61,7 +61,7 @@ public class BlockConveyor extends Block { @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { - return null; + return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y, z + 1); } @Override diff --git a/src/main/java/com/hbm/entity/item/EntityMovingItem.java b/src/main/java/com/hbm/entity/item/EntityMovingItem.java index b2d318bd4..ebe787a53 100644 --- a/src/main/java/com/hbm/entity/item/EntityMovingItem.java +++ b/src/main/java/com/hbm/entity/item/EntityMovingItem.java @@ -48,8 +48,8 @@ public class EntityMovingItem extends Entity { public boolean attackEntityFrom(DamageSource source, float amount) { if(!worldObj.isRemote) { - worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, this.getItemStack())); this.setDead(); + worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, this.getItemStack())); } return true; } @@ -80,7 +80,12 @@ public class EntityMovingItem extends Entity { if(worldObj.getBlock((int)Math.floor(posX), (int)Math.floor(posY), (int)Math.floor(posZ)) != ModBlocks.conveyor) { this.setDead(); - worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, this.getItemStack())); + EntityItem item = new EntityItem(worldObj, posX, posY, posZ, this.getItemStack()); + item.motionX = this.motionX * 3; + item.motionY = 0.1; + item.motionZ = this.motionZ * 3; + item.velocityChanged = true; + worldObj.spawnEntityInWorld(item); return; } } @@ -104,9 +109,15 @@ public class EntityMovingItem extends Entity { motionX = -speed * dir.offsetX; motionY = -speed * dir.offsetY; motionZ = -speed * dir.offsetZ; + + this.velocityChanged = true; } + + this.lastTickPosX = this.prevPosX = this.posX; + this.lastTickPosY = this.prevPosY = this.posY; + this.lastTickPosZ = this.prevPosZ = this.posZ; - this.moveEntity(motionX, motionY, motionZ); + this.setPosition(posX + motionX, posY + motionY, posZ + motionZ); schedule--; } } diff --git a/src/main/java/com/hbm/entity/logic/EntityDeathBlast.java b/src/main/java/com/hbm/entity/logic/EntityDeathBlast.java index e9db9a631..e51134cb3 100644 --- a/src/main/java/com/hbm/entity/logic/EntityDeathBlast.java +++ b/src/main/java/com/hbm/entity/logic/EntityDeathBlast.java @@ -1,11 +1,17 @@ package com.hbm.entity.logic; -import com.hbm.explosion.ExplosionLarge; +import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.explosion.ExplosionNT; +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Vec3; import net.minecraft.world.World; public class EntityDeathBlast extends Entity { @@ -31,8 +37,36 @@ public class EntityDeathBlast extends Entity { if(this.ticksExisted >= maxAge && !worldObj.isRemote) { this.setDead(); - - ExplosionLarge.explodeFire(worldObj, posX, posY, posZ, 25, true, true, true); + + /*new ExplosionNT(worldObj, null, posX, posY, posZ, 35).addAllAttrib(ExplosionNT.nukeAttribs).explode(); + new ExplosionNT(worldObj, null, posX + 10, posY, posZ, 20).addAllAttrib(ExplosionNT.nukeAttribs).explode(); + new ExplosionNT(worldObj, null, posX - 10, posY, posZ, 20).addAllAttrib(ExplosionNT.nukeAttribs).explode(); + new ExplosionNT(worldObj, null, posX, posY, posZ + 10, 20).addAllAttrib(ExplosionNT.nukeAttribs).explode(); + new ExplosionNT(worldObj, null, posX, posY, posZ - 10, 20).addAllAttrib(ExplosionNT.nukeAttribs).explode(); + + for(int k = 1; k < 6; k++) + new ExplosionNT(worldObj, null, posX, posY - k * 7, posZ, 20).addAllAttrib(ExplosionNT.nukeAttribs).explode();*/ + + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFacNoRad(worldObj, 40, posX, posY, posZ).mute()); + + int count = 100; + for(int i = 0; i < count; i++) { + + Vec3 vec = Vec3.createVectorHelper(0.2, 0, 0); + vec.rotateAroundY((float)(2 * Math.PI * i / (float)count)); + + EntityBulletBase laser = new EntityBulletBase(worldObj, BulletConfigSyncingUtil.MASKMAN_BOLT); + laser.setPosition(posX, posY + 2, posZ); + laser.motionX = vec.xCoord; + laser.motionZ = vec.zCoord; + laser.motionY = -0.01; + worldObj.spawnEntityInWorld(laser); + } + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "muke"); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 250)); + worldObj.playSoundEffect(posX, posY, posZ, "hbm:weapon.mukeExplosion", 25.0F, 0.9F); } } diff --git a/src/main/java/com/hbm/handler/EntityEffectHandler.java b/src/main/java/com/hbm/handler/EntityEffectHandler.java new file mode 100644 index 000000000..bc93d2745 --- /dev/null +++ b/src/main/java/com/hbm/handler/EntityEffectHandler.java @@ -0,0 +1,90 @@ +package com.hbm.handler; + +import com.hbm.config.RadiationConfig; +import com.hbm.extprop.HbmLivingProps; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.ExtPropPacket; +import com.hbm.saveddata.AuxSavedData; +import com.hbm.saveddata.RadiationSavedData; +import com.hbm.util.ContaminationUtil; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +public class EntityEffectHandler { + + public static void onUpdate(EntityLivingBase entity) { + + if(!entity.worldObj.isRemote && entity instanceof EntityPlayerMP) { + NBTTagCompound data = new NBTTagCompound(); + HbmLivingProps props = HbmLivingProps.getData(entity); + props.saveNBTData(data); + PacketDispatcher.wrapper.sendTo(new ExtPropPacket(data), (EntityPlayerMP) entity); + } + + if(HbmLivingProps.getRadiation(entity) > 0) + handleRadiation(entity); + + if(HbmLivingProps.getDigamma(entity) > 0) + handleDigamma(entity); + } + + private static void handleRadiation(EntityLivingBase entity) { + + World world = entity.worldObj; + + if(world.isRemote) + return; + + if(entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode) + return; + + RadiationSavedData data = RadiationSavedData.getData(world); + int ix = (int)MathHelper.floor_double(entity.posX); + int iy = (int)MathHelper.floor_double(entity.posY); + int iz = (int)MathHelper.floor_double(entity.posZ); + + if(world.getTotalWorldTime() % 20 == 0) { + + Chunk chunk = world.getChunkFromBlockCoords(ix, iz); + float rad = data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition); + + if(world.provider.isHellWorld && RadiationConfig.hellRad > 0 && rad < RadiationConfig.hellRad) + rad = RadiationConfig.hellRad; + + if(rad > 0) { + ContaminationUtil.applyRadData(entity, rad); + } + + if(entity.worldObj.isRaining() && RadiationConfig.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && entity.worldObj.canBlockSeeTheSky(ix, iy, iz)) { + + ContaminationUtil.applyRadData(entity, RadiationConfig.cont * 0.01F); + } + } + } + + private static void handleDigamma(EntityLivingBase entity) { + + if(!entity.worldObj.isRemote) { + + float digamma = HbmLivingProps.getDigamma(entity); + + int chance = Math.max(10 - (int)(digamma), 1); + + if(chance == 1 || entity.getRNG().nextInt(chance) == 0) { + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "digammaDecay"); + data.setInteger("entity", entity.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + } + } + } +} diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index b91acc327..d3cb36366 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -12,7 +12,9 @@ import net.minecraft.client.particle.EntityReddustFX; import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MovingObjectPosition; @@ -1051,29 +1053,25 @@ public class ClientProxy extends ServerProxy { player.attackedAtYaw = 0F; } - if("hadron".equals(type)) { + if("digammaDecay".equals(type)) { - /*for(int i = 0; i < 30; i++) { - - EntityFX fx = null; + Entity e = world.getEntityByID(data.getInteger("entity")); + + if(e instanceof EntityLivingBase) { - if(i % 3 == 0) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.0F, 0.0F, 0.0F); - } - if(i % 3 == 1) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 0.01F, 0.01F, 1F); - } - if(i % 3 == 2) { - fx = new net.minecraft.client.particle.EntityReddustFX(world, x, y, z, 1F, 1F, 0.1F); - } + double ix = e.boundingBox.minX - 0.2 + (e.boundingBox.maxX - e.boundingBox.minX + 0.4) * rand.nextDouble(); + double iy = e.boundingBox.minY + (e.boundingBox.maxY - e.boundingBox.minY + 0.2) * rand.nextDouble(); + double iz = e.boundingBox.minZ - 0.2 + (e.boundingBox.maxZ - e.boundingBox.minZ + 0.4) * rand.nextDouble(); - if(fx != null) { - fx.motionX = rand.nextGaussian() * 0.1; - fx.motionY = rand.nextGaussian() * 0.1; - fx.motionZ = rand.nextGaussian() * 0.1; - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - }*/ + + EntityFX fx = new net.minecraft.client.particle.EntityBlockDustFX(world, ix, iy, iz, 0, 0, 0, Blocks.soul_sand, 0); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 150 + rand.nextInt(50), "particleMaxAge", "field_70547_e"); + + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + } + + if("hadron".equals(type)) { Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleHadron(man, world, x, y, z)); } diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 2e55db96b..fca62bd13 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -28,6 +28,7 @@ import com.hbm.entity.projectile.EntityMeteor; import com.hbm.extprop.HbmLivingProps; import com.hbm.extprop.HbmPlayerProps; import com.hbm.handler.BossSpawnHandler; +import com.hbm.handler.EntityEffectHandler; import com.hbm.handler.RadiationWorldHandler; import com.hbm.handler.HTTPHandler; import com.hbm.items.ModItems; @@ -39,7 +40,7 @@ import com.hbm.lib.ModDamageSource; import com.hbm.lib.RefStrings; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PlayerInformPacket; -import com.hbm.packet.RadSurveyPacket; +import com.hbm.packet.ExtPropPacket; import com.hbm.saveddata.AuxSavedData; import com.hbm.saveddata.RadiationSavedData; import com.hbm.util.ArmorUtil; @@ -91,6 +92,7 @@ import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingFallEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent; @@ -222,6 +224,11 @@ public class ModEventHandler } } + @SubscribeEvent + public void onLivingUpdate(LivingUpdateEvent event) { + EntityEffectHandler.onUpdate(event.entityLiving); + } + @SubscribeEvent public void worldTick(WorldTickEvent event) { @@ -281,15 +288,6 @@ public class ModEventHandler data.worldObj = event.world; } - for(Object o : event.world.playerEntities) { - - if(o instanceof EntityPlayerMP) { - EntityPlayerMP player = (EntityPlayerMP)o; - //TODO: replace with packet that sends all to-sync data - PacketDispatcher.wrapper.sendTo(new RadSurveyPacket(HbmLivingProps.getRadiation(player)), player); - } - } - if(event.world.getTotalWorldTime() % 20 == 0 && event.phase == Phase.START) { data.updateSystem(); } @@ -297,6 +295,10 @@ public class ModEventHandler List oList = new ArrayList(); oList.addAll(event.world.loadedEntityList); + + /** + * REMOVE THIS V V V + */ for(Object e : oList) { if(e instanceof EntityLivingBase) { @@ -305,25 +307,6 @@ public class ModEventHandler if(entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode) continue; - - if(event.world.getTotalWorldTime() % 20 == 0) { - - Chunk chunk = entity.worldObj.getChunkFromBlockCoords((int)entity.posX, (int)entity.posZ); - float rad = data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition); - - if(event.world.provider.isHellWorld && RadiationConfig.hellRad > 0 && rad < RadiationConfig.hellRad) - rad = RadiationConfig.hellRad; - - if(rad > 0) { - ContaminationUtil.applyRadData(entity, rad / 2); - } - - if(entity.worldObj.isRaining() && RadiationConfig.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && - entity.worldObj.canBlockSeeTheSky(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ))) { - - ContaminationUtil.applyRadData(entity, RadiationConfig.cont * 0.005F); - } - } float eRad = HbmLivingProps.getRadiation(entity); @@ -445,6 +428,9 @@ public class ModEventHandler } } } + /** + * REMOVE THIS ^ ^ ^ + */ } } /// RADIATION STUFF END /// diff --git a/src/main/java/com/hbm/packet/ExtPropPacket.java b/src/main/java/com/hbm/packet/ExtPropPacket.java new file mode 100644 index 000000000..aaf18e370 --- /dev/null +++ b/src/main/java/com/hbm/packet/ExtPropPacket.java @@ -0,0 +1,76 @@ +package com.hbm.packet; + +import java.io.IOException; + +import com.hbm.extprop.HbmLivingProps; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; + +public class ExtPropPacket implements IMessage { + + PacketBuffer buffer; + + public ExtPropPacket() { } + + public ExtPropPacket(NBTTagCompound nbt) { + + this.buffer = new PacketBuffer(Unpooled.buffer()); + + try { + buffer.writeNBTTagCompoundToBuffer(nbt); + + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void fromBytes(ByteBuf buf) { + + if (buffer == null) { + buffer = new PacketBuffer(Unpooled.buffer()); + } + buffer.writeBytes(buf); + } + + @Override + public void toBytes(ByteBuf buf) { + + if (buffer == null) { + buffer = new PacketBuffer(Unpooled.buffer()); + } + buf.writeBytes(buffer); + } + + public static class Handler implements IMessageHandler { + + @Override + @SideOnly(Side.CLIENT) + public IMessage onMessage(ExtPropPacket m, MessageContext ctx) { + + if(Minecraft.getMinecraft().theWorld == null) + return null; + + try { + + NBTTagCompound nbt = m.buffer.readNBTTagCompoundFromBuffer(); + HbmLivingProps props = HbmLivingProps.getData(Minecraft.getMinecraft().thePlayer); + props.loadNBTData(nbt); + + } catch (IOException e) { + e.printStackTrace(); + } + + return null; + } + } +} diff --git a/src/main/java/com/hbm/packet/PacketDispatcher.java b/src/main/java/com/hbm/packet/PacketDispatcher.java index 24f4ef011..b60994331 100644 --- a/src/main/java/com/hbm/packet/PacketDispatcher.java +++ b/src/main/java/com/hbm/packet/PacketDispatcher.java @@ -70,7 +70,7 @@ public class PacketDispatcher { //Packet to send block break particles wrapper.registerMessage(ParticleBurstPacket.Handler.class, ParticleBurstPacket.class, i++, Side.CLIENT); //Packet to send chunk radiation info to individual players - wrapper.registerMessage(RadSurveyPacket.Handler.class, RadSurveyPacket.class, i++, Side.CLIENT); + wrapper.registerMessage(ExtPropPacket.Handler.class, ExtPropPacket.class, i++, Side.CLIENT); //Entity sound packet that keeps client and server separated wrapper.registerMessage(LoopedEntitySoundPacket.Handler.class, LoopedEntitySoundPacket.class, i++, Side.CLIENT); //Entity sound packet that keeps client and server separated diff --git a/src/main/java/com/hbm/packet/RadSurveyPacket.java b/src/main/java/com/hbm/packet/RadSurveyPacket.java deleted file mode 100644 index 932db6588..000000000 --- a/src/main/java/com/hbm/packet/RadSurveyPacket.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.hbm.packet; - -import com.hbm.extprop.HbmLivingProps; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import io.netty.buffer.ByteBuf; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; - -public class RadSurveyPacket implements IMessage { - - float rad; - - public RadSurveyPacket() - { - - } - - public RadSurveyPacket(float rad) - { - this.rad = rad; - } - - @Override - public void fromBytes(ByteBuf buf) { - - rad = buf.readFloat(); - } - - @Override - public void toBytes(ByteBuf buf) { - - buf.writeFloat(rad); - } - - public static class Handler implements IMessageHandler { - - @Override - @SideOnly(Side.CLIENT) - public IMessage onMessage(RadSurveyPacket m, MessageContext ctx) { - try { - - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - HbmLivingProps.setRadiation(player, m.rad); - - } catch (Exception x) { } - return null; - } - } -} diff --git a/src/main/java/com/hbm/render/block/RenderConveyor.java b/src/main/java/com/hbm/render/block/RenderConveyor.java index 58dc66c81..bdb915666 100644 --- a/src/main/java/com/hbm/render/block/RenderConveyor.java +++ b/src/main/java/com/hbm/render/block/RenderConveyor.java @@ -41,30 +41,23 @@ public class RenderConveyor implements ISimpleBlockRenderingHandler { public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; - IIcon iicon = block.getIcon(0, world.getBlockMetadata(x, y, z)); + int meta = world.getBlockMetadata(x, y, z); tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); tessellator.setColorOpaque_F(1, 1, 1); - if (renderer.hasOverrideBlockTexture()) - { - iicon = renderer.overrideBlockTexture; - } - - float rotation = 0; - - if(world.getBlockMetadata(x, y, z) == 3) - rotation = 180F / 180F * (float)Math.PI; - - if(world.getBlockMetadata(x, y, z) == 4) - rotation = 90F / 180F * (float)Math.PI; - - if(world.getBlockMetadata(x, y, z) == 5) - rotation = 270F / 180F * (float)Math.PI; - - tessellator.addTranslation(x + 0.5F, y, z + 0.5F); - ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.arrow, iicon, tessellator, rotation, true); - tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F); + if(meta == 2) + renderer.uvRotateTop = 3; + if(meta == 3) + renderer.uvRotateTop = 0; + if(meta == 4) + renderer.uvRotateTop = 1; + if(meta == 5) + renderer.uvRotateTop = 2; + + renderer.setRenderBounds((double)0, 0.0D, (double)0, (double)1, 0.125D, (double)1); + renderer.renderStandardBlock(block, x, y, z); + renderer.uvRotateTop = 0; return true; } diff --git a/src/main/java/com/hbm/render/model/ModelArmorDigamma.java b/src/main/java/com/hbm/render/model/ModelArmorDigamma.java index d4e808b89..6410a0333 100644 --- a/src/main/java/com/hbm/render/model/ModelArmorDigamma.java +++ b/src/main/java/com/hbm/render/model/ModelArmorDigamma.java @@ -6,6 +6,7 @@ import com.hbm.main.ResourceManager; import com.hbm.render.loader.ModelRendererObj; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.entity.Entity; public class ModelArmorDigamma extends ModelArmorBase { @@ -43,6 +44,8 @@ public class ModelArmorDigamma extends ModelArmorBase { if(type == 1) { Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.fau_chest); body.render(par7); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.fau_cassette); cassette.render(par7); Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.fau_arm);