mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
you can now cut off big man johnson's johnson
This commit is contained in:
parent
b278d27b9b
commit
b2d52e8cfa
12
changelog
12
changelog
@ -25,6 +25,14 @@
|
|||||||
* This means that in system with slow input, the time window when items can be added to the arc furance is now more forgiving
|
* This means that in system with slow input, the time window when items can be added to the arc furance is now more forgiving
|
||||||
* Pipe anchors now have a look overlay showing the currently configured fluid type
|
* Pipe anchors now have a look overlay showing the currently configured fluid type
|
||||||
* Removed ammo duping using nitra, instead, four large piles can now be combined into an ammo container
|
* Removed ammo duping using nitra, instead, four large piles can now be combined into an ammo container
|
||||||
|
* Using a defuser, creepers can now be rendered harmless manually
|
||||||
|
* Defusing creepers now also works if the creeper hasn't lit its fuse yet
|
||||||
|
* Defused creepers are now permanently harmless, they can no longer be manually re-ignited at all
|
||||||
|
* Manual defusers now also affect big man johnson
|
||||||
|
* The glpyhid will explode instantly, but only about as powerful as a conventional rocket, not destroying blocks
|
||||||
|
* Doing so will also drop one usable demolition mini nuke
|
||||||
|
* The painsaw ability no longer plays the blood splash particle effect
|
||||||
|
* Instead, it will outright gib the target
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
* Fixed arc furnace only allowing electrodes to be inserted when the lid is down instead of up
|
* Fixed arc furnace only allowing electrodes to be inserted when the lid is down instead of up
|
||||||
@ -32,4 +40,6 @@
|
|||||||
* Fixed multi fluid ID search potentially not working on systems with a non-latin locale
|
* Fixed multi fluid ID search potentially not working on systems with a non-latin locale
|
||||||
* Fixed particle accelerator source working even if not cooled
|
* Fixed particle accelerator source working even if not cooled
|
||||||
* Fixed foundry channels being overly laggy in certain setups
|
* Fixed foundry channels being overly laggy in certain setups
|
||||||
* Fixed potential mod incompatibilities with world generation mods that use outdated forge hooks
|
* Fixed potential mod incompatibilities with world generation mods that use outdated forge hooks
|
||||||
|
* Fixed the buzzsaw not properly replanting trees using the `leaves2` block type
|
||||||
|
* Fixed creepers regaining their exploding AI task upon relog, if defused
|
||||||
@ -2,16 +2,13 @@ package com.hbm.handler.ability;
|
|||||||
|
|
||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.blocks.generic.BlockBobble.BobbleType;
|
import com.hbm.blocks.generic.BlockBobble.BobbleType;
|
||||||
import com.hbm.handler.threading.PacketThreading;
|
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
|
||||||
import com.hbm.potion.HbmPotion;
|
import com.hbm.potion.HbmPotion;
|
||||||
import com.hbm.util.ContaminationUtil;
|
import com.hbm.util.ContaminationUtil;
|
||||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||||
import com.hbm.util.ContaminationUtil.HazardType;
|
import com.hbm.util.ContaminationUtil.HazardType;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.item.EntityXPOrb;
|
import net.minecraft.entity.item.EntityXPOrb;
|
||||||
@ -22,8 +19,6 @@ import net.minecraft.entity.monster.EntitySkeleton;
|
|||||||
import net.minecraft.entity.monster.EntitySlime;
|
import net.minecraft.entity.monster.EntitySlime;
|
||||||
import net.minecraft.entity.monster.EntityZombie;
|
import net.minecraft.entity.monster.EntityZombie;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -253,7 +248,7 @@ public interface IWeaponAbility extends IBaseAbility {
|
|||||||
@Override
|
@Override
|
||||||
public void onHit(int level, World world, EntityPlayer player, Entity victim, Item tool) {
|
public void onHit(int level, World world, EntityPlayer player, Entity victim, Item tool) {
|
||||||
int divider = dividerAtLevel[level];
|
int divider = dividerAtLevel[level];
|
||||||
|
|
||||||
if(victim instanceof EntityLivingBase) {
|
if(victim instanceof EntityLivingBase) {
|
||||||
EntityLivingBase living = (EntityLivingBase) victim;
|
EntityLivingBase living = (EntityLivingBase) victim;
|
||||||
|
|
||||||
@ -264,18 +259,8 @@ public interface IWeaponAbility extends IBaseAbility {
|
|||||||
living.entityDropItem(new ItemStack(ModItems.nitra_small), 1);
|
living.entityDropItem(new ItemStack(ModItems.nitra_small), 1);
|
||||||
world.spawnEntityInWorld(new EntityXPOrb(world, living.posX, living.posY, living.posZ, 1));
|
world.spawnEntityInWorld(new EntityXPOrb(world, living.posX, living.posY, living.posZ, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(player instanceof EntityPlayerMP) {
|
ConfettiUtil.gib(living);
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
|
||||||
data.setString("type", "vanillaburst");
|
|
||||||
data.setInteger("count", count * 4);
|
|
||||||
data.setDouble("motion", 0.1D);
|
|
||||||
data.setString("mode", "blockdust");
|
|
||||||
data.setInteger("block", Block.getIdFromBlock(Blocks.redstone_block));
|
|
||||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, living.posX, living.posY + living.height * 0.5, living.posZ),
|
|
||||||
new TargetPoint(living.dimension, living.posX, living.posY, living.posZ, 50));
|
|
||||||
}
|
|
||||||
|
|
||||||
world.playSoundEffect(living.posX, living.posY + living.height * 0.5, living.posZ, "hbm:weapon.chainsaw", 0.5F, 1.0F);
|
world.playSoundEffect(living.posX, living.posY + living.height * 0.5, living.posZ, "hbm:weapon.chainsaw", 0.5F, 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3840,7 +3840,7 @@ public class ModItems {
|
|||||||
glyphid_meat_grilled = new ItemLemon(8, 0.75F, true).setPotionEffect(Potion.damageBoost.id, 180, 1, 1F).setUnlocalizedName("glyphid_meat_grilled").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":glyphid_meat_grilled");
|
glyphid_meat_grilled = new ItemLemon(8, 0.75F, true).setPotionEffect(Potion.damageBoost.id, 180, 1, 1F).setUnlocalizedName("glyphid_meat_grilled").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":glyphid_meat_grilled");
|
||||||
egg_glyphid = new Item().setUnlocalizedName("egg_glyphid").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":egg_glyphid");
|
egg_glyphid = new Item().setUnlocalizedName("egg_glyphid").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":egg_glyphid");
|
||||||
|
|
||||||
defuser = new ItemTooling(ToolType.DEFUSER, 100).setUnlocalizedName("defuser").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":defuser");
|
defuser = new ItemDefuser(ToolType.DEFUSER, 100).setUnlocalizedName("defuser").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":defuser");
|
||||||
reacher = new Item().setUnlocalizedName("reacher").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":reacher");
|
reacher = new Item().setUnlocalizedName("reacher").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":reacher");
|
||||||
bismuth_tool = new ItemAmatExtractor().setUnlocalizedName("bismuth_tool").setMaxStackSize(1).setFull3D().setCreativeTab(null).setTextureName(RefStrings.MODID + ":bismuth_tool");
|
bismuth_tool = new ItemAmatExtractor().setUnlocalizedName("bismuth_tool").setMaxStackSize(1).setFull3D().setCreativeTab(null).setTextureName(RefStrings.MODID + ":bismuth_tool");
|
||||||
meltdown_tool = new ItemDyatlov().setUnlocalizedName("meltdown_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":meltdown_tool");
|
meltdown_tool = new ItemDyatlov().setUnlocalizedName("meltdown_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":meltdown_tool");
|
||||||
|
|||||||
@ -42,30 +42,38 @@ public class ItemModDefuser extends ItemArmorMod {
|
|||||||
|
|
||||||
List<EntityCreeper> creepers = entity.worldObj.getEntitiesWithinAABB(EntityCreeper.class, entity.boundingBox.expand(5, 5, 5));
|
List<EntityCreeper> creepers = entity.worldObj.getEntitiesWithinAABB(EntityCreeper.class, entity.boundingBox.expand(5, 5, 5));
|
||||||
|
|
||||||
for(EntityCreeper creeper : creepers) {
|
for(EntityCreeper creeper : creepers) defuse(creeper, entity, true);
|
||||||
|
}
|
||||||
if(creeper.getCreeperState() == 1 || creeper.func_146078_ca()) {
|
|
||||||
creeper.setCreeperState(-1);
|
public static boolean defuse(EntityCreeper creeper, EntityLivingBase entity, boolean dropItem) {
|
||||||
creeper.getDataWatcher().updateObject(18, new Byte((byte) 0));
|
|
||||||
|
creeper.setCreeperState(-1);
|
||||||
EntityAICreeperSwell toRem = null;
|
creeper.getDataWatcher().updateObject(18, new Byte((byte) 0));
|
||||||
for(Object o : creeper.tasks.taskEntries) {
|
|
||||||
EntityAITaskEntry entry = (EntityAITaskEntry) o;
|
if(!creeper.worldObj.isRemote) {
|
||||||
|
EntityAICreeperSwell toRem = null;
|
||||||
if(entry.action instanceof EntityAICreeperSwell) {
|
for(Object o : creeper.tasks.taskEntries) {
|
||||||
toRem = (EntityAICreeperSwell) entry.action;
|
EntityAITaskEntry entry = (EntityAITaskEntry) o;
|
||||||
break;
|
|
||||||
}
|
if(entry.action instanceof EntityAICreeperSwell) {
|
||||||
|
toRem = (EntityAICreeperSwell) entry.action;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(toRem != null) {
|
|
||||||
creeper.tasks.removeTask(toRem);
|
if(toRem != null) {
|
||||||
|
creeper.tasks.removeTask(toRem);
|
||||||
|
if(dropItem) {
|
||||||
creeper.worldObj.playSoundEffect(creeper.posX, creeper.posY, creeper.posZ, "hbm:item.pinBreak", 1.0F, 1.0F);
|
creeper.worldObj.playSoundEffect(creeper.posX, creeper.posY, creeper.posZ, "hbm:item.pinBreak", 1.0F, 1.0F);
|
||||||
creeper.dropItem(ModItems.safety_fuse, 1);
|
creeper.dropItem(ModItems.safety_fuse, 1);
|
||||||
creeper.attackEntityFrom(DamageSource.causeMobDamage(entity), 1.0F);
|
creeper.attackEntityFrom(DamageSource.causeMobDamage(entity), 1.0F);
|
||||||
creeper.addPotionEffect(new PotionEffect(Potion.weakness.id, 0, 200));
|
creeper.addPotionEffect(new PotionEffect(Potion.weakness.id, 0, 200));
|
||||||
}
|
}
|
||||||
|
creeper.getEntityData().setBoolean("hfr_defused", true);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
55
src/main/java/com/hbm/items/tool/ItemDefuser.java
Normal file
55
src/main/java/com/hbm/items/tool/ItemDefuser.java
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
package com.hbm.items.tool;
|
||||||
|
|
||||||
|
import com.hbm.entity.mob.glyphid.EntityGlyphidNuclear;
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
|
||||||
|
import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon;
|
||||||
|
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||||
|
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.armor.ItemModDefuser;
|
||||||
|
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
|
||||||
|
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||||
|
|
||||||
|
import api.hbm.block.IToolable.ToolType;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.monster.EntityCreeper;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ItemDefuser extends ItemTooling {
|
||||||
|
|
||||||
|
public ItemDefuser(ToolType type, int durability) {
|
||||||
|
super(type, durability);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) {
|
||||||
|
|
||||||
|
if(entity instanceof EntityCreeper) {
|
||||||
|
return ItemModDefuser.defuse((EntityCreeper) entity, player, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entity instanceof EntityGlyphidNuclear) {
|
||||||
|
EntityGlyphidNuclear john = (EntityGlyphidNuclear) entity;
|
||||||
|
|
||||||
|
if(!player.worldObj.isRemote && john.deathTicks > 0) {
|
||||||
|
john.setDead();
|
||||||
|
|
||||||
|
ExplosionVNT vnt = new ExplosionVNT(john.worldObj, john.posX, john.posY, john.posZ, 5F, john);
|
||||||
|
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 20).setupPiercing(10F, 0.2F));
|
||||||
|
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||||
|
vnt.setSFX(new ExplosionEffectWeapon(10, 2.5F, 1F));
|
||||||
|
vnt.explode();
|
||||||
|
|
||||||
|
ConfettiUtil.gib(john);
|
||||||
|
|
||||||
|
john.entityDropItem(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_DEMO), 1.5F);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -494,6 +494,10 @@ public class ModEventHandler {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onLivingUpdate(LivingUpdateEvent event) {
|
public void onLivingUpdate(LivingUpdateEvent event) {
|
||||||
|
|
||||||
|
if(event.entityLiving instanceof EntityCreeper && event.entityLiving.getEntityData().getBoolean("hfr_defused")) {
|
||||||
|
ItemModDefuser.defuse((EntityCreeper) event.entityLiving, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
ItemStack[] prevArmor = event.entityLiving.previousEquipment;
|
ItemStack[] prevArmor = event.entityLiving.previousEquipment;
|
||||||
|
|
||||||
|
|||||||
@ -145,8 +145,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
|
|||||||
double relAngle = Math.abs(angle - rotationYawRads);
|
double relAngle = Math.abs(angle - rotationYawRads);
|
||||||
relAngle = Math.abs((relAngle + Math.PI) % (2 * Math.PI) - Math.PI);
|
relAngle = Math.abs((relAngle + Math.PI) % (2 * Math.PI) - Math.PI);
|
||||||
|
|
||||||
if(relAngle > CUT_ANGLE)
|
if(relAngle > CUT_ANGLE) continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
int x = xCoord + dx;
|
int x = xCoord + dx;
|
||||||
int y = yCoord + 1;
|
int y = yCoord + 1;
|
||||||
@ -157,8 +156,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
int meta = worldObj.getBlockMetadata(x, y, z);
|
int meta = worldObj.getBlockMetadata(x, y, z);
|
||||||
if(shouldIgnore(worldObj, x, y, z, b, meta))
|
if(shouldIgnore(worldObj, x, y, z, b, meta)) continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
state = 1;
|
state = 1;
|
||||||
break outer;
|
break outer;
|
||||||
@ -340,6 +338,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
|
|||||||
worldObj.func_147480_a(x + d[0], i, z + d[1], true);
|
worldObj.func_147480_a(x + d[0], i, z + d[1], true);
|
||||||
} else if(b instanceof BlockLeaves) {
|
} else if(b instanceof BlockLeaves) {
|
||||||
meta = worldObj.getBlockMetadata(x + d[0], i, z + d[1]) & 3;
|
meta = worldObj.getBlockMetadata(x + d[0], i, z + d[1]) & 3;
|
||||||
|
if(b == Blocks.leaves2) meta += 4;
|
||||||
worldObj.func_147480_a(x + d[0], i, z + d[1], true);
|
worldObj.func_147480_a(x + d[0], i, z + d[1], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user