X3962: Mistake Edition

v1v1v1v1v1v1v1v1v1v1v1v1v1v1v1v1v1v1v1v1
This commit is contained in:
Boblet 2021-08-16 10:14:09 +02:00
parent a58a6dfd90
commit 3eee7bfe58
9 changed files with 109 additions and 2 deletions

View File

@ -7,6 +7,9 @@ import com.hbm.packet.PacketDispatcher;
import com.hbm.potion.HbmPotion;
import com.hbm.util.ContaminationUtil;
import com.hbm.util.WeightedRandomObject;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import com.hbm.util.ContaminationUtil.ContaminationType;
import com.hbm.util.ContaminationUtil.HazardType;
@ -213,7 +216,7 @@ public abstract class WeaponAbility {
data.setDouble("motion", 0.1D);
data.setString("mode", "blockdust");
data.setInteger("block", Block.getIdFromBlock(Blocks.redstone_block));
PacketDispatcher.wrapper.sendTo(new AuxParticlePacketNT(data, living.posX, living.posY + living.height * 0.5, living.posZ), (EntityPlayerMP)player);
PacketDispatcher.wrapper.sendToAllAround(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);

View File

@ -149,7 +149,7 @@ public class AnvilRecipes {
},
new AnvilOutput(new ItemStack(ModBlocks.machine_difurnace_off))).setTier(1));
int ukModifier = 100;
int ukModifier = 1;
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {
new OreDictStack("blockGlassColorless", 4 * ukModifier),

View File

@ -2115,6 +2115,7 @@ public class ModItems {
public static Item injector_5htp;
public static Item injector_knife;
public static Item medal_liquidator;
public static Item v1;
public static Item hazmat_helmet;
public static Item hazmat_plate;
@ -3182,6 +3183,7 @@ public class ModItems {
injector_5htp = new ItemModAuto().setUnlocalizedName("injector_5htp").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":injector_5htp");
injector_knife = new ItemModKnife().setUnlocalizedName("injector_knife").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":injector_knife");
medal_liquidator = new ItemModMedal().setUnlocalizedName("medal_liquidator").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":medal_liquidator");
v1 = new ItemModV1().setUnlocalizedName("v1").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":v1");
can_empty = new Item().setUnlocalizedName("can_empty").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_empty");
can_smart = new ItemEnergy().setUnlocalizedName("can_smart").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_smart");
@ -7265,6 +7267,7 @@ public class ModItems {
GameRegistry.registerItem(coin_worm, coin_worm.getUnlocalizedName());
GameRegistry.registerItem(coin_ufo, coin_ufo.getUnlocalizedName());
GameRegistry.registerItem(medal_liquidator, medal_liquidator.getUnlocalizedName());
GameRegistry.registerItem(v1, v1.getUnlocalizedName());
//Chaos
GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName());

View File

@ -0,0 +1,30 @@
package com.hbm.items.armor;
import java.util.List;
import com.hbm.handler.ArmorModHandler;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class ItemModV1 extends ItemArmorMod {
public ItemModV1() {
super(ArmorModHandler.extra, false, true, false, false);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add(EnumChatFormatting.RED + "BLOOD IS FUEL");
list.add("");
super.addInformation(stack, player, list, bool);
}
@Override
public void addDesc(List list, ItemStack stack, ItemStack armor) {
list.add(EnumChatFormatting.RED + " " + stack.getDisplayName() + " (BLOOD IS FUEL)");
}
}

View File

@ -45,6 +45,7 @@ import com.hbm.items.weapon.ItemGunBase;
import com.hbm.lib.Library;
import com.hbm.lib.ModDamageSource;
import com.hbm.lib.RefStrings;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.PlayerInformPacket;
import com.hbm.potion.HbmPotion;
@ -52,6 +53,7 @@ import com.hbm.saveddata.AuxSavedData;
import com.hbm.util.ArmorUtil;
import com.hbm.util.ContaminationUtil;
import com.hbm.util.EnchantmentUtil;
import com.hbm.util.EntityDamageUtil;
import com.hbm.world.generator.TimedGenerator;
import cpw.mods.fml.common.eventhandler.EventPriority;
@ -61,8 +63,10 @@ import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@ -283,6 +287,24 @@ public class ModEventHandler {
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onEntityDeathLast(LivingDeathEvent event) {
EntityLivingBase entity = event.entityLiving;
if(EntityDamageUtil.wasAttackedByV1(event.source)) {
NBTTagCompound vdat = new NBTTagCompound();
vdat.setString("type", "giblets");
vdat.setInteger("ent", entity.getEntityId());
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(vdat, entity.posX, entity.posY + entity.height * 0.5, entity.posZ), new TargetPoint(entity.dimension, entity.posX, entity.posY + entity.height * 0.5, entity.posZ, 150));
entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "mob.zombie.woodbreak", 2.0F, 0.95F + entity.worldObj.rand.nextFloat() * 0.2F);
EntityPlayer attacker = (EntityPlayer) ((EntityDamageSource)event.source).getEntity();
if(attacker.getDistanceSqToEntity(entity) < 5) {
attacker.heal(entity.prevHealth * 2F);
}
}
if(event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
@ -702,6 +724,24 @@ public class ModEventHandler {
if(HbmLivingProps.getContagion(e) > 0 && event.ammount < 100)
event.ammount *= 2F;
/// V1 ///
if(EntityDamageUtil.wasAttackedByV1(event.source)) {
EntityPlayer attacker = (EntityPlayer) ((EntityDamageSource)event.source).getEntity();
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaburst");
data.setInteger("count", (int)Math.min(e.getMaxHealth() / 2F, 250));
data.setDouble("motion", 0.1D);
data.setString("mode", "blockdust");
data.setInteger("block", Block.getIdFromBlock(Blocks.redstone_block));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, e.posX, e.posY + e.height * 0.5, e.posZ), new TargetPoint(e.dimension, e.posX, e.posY, e.posZ, 50));
if(attacker.getDistanceSqToEntity(e) < 3) {
attacker.heal(event.ammount * 0.5F);
}
}
/// ARMOR MODS ///
for(int i = 1; i < 5; i++) {
ItemStack armor = e.getEquipmentInSlot(i);
@ -717,6 +757,7 @@ public class ModEventHandler {
}
}
/// FSB ARMOR ///
if(e instanceof EntityPlayer && ((EntityPlayer)e).inventory.armorInventory[2] != null && ((EntityPlayer)e).inventory.armorInventory[2].getItem() instanceof ArmorFSB)
((ArmorFSB)((EntityPlayer)e).inventory.armorInventory[2].getItem()).handleHurt(event);
}

View File

@ -2,10 +2,16 @@ package com.hbm.util;
import java.lang.reflect.Field;
import com.hbm.handler.ArmorModHandler;
import com.hbm.items.ModItems;
import cpw.mods.fml.relauncher.ReflectionHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSource;
public class EntityDamageUtil {
@ -36,4 +42,26 @@ public class EntityDamageUtil {
return 0F;
}
}
public static boolean wasAttackedByV1(DamageSource source) {
if(source instanceof EntityDamageSource) {
Entity attacker = ((EntityDamageSource) source).getEntity();
if(attacker instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) attacker;
ItemStack chestplate = player.inventory.armorInventory[2];
if(chestplate != null && ArmorModHandler.hasMods(chestplate)) {
ItemStack[] mods = ArmorModHandler.pryMods(chestplate);
if(mods[ArmorModHandler.extra] != null && mods[ArmorModHandler.extra].getItem() == ModItems.v1) {
return true;
}
}
}
}
return false;
}
}

View File

@ -2454,6 +2454,7 @@ item.upgrade_speed_1.name=Geschwindigkeitsupgrade Mk.I
item.upgrade_speed_2.name=Geschwindigkeitsupgrade Mk.II
item.upgrade_speed_3.name=Geschwindigkeitsupgrade Mk.III
item.upgrade_template.name=Maschinenupgrade-Vorlage
item.v1.name=V1
item.wand_d.name=Debug-Zauberstab
item.wand_k.name=Konstruktions-Zauberstab
item.wand_s.name=Struktur-Zauberstab

View File

@ -2520,6 +2520,7 @@ item.upgrade_speed_1.name=Speed Upgrade Mk.I
item.upgrade_speed_2.name=Speed Upgrade Mk.II
item.upgrade_speed_3.name=Speed Upgrade Mk.III
item.upgrade_template.name=Machine Upgrade Template
item.v1.name=V1
item.wand_d.name=Debug Wand
item.wand_k.name=Construction Wand
item.wand_s.name=Structure Wand

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B