fixed laser, drops

This commit is contained in:
fewizz committed 2015-09-13 21:24:58 +03:00
1 parent d51d4aa2c4
commit 04b332bd07
12 files changed
+23 -62

No files matched your search

@@ -72,7 +72,7 @@ public class ElectroMagicTools {
ElectroMagicTools.logger.info("Loading the proxies");
proxy.load();
ElectroMagicTools.logger.info("Making mobs drop additional items");
MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
MinecraftForge.EVENT_BUS.register(new EventHandlerEMT());
ElectroMagicTools.logger.info("Adding dungeon loot");
DungeonChestGenerator.generateLoot();
@@ -163,14 +163,11 @@ public class EntityLaser extends Entity implements IProjectile {
if (this.inGround) {
Block j = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
this.worldObj.createExplosion(this, (int)this.posX, (int)this.posY, (int)this.posZ, 3, true);
this.setDead();
//for(int x = 0; x < 6; x++){
// for(int z = 0; z < 6; z++){
// this.worldObj.setBlockToAir((int)this.posX + x, (int)this.posY, (int)this.posZ + z);
// }
//}
//this.setDead();
if(!this.worldObj.isRemote){
this.worldObj.createExplosion(this, (int)this.posX, (int)this.posY, (int)this.posZ, 3, true);
this.setDead();
}
if (j == this.inTile && k == this.inData) {
++this.ticksInGround;
@@ -11,7 +11,7 @@ import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApi;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.items.armor.ItemEMTQuantum;
import tombenpotter.emt.common.items.armor.ItemInfusedQuantum;
import tombenpotter.emt.common.items.armor.wings.ItemFeatherWing;
import tombenpotter.emt.common.items.armor.wings.ItemThaumiumReinforcedWing;
import tombenpotter.emt.common.items.armor.boots.ItemElectricBootsTraveller;
@@ -88,7 +88,7 @@ public class ItemRegistry {
onering = new ItemOneRing();
GameRegistry.registerItem(onering, "BaseBaubles");
quantumArmor = new ItemEMTQuantum(InternalName.itemArmorQuantumChestplate, 1).setUnlocalizedName(ModInformation.modid + ".quantum");
quantumArmor = new ItemInfusedQuantum(InternalName.itemArmorQuantumChestplate, 1).setUnlocalizedName(ModInformation.modid + ".quantum");
electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.electric");
GameRegistry.registerItem(electricGoggles, "ElectricGogglesRevealing");
@@ -61,7 +61,7 @@ import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingFallEvent;
public class ItemEMTQuantum extends ItemArmorElectric {
public class ItemInfusedQuantum extends ItemArmorElectric {
IIcon icon0;
IIcon icon1;
@@ -74,7 +74,7 @@ public class ItemEMTQuantum extends ItemArmorElectric {
public static AudioSource audioSource;
private static boolean lastJetpackUsed = false;
public ItemEMTQuantum(InternalName internalName, int armorType1) {
public ItemInfusedQuantum(InternalName internalName, int armorType1) {
super(internalName, InternalName.quantum, armorType1, 2000000, 12000.0D, 4);
MinecraftForge.EVENT_BUS.register(this);
@@ -50,7 +50,7 @@ public class ItemChargeFocus extends ItemBaseFocus {
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) {
int energyLeft = ConfigHandler.chargeFocusProduction;
@@ -58,7 +58,7 @@ public class ItemChristmasFocus extends ItemBaseFocus {
int x = mop.blockX;
int y = mop.blockY + 1;
int z = mop.blockZ;
if (wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) {
EntitySnowman snowman;
snowman = new EntitySnowman(world);
@@ -48,7 +48,7 @@ public class ItemExplosionFocus extends ItemBaseFocus {
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) {
EntityLaser laser;
laser = new EntityLaser(world, player, 2);
@@ -59,7 +59,7 @@ public class ItemShieldFocus extends ItemBaseFocus {
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
player.motionX = 0.0D;
if(!player.capabilities.isCreativeMode && player.motionY < 0)
@@ -13,10 +13,8 @@ public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, I
@Override
public IMessage onMessage(PacketEMTKeys message, MessageContext ctx) {
if(ctx.getServerHandler().playerEntity.inventory.armorInventory[2] != null && ctx.getServerHandler().playerEntity.inventory.armorInventory[2].getItem() == ItemRegistry.quantumArmor){
System.out.println("Odel.");
ctx.getServerHandler().playerEntity.inventory.armorInventory[2].stackTagCompound.setBoolean("unequip", true);
}
System.out.println("Prinyal.");
return null;
}
@@ -26,7 +26,7 @@ public class CreativeTabEMT extends CreativeTabs {
@Override
public ItemStack getIconItemStack() {
return new ItemStack(ItemRegistry.thorHammer);
return new ItemStack(ItemRegistry.rockbreakerDrill);
}
@Override
@@ -1,28 +0,0 @@
package tombenpotter.emt.common.util;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import thaumcraft.common.entities.monster.EntityTaintChicken;
import tombenpotter.emt.common.items.ItemRegistry;
public class EntityEventHandler {
@SubscribeEvent
public void onEntityLivingDrops(LivingDropsEvent event) {
if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
if (event.entityLiving instanceof EntityCreeper) {
EntityCreeper creeper = (EntityCreeper) event.entityLiving;
if (creeper.getPowered()) {
event.entityLiving.entityDropItem(new ItemStack(ItemRegistry.itemEMTItems, 1, 6), 1);
}
}
if (event.entityLiving instanceof EntityTaintChicken) {
event.entityLiving.entityDropItem(new ItemStack(ItemRegistry.itemEMTItems, 1, 14), 1);
}
}
}
}
@@ -12,6 +12,8 @@
package tombenpotter.emt.common.util;
import java.util.Random;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
@@ -32,26 +34,18 @@ import tombenpotter.emt.common.network.PacketEMTKeys;
import tombenpotter.emt.proxies.ClientProxy;
public class EventHandlerEMT {
Random rnd = new Random();
@SubscribeEvent
public void onEntityLivingDrops(LivingDropsEvent event) {
if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
if (event.entityLiving instanceof EntityCreeper) {
EntityCreeper creeper = (EntityCreeper) event.entityLiving;
if (creeper.getPowered()) {
event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ItemRegistry.itemEMTItems, 1, 6)));
}
if (event.entityLiving instanceof EntityCreeper) {
EntityCreeper creeper = (EntityCreeper) event.entityLiving;
if (creeper.getPowered()) {
event.entityLiving.entityDropItem(new ItemStack(ItemRegistry.itemEMTItems, 1, 6), 1);
}
if (event.entityLiving instanceof EntityTaintChicken) {
event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ItemRegistry.itemEMTItems, 1, 14)));
}
}
if (event.entityLiving instanceof EntityCreeper) {
event.entityLiving.entityDropItem(new ItemStack(ItemRegistry.itemEMTItems, 6), 1);
}
if (event.entityLiving instanceof EntityTaintChicken) {
event.entityLiving.entityDropItem(new ItemStack(ItemRegistry.itemEMTItems, 14), 1);
event.entityLiving.entityDropItem(new ItemStack(ItemRegistry.itemEMTItems, rnd.nextInt(3), 13), 1);
}
}