Merge branch 'HbmMods:master' into master
@ -102,6 +102,13 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
// add AT to meta-inf
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'FMLAT': 'HBM_at.cfg'
|
||||
}
|
||||
}
|
||||
|
||||
task version {
|
||||
doFirst {
|
||||
println project.version
|
||||
|
||||
@ -1,6 +1,13 @@
|
||||
package api.hbm.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IToolable {
|
||||
@ -12,6 +19,29 @@ public interface IToolable {
|
||||
HAND_DRILL,
|
||||
DEFUSER,
|
||||
WRENCH,
|
||||
TORCH
|
||||
TORCH,
|
||||
BOLT;
|
||||
|
||||
public List<ItemStack> stacksForDisplay = new ArrayList();
|
||||
private static HashMap<ComparableStack, ToolType> map = new HashMap();
|
||||
|
||||
public void register(ItemStack stack) {
|
||||
stacksForDisplay.add(stack);
|
||||
}
|
||||
|
||||
public static ToolType getType(ItemStack stack) {
|
||||
|
||||
if(!map.isEmpty()) {
|
||||
return map.get(new ComparableStack(stack));
|
||||
}
|
||||
|
||||
for(ToolType type : ToolType.values()) {
|
||||
for(ItemStack tool : type.stacksForDisplay) {
|
||||
map.put(new ComparableStack(tool), type);
|
||||
}
|
||||
}
|
||||
|
||||
return map.get(new ComparableStack(stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockEnumMulti extends BlockMulti {
|
||||
@ -38,6 +41,16 @@ public class BlockEnumMulti extends BlockMulti {
|
||||
}
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
|
||||
if(this.multiName) {
|
||||
Enum num = EnumUtil.grabEnumSafely(this.theEnum, stack.getItemDamage());
|
||||
return super.getUnlocalizedName() + "." + num.name().toLowerCase();
|
||||
}
|
||||
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
|
||||
@ -31,4 +31,8 @@ public abstract class BlockMulti extends BlockBase implements IBlockMulti {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1980,8 +1980,8 @@ public class ModBlocks {
|
||||
|
||||
watz_element = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_element_top").setBlockName("watz_element").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_element_side");
|
||||
watz_control = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_control_top").setBlockName("watz_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_control_side");
|
||||
watz_cooler = new BlockGeneric(Material.iron).setBlockName("watz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_cooler");
|
||||
watz_end = new BlockGeneric(Material.iron).setBlockName("watz_end").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_casing");
|
||||
watz_cooler = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_cooler_top").setBlockName("watz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_cooler_side");
|
||||
watz_end = new BlockToolConversion(Material.iron).addVariant("_bolted").setBlockName("watz_end").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_casing");
|
||||
watz_hatch = new WatzHatch(Material.iron).setBlockName("watz_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_hatch");
|
||||
watz_conductor = new BlockCableConnect(Material.iron).setBlockName("watz_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_conductor_top");
|
||||
watz_core = new WatzCore(Material.iron).setBlockName("watz_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_computer");
|
||||
@ -3263,7 +3263,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(watz_element, watz_element.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_control, watz_control.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_cooler, watz_cooler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_end, watz_end.getUnlocalizedName());
|
||||
register(watz_end);
|
||||
GameRegistry.registerBlock(watz_hatch, watz_hatch.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_conductor, watz_conductor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_core, watz_core.getUnlocalizedName());
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.mob.EntityTaintCrab;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperTainted;
|
||||
import com.hbm.entity.mob.EntityTeslaCrab;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
@ -186,7 +186,7 @@ public class BlockTaint extends Block/*Container*/ {
|
||||
}
|
||||
|
||||
if(entity instanceof EntityCreeper) {
|
||||
EntityTaintedCreeper creep = new EntityTaintedCreeper(world);
|
||||
EntityCreeperTainted creep = new EntityCreeperTainted(world);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
@ -45,6 +45,11 @@ public class BlockStalagmite extends BlockEnumMulti {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getMetaFromResource(int meta) {
|
||||
return meta;
|
||||
|
||||
177
src/main/java/com/hbm/blocks/generic/BlockToolConversion.java
Normal file
@ -0,0 +1,177 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockToolConversion extends BlockMulti implements IToolable, ILookOverlay {
|
||||
|
||||
public IIcon[] icons;
|
||||
public String[] names;
|
||||
|
||||
public BlockToolConversion(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
public BlockToolConversion addVariant(String... name) {
|
||||
this.names = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
|
||||
if(names != null) {
|
||||
icons = new IIcon[names.length];
|
||||
for(int i = 0; i < names.length; i++) {
|
||||
icons[i] = iconRegister.registerIcon(getTextureName() + names[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
|
||||
int meta = stack.getItemDamage() - 1;
|
||||
|
||||
if(meta == -1 || names == null || meta >= names.length) {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
return this.getUnlocalizedName() + names[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
|
||||
metadata -= 1;
|
||||
|
||||
if(metadata == -1 || icons == null || metadata >= icons.length) {
|
||||
return super.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
return icons[metadata];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
|
||||
if(world.isRemote) return false;
|
||||
|
||||
Pair<AStack[], MetaBlock> result = conversions.get(new Pair(tool, new MetaBlock(this, world.getBlockMetadata(x, y, z))));
|
||||
|
||||
if(result == null) return false;
|
||||
|
||||
List<AStack> list = new ArrayList();
|
||||
for(AStack stack : result.key) list.add(stack);
|
||||
|
||||
if(list == null || list.isEmpty() || InventoryUtil.doesPlayerHaveAStacks(player, list, true)) {
|
||||
world.setBlock(x, y, z, result.value.block, result.value.meta, 3);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem();
|
||||
if(held == null) return;
|
||||
ToolType tool = this.quickLookup(held);
|
||||
if(tool == null) return;
|
||||
|
||||
Pair<AStack[], MetaBlock> result = conversions.get(new Pair(tool, new MetaBlock(this, world.getBlockMetadata(x, y, z))));
|
||||
|
||||
if(result == null) return;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.GOLD + "Requires:");
|
||||
List<AStack> materials = new ArrayList();
|
||||
for(AStack stack : result.key) materials.add(stack);
|
||||
|
||||
List<ItemStack> tools = tool.stacksForDisplay;
|
||||
ItemStack displayTool = tools.get((int) (Math.abs(System.currentTimeMillis() / 1000) % tools.size()));
|
||||
text.add(EnumChatFormatting.BLUE + "- " + displayTool.getDisplayName());
|
||||
|
||||
for(AStack stack : materials) {
|
||||
try {
|
||||
ItemStack display = stack.extractForCyclingDisplay(20);
|
||||
text.add("- " + display.getDisplayName() + " x" + display.stackSize);
|
||||
} catch(Exception ex) {
|
||||
text.add(EnumChatFormatting.RED + "- ERROR");
|
||||
}
|
||||
}
|
||||
|
||||
if(!materials.isEmpty()) {
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(this.getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSubCount() {
|
||||
return names != null ? names.length + 1 : 1;
|
||||
}
|
||||
|
||||
public static ToolType quickLookup(ItemStack stack) {
|
||||
return ToolType.getType(stack);
|
||||
}
|
||||
|
||||
public static HashMap<Pair<ToolType, MetaBlock>, Pair<AStack[], MetaBlock>> conversions = new HashMap();
|
||||
|
||||
public static void registerRecipes() {
|
||||
conversions.put(new Pair(ToolType.BOLT, new MetaBlock(ModBlocks.watz_end, 0)), new Pair(new AStack[] {new ComparableStack(ModItems.bolt_dura_steel, 4)}, new MetaBlock(ModBlocks.watz_end, 1)));
|
||||
}
|
||||
|
||||
public static HashMap<Object[], Object> bufferedRecipes = new HashMap();
|
||||
public static HashMap<Object[], Object> bufferedTools = new HashMap();
|
||||
|
||||
public static HashMap<Object[], Object> getRecipes(boolean recipes) {
|
||||
|
||||
if(!bufferedRecipes.isEmpty()) return recipes ? bufferedRecipes : bufferedTools;
|
||||
|
||||
for(Entry<Pair<ToolType, MetaBlock>, Pair<AStack[], MetaBlock>> entry : conversions.entrySet()) {
|
||||
|
||||
List<AStack> list = new ArrayList();
|
||||
|
||||
for(AStack stack : entry.getValue().getKey()) {
|
||||
list.add(stack);
|
||||
}
|
||||
list.add(new ComparableStack(entry.getKey().getValue().block, 1, entry.getKey().getValue().meta));
|
||||
|
||||
Object[] inputInstance = list.toArray(new AStack[0]); // the instance has to match for the machine lookup to succeed
|
||||
bufferedRecipes.put(inputInstance, new ItemStack(entry.getValue().getValue().block, 1, entry.getValue().getValue().meta));
|
||||
bufferedTools.put(inputInstance, entry.getKey().getKey().stacksForDisplay.toArray(new ItemStack[0]));
|
||||
}
|
||||
|
||||
return recipes ? bufferedRecipes : bufferedTools;
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,17 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityWatz;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -71,4 +76,21 @@ public class Watz extends BlockDummyable {
|
||||
this.makeExtra(world, x, y + 2, z - 2);
|
||||
this.makeExtra(world, x, y + 2, z);
|
||||
}
|
||||
|
||||
public static boolean drop = true;
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i) {
|
||||
|
||||
if(i >= 12 && drop) {
|
||||
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.watz_end, 48)));
|
||||
for(int j = 0; j < 3; j++) world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.bolt_dura_steel, 64)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.watz_element, 36)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.watz_cooler, 26)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_watz_core, 1)));
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,12 +181,12 @@ public class MineralRecipes {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_pu238be, 6), new Object[] { ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_beryllium, ModItems.billet_beryllium, ModItems.billet_beryllium }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_ra226be, 6), new Object[] { ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_beryllium, ModItems.billet_beryllium, ModItems.billet_beryllium }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetUranium", "nuggetPlutonium241", ModItems.nugget_bismuth }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetUranium235", "nuggetPlutonium240", "nuggetPlutonium241" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetPlutonium241", "nuggetPlutonium241", "nuggetAmericiumRG" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 6), new Object[] { ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_uranium, ModItems.billet_pu241, ModItems.billet_bismuth }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 6), new Object[] { ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_u235, ModItems.billet_pu240, ModItems.billet_pu241 }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 6), new Object[] { ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_zirconium, ModItems.billet_pu241, ModItems.billet_pu241, ModItems.billet_am_mix }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 1), new Object[] { ZR.nugget(), ZR.nugget(), ZR.nugget(), U.nugget(), PU241.nugget(), BI.nugget() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 1), new Object[] { ZR.nugget(), ZR.nugget(), ZR.nugget(), U235.nugget(), PU240.nugget(), PU241.nugget() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 1), new Object[] { ZR.nugget(), ZR.nugget(), ZR.nugget(), PU241.nugget(), PU241.nugget(), AMRG.nugget() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 6), new Object[] { ZR.billet(), ZR.billet(), ZR.billet(), U.billet(), PU241.billet(), BI.billet() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 6), new Object[] { ZR.billet(), ZR.billet(), ZR.billet(), U235.billet(), PU240.billet(), PU241.billet() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 6), new Object[] { ZR.billet(), ZR.billet(), ZR.billet(), PU241.billet(), PU241.billet(), AMRG.billet() }));
|
||||
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_uranium, 2), new Object[] { ModItems.billet_uranium_fuel, ModItems.billet_u238 });
|
||||
@ -224,16 +224,16 @@ public class MineralRecipes {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_balefire_gold, 1), new Object[] { ModItems.billet_au198, ModItems.cell_antimatter, ModItems.pellet_charged });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_flashlead, 2), new Object[] { ModItems.billet_balefire_gold, ModItems.billet_pb209, ModItems.cell_antimatter });
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg), new Object[] { ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_pu238, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_radium), new Object[] { ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_ra226, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_weak), new Object[] { ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_pu238, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_strontium), new Object[] { ModItems.billet_sr90, ModItems.billet_sr90, ModItems.billet_sr90, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_cobalt), new Object[] { ModItems.billet_co60, ModItems.billet_co60, ModItems.billet_co60, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_actinium), new Object[] { ModItems.billet_actinium, ModItems.billet_actinium, ModItems.billet_actinium, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_polonium), new Object[] { ModItems.billet_polonium, ModItems.billet_polonium, ModItems.billet_polonium, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_lead), new Object[] { ModItems.billet_pb209, ModItems.billet_pb209, ModItems.billet_pb209, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_gold), new Object[] { ModItems.billet_au198, ModItems.billet_au198, ModItems.billet_au198, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_americium), new Object[] { ModItems.billet_am241, ModItems.billet_am241, ModItems.billet_am241, "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg), new Object[] { ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_pu238, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_radium), new Object[] { ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_ra226, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_weak), new Object[] { ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_pu238, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_strontium), new Object[] { ModItems.billet_sr90, ModItems.billet_sr90, ModItems.billet_sr90, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_cobalt), new Object[] { ModItems.billet_co60, ModItems.billet_co60, ModItems.billet_co60, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_actinium), new Object[] { ModItems.billet_actinium, ModItems.billet_actinium, ModItems.billet_actinium, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_polonium), new Object[] { ModItems.billet_polonium, ModItems.billet_polonium, ModItems.billet_polonium, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_lead), new Object[] { ModItems.billet_pb209, ModItems.billet_pb209, ModItems.billet_pb209, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_gold), new Object[] { ModItems.billet_au198, ModItems.billet_au198, ModItems.billet_au198, IRON.plate() }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_americium), new Object[] { ModItems.billet_am241, ModItems.billet_am241, ModItems.billet_am241, IRON.plate() }));
|
||||
|
||||
//There's no need for anvil recycling recipes if you simply set the container item
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_bismuth, 3), new Object[] { new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.BISMUTH.ordinal()) });
|
||||
|
||||
@ -203,9 +203,11 @@ public class EntityMappings {
|
||||
addEntity(EntityCog.class, "entity_stray_cog", 1000);
|
||||
addEntity(EntitySawblade.class, "entity_stray_saw", 1000);
|
||||
addEntity(EntityChemical.class, "entity_chemthrower_splash", 1000);
|
||||
addEntity(EntityMist.class, "entity_mist", 1000);
|
||||
|
||||
addMob(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);
|
||||
addMob(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
|
||||
addMob(EntityCreeperNuclear.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);
|
||||
addMob(EntityCreeperTainted.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
|
||||
addMob(EntityCreeperPhosgene.class, "entity_mob_phosgene_creeper", 0xE3D398, 0xB8A06B);
|
||||
addMob(EntityHunterChopper.class, "entity_mob_hunter_chopper", 0x000020, 0x2D2D72);
|
||||
addMob(EntityCyberCrab.class, "entity_cyber_crab", 0xAAAAAA, 0x444444);
|
||||
addMob(EntityTeslaCrab.class, "entity_tesla_crab", 0xAAAAAA, 0x440000);
|
||||
|
||||
@ -1,28 +1,58 @@
|
||||
package com.hbm.entity.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.trait.FT_Corrosive;
|
||||
import com.hbm.inventory.fluid.trait.FT_Flammable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Poison;
|
||||
import com.hbm.inventory.fluid.trait.FT_Toxin;
|
||||
import com.hbm.inventory.fluid.trait.FT_VentRadiation;
|
||||
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Gaseous;
|
||||
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Gaseous_ART;
|
||||
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Liquid;
|
||||
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Viscous;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.EntityDamageUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityMist extends Entity {
|
||||
|
||||
public EntityMist(World world) {
|
||||
super(world);
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
public EntityMist setArea(float width, float height) {
|
||||
this.dataWatcher.updateObject(11, width);
|
||||
this.dataWatcher.updateObject(12, height);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(10, new Integer(0));
|
||||
this.dataWatcher.addObject(11, new Float(0));
|
||||
this.dataWatcher.addObject(12, new Float(0));
|
||||
}
|
||||
|
||||
public EntityMist setFluid(FluidType fluid) {
|
||||
public EntityMist setType(FluidType fluid) {
|
||||
this.dataWatcher.updateObject(10, fluid.getID());
|
||||
return this;
|
||||
}
|
||||
@ -30,15 +60,138 @@ public class EntityMist extends Entity {
|
||||
public FluidType getType() {
|
||||
return Fluids.fromID(this.dataWatcher.getWatchableObjectInt(10));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEntityUpdate() {
|
||||
|
||||
float height = this.dataWatcher.getWatchableObjectFloat(12);
|
||||
this.yOffset = -height / 2F;
|
||||
this.setSize(this.dataWatcher.getWatchableObjectFloat(11), height);
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(this.ticksExisted > this.getMaxAge()) {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
FluidType type = this.getType();
|
||||
|
||||
if(type.hasTrait(FT_VentRadiation.class)) {
|
||||
FT_VentRadiation trait = type.getTrait(FT_VentRadiation.class);
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, (int) Math.floor(posX), (int) Math.floor(posY), (int) Math.floor(posZ), trait.getRadPerMB() * 2);
|
||||
}
|
||||
|
||||
double intensity = 1D - (double) this.ticksExisted / (double) this.getMaxAge();
|
||||
|
||||
if(type.hasTrait(FT_Flammable.class) && this.isBurning()) {
|
||||
worldObj.createExplosion(this, posX, posY + height / 2, posZ, (float) intensity * 15F, true);
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
List<Entity> affected = worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox);
|
||||
|
||||
for(Entity e : affected) {
|
||||
this.affect(e, intensity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* can't reuse EntityChemical here, while similar or identical in some places, the actual effects are often different */
|
||||
protected void affect(Entity e, double intensity) {
|
||||
|
||||
FluidType type = this.getType();
|
||||
EntityLivingBase living = e instanceof EntityLivingBase ? (EntityLivingBase) e : null;
|
||||
|
||||
if(type.temperature >= 100) {
|
||||
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, new DamageSource(ModDamageSource.s_boil), 5F + (type.temperature - 100) * 0.02F);
|
||||
|
||||
if(type.temperature >= 500) {
|
||||
e.setFire(10); //afterburn for 10 seconds
|
||||
}
|
||||
}
|
||||
if(type.temperature < -20) {
|
||||
if(living != null) { //only living things are affected
|
||||
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, new DamageSource(ModDamageSource.s_cryolator), 5F + (type.temperature + 20) * -0.05F); //5 damage at -20°C with one extra damage every -20°C
|
||||
living.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2));
|
||||
living.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 100, 4));
|
||||
}
|
||||
}
|
||||
|
||||
if(type.hasTrait(Fluids.DELICIOUS.getClass())) {
|
||||
if(living != null && living.isEntityAlive()) {
|
||||
living.heal(2F * (float) intensity);
|
||||
}
|
||||
}
|
||||
|
||||
if(type.hasTrait(FT_Flammable.class) && type.hasTrait(FT_Liquid.class)) {
|
||||
if(living != null) {
|
||||
HbmLivingProps.setOil(living, 200); //doused in oil for 10 seconds
|
||||
}
|
||||
}
|
||||
|
||||
if(this.isExtinguishing(type)) {
|
||||
e.extinguish();
|
||||
}
|
||||
|
||||
if(type.hasTrait(FT_Corrosive.class)) {
|
||||
FT_Corrosive trait = type.getTrait(FT_Corrosive.class);
|
||||
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, new DamageSource(ModDamageSource.s_acid), trait.getRating() / 20F);
|
||||
|
||||
if(living != null) {
|
||||
for(int i = 0; i < 4; i++) {
|
||||
ArmorUtil.damageSuit(living, i, trait.getRating() / 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(type.hasTrait(FT_VentRadiation.class)) {
|
||||
FT_VentRadiation trait = type.getTrait(FT_VentRadiation.class);
|
||||
if(living != null) {
|
||||
ContaminationUtil.contaminate(living, HazardType.RADIATION, ContaminationType.CREATIVE, trait.getRadPerMB() * 5);
|
||||
}
|
||||
}
|
||||
|
||||
if(type.hasTrait(FT_Poison.class)) {
|
||||
FT_Poison trait = type.getTrait(FT_Poison.class);
|
||||
|
||||
if(living != null) {
|
||||
living.addPotionEffect(new PotionEffect(trait.isWithering() ? Potion.wither.id : Potion.poison.id, (int) (5 * 20 * intensity)));
|
||||
}
|
||||
}
|
||||
|
||||
if(type.hasTrait(FT_Toxin.class)) {
|
||||
FT_Toxin trait = type.getTrait(FT_Toxin.class);
|
||||
|
||||
if(living != null) {
|
||||
trait.affect(living, intensity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isExtinguishing(FluidType type) {
|
||||
return this.getStyleFromType(type) == SprayStyle.MIST && this.getType().temperature < 50 && !type.hasTrait(FT_Flammable.class);
|
||||
}
|
||||
|
||||
public int getMaxAge() {
|
||||
return getStyleFromType(this.getType()) == SprayStyle.GAS ? 600 : 150;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
this.setType(Fluids.fromID(nbt.getInteger("type")));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
|
||||
nbt.setInteger("type", this.getType().getID());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean canRenderOnFire() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static SprayStyle getStyleFromType(FluidType type) {
|
||||
|
||||
137
src/main/java/com/hbm/entity/mob/EntityCreeperNuclear.java
Normal file
@ -0,0 +1,137 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCreeperNuclear extends EntityCreeper {
|
||||
|
||||
public EntityCreeperNuclear(World world) {
|
||||
super(world);
|
||||
this.fuseTime = 75;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
|
||||
// for some reason the nuclear explosion would damage the already dead entity, reviving it and forcing it to play the death animation
|
||||
if(this.isDead) return false;
|
||||
|
||||
if(source == ModDamageSource.radiation || source == ModDamageSource.mudPoisoning) {
|
||||
if(this.isEntityAlive()) this.heal(amount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem() {
|
||||
return Item.getItemFromBlock(Blocks.tnt);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
|
||||
|
||||
super.dropFewItems(p_70628_1_, p_70628_2_);
|
||||
|
||||
if(rand.nextInt(3) == 0)
|
||||
this.dropItem(ModItems.coin_creeper, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(50, 50, 50));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
player.triggerAchievement(MainRegistry.bossCreeper);
|
||||
}
|
||||
|
||||
if(p_70645_1_.getEntity() instanceof EntitySkeleton || (p_70645_1_.isProjectile() && p_70645_1_.getEntity() instanceof EntityArrow && ((EntityArrow) (p_70645_1_.getEntity())).shootingEntity == null)) {
|
||||
this.entityDropItem(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.STOCK), 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(5, 5, 5));
|
||||
|
||||
for(Entity e : list) {
|
||||
if(e instanceof EntityLivingBase) {
|
||||
ContaminationUtil.contaminate((EntityLivingBase) e, HazardType.RADIATION, ContaminationType.CREATIVE, 0.25F);
|
||||
}
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if(this.isEntityAlive() && this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
if(!this.worldObj.isRemote) {
|
||||
|
||||
this.setDead();
|
||||
|
||||
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
if(this.getPowered()) {
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "muke");
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250));
|
||||
worldObj.playSoundEffect(posX, posY + 0.5, posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
||||
|
||||
if(flag) {
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, 50, posX, posY, posZ).mute());
|
||||
} else {
|
||||
ExplosionNukeGeneric.dealDamage(worldObj, posX, posY + 0.5, posZ, 100);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(flag) {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_MEDIUM);
|
||||
} else {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_SAFE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
42
src/main/java/com/hbm/entity/mob/EntityCreeperPhosgene.java
Normal file
@ -0,0 +1,42 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.entity.effect.EntityMist;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCreeperPhosgene extends EntityCreeper {
|
||||
|
||||
public EntityCreeperPhosgene(World world) {
|
||||
super(world);
|
||||
this.fuseTime = 20; //ehehehehehe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
|
||||
if(!source.isDamageAbsolute() && !source.isUnblockable()) {
|
||||
amount -= 4F;
|
||||
}
|
||||
|
||||
if(amount < 0) return false;
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
EntityMist mist = new EntityMist(worldObj);
|
||||
mist.setType(Fluids.PHOSGENE);
|
||||
mist.setPosition(posX, posY, posZ);
|
||||
mist.setArea(10, 5);
|
||||
worldObj.spawnEntityInWorld(mist);
|
||||
}
|
||||
}
|
||||
}
|
||||
100
src/main/java/com/hbm/entity/mob/EntityCreeperTainted.java
Normal file
@ -0,0 +1,100 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
|
||||
import api.hbm.entity.IRadiationImmune;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCreeperTainted extends EntityCreeper implements IRadiationImmune {
|
||||
|
||||
public EntityCreeperTainted(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(this.isEntityAlive()) {
|
||||
|
||||
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem() {
|
||||
return Item.getItemFromBlock(Blocks.tnt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
if(!this.worldObj.isRemote) {
|
||||
boolean griefing = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
worldObj.newExplosion(this, posX, posY, posZ, 5.0F, false, false);
|
||||
|
||||
if(griefing) {
|
||||
if(this.getPowered()) {
|
||||
|
||||
for(int i = 0; i < 255; i++) {
|
||||
int a = rand.nextInt(15) + (int) posX - 7;
|
||||
int b = rand.nextInt(15) + (int) posY - 7;
|
||||
int c = rand.nextInt(15) + (int) posZ - 7;
|
||||
|
||||
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) {
|
||||
if(!GeneralConfig.enableHardcoreTaint) {
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2);
|
||||
} else {
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
for(int i = 0; i < 85; i++) {
|
||||
int a = rand.nextInt(7) + (int) posX - 3;
|
||||
int b = rand.nextInt(7) + (int) posY - 3;
|
||||
int c = rand.nextInt(7) + (int) posZ - 3;
|
||||
|
||||
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) {
|
||||
if(!GeneralConfig.enableHardcoreTaint) {
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2);
|
||||
} else {
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasPosNeightbour(World world, int x, int y, int z) {
|
||||
Block b0 = world.getBlock(x + 1, y, z);
|
||||
Block b1 = world.getBlock(x, y + 1, z);
|
||||
Block b2 = world.getBlock(x, y, z + 1);
|
||||
Block b3 = world.getBlock(x - 1, y, z);
|
||||
Block b4 = world.getBlock(x, y - 1, z);
|
||||
Block b5 = world.getBlock(x, y, z - 1);
|
||||
boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) || (b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) || (b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) || (b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) || (b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) || (b5.renderAsNormalBlock() && b5.getMaterial().isOpaque());
|
||||
return b;
|
||||
}
|
||||
}
|
||||
@ -27,7 +27,7 @@ public class EntityCyberCrab extends EntityMob implements IRangedAttackMob, IRad
|
||||
|
||||
private static final IEntitySelector selector = new IEntitySelector() {
|
||||
public boolean isEntityApplicable(Entity p_82704_1_) {
|
||||
return !(p_82704_1_ instanceof EntityCyberCrab || p_82704_1_ instanceof EntityCreeper || p_82704_1_ instanceof EntityNuclearCreeper);
|
||||
return !(p_82704_1_ instanceof EntityCyberCrab || p_82704_1_ instanceof EntityCreeper);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,349 +0,0 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.entity.mob.ai.EntityAINuclearCreeperSwell;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
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.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityNuclearCreeper extends EntityMob {
|
||||
|
||||
private int lastActiveTime;
|
||||
private int timeSinceIgnited;
|
||||
private int fuseTime = 75;
|
||||
|
||||
public EntityNuclearCreeper(World p_i1733_1_) {
|
||||
super(p_i1733_1_);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, new EntityAINuclearCreeperSwell(this));
|
||||
this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 0.8D));
|
||||
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(6, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
|
||||
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
|
||||
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityOcelot.class, 0, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
|
||||
if(source == ModDamageSource.radiation || source == ModDamageSource.mudPoisoning) {
|
||||
this.heal(amount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAIEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSafePointTries() {
|
||||
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fall(float p_70069_1_) {
|
||||
super.fall(p_70069_1_);
|
||||
this.timeSinceIgnited = (int) (this.timeSinceIgnited + p_70069_1_ * 1.5F);
|
||||
|
||||
if(this.timeSinceIgnited > this.fuseTime - 5) {
|
||||
this.timeSinceIgnited = this.fuseTime - 5;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte) -1));
|
||||
this.dataWatcher.addObject(17, Byte.valueOf((byte) 0));
|
||||
this.dataWatcher.addObject(18, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
super.writeEntityToNBT(p_70014_1_);
|
||||
|
||||
if(this.dataWatcher.getWatchableObjectByte(17) == 1) {
|
||||
p_70014_1_.setBoolean("powered", true);
|
||||
}
|
||||
|
||||
p_70014_1_.setShort("Fuse", (short) this.fuseTime);
|
||||
p_70014_1_.setBoolean("ignited", this.func_146078_ca());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
super.readEntityFromNBT(p_70037_1_);
|
||||
this.dataWatcher.updateObject(17, Byte.valueOf((byte) (p_70037_1_.getBoolean("powered") ? 1 : 0)));
|
||||
|
||||
if(p_70037_1_.hasKey("Fuse", 99)) {
|
||||
this.fuseTime = p_70037_1_.getShort("Fuse");
|
||||
}
|
||||
|
||||
if(p_70037_1_.getBoolean("ignited")) {
|
||||
this.func_146079_cb();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if(this.isDead) {
|
||||
this.isDead = false;
|
||||
this.heal(10.0F);
|
||||
}
|
||||
|
||||
if(this.isEntityAlive()) {
|
||||
this.lastActiveTime = this.timeSinceIgnited;
|
||||
|
||||
if(this.func_146078_ca()) {
|
||||
this.setCreeperState(1);
|
||||
}
|
||||
|
||||
int i = this.getCreeperState();
|
||||
|
||||
if(i > 0 && this.timeSinceIgnited == 0) {
|
||||
this.playSound("creeper.primed", 1.0F * 30 / 75, 0.5F);
|
||||
}
|
||||
|
||||
this.timeSinceIgnited += i;
|
||||
|
||||
if(this.timeSinceIgnited < 0) {
|
||||
this.timeSinceIgnited = 0;
|
||||
}
|
||||
|
||||
if(this.timeSinceIgnited >= this.fuseTime) {
|
||||
this.timeSinceIgnited = this.fuseTime;
|
||||
this.func_146077_cc();
|
||||
}
|
||||
}
|
||||
|
||||
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
|
||||
|
||||
for(Entity e : list)
|
||||
if(e instanceof EntityLivingBase) {
|
||||
ContaminationUtil.contaminate((EntityLivingBase) e, HazardType.RADIATION, ContaminationType.CREATIVE, 0.25F);
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getHurtSound() {
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDeathSound() {
|
||||
return "mob.creeper.death";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(50, 50, 50));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
player.triggerAchievement(MainRegistry.bossCreeper);
|
||||
}
|
||||
|
||||
if(p_70645_1_.getEntity() instanceof EntitySkeleton || (p_70645_1_.isProjectile() && p_70645_1_.getEntity() instanceof EntityArrow && ((EntityArrow) (p_70645_1_.getEntity())).shootingEntity == null)) {
|
||||
int i = rand.nextInt(11);
|
||||
int j = rand.nextInt(3);
|
||||
if(i == 0)
|
||||
this.dropItem(ModItems.nugget_u235, j);
|
||||
if(i == 1)
|
||||
this.dropItem(ModItems.nugget_pu238, j);
|
||||
if(i == 2)
|
||||
this.dropItem(ModItems.nugget_pu239, j);
|
||||
if(i == 3)
|
||||
this.dropItem(ModItems.nugget_neptunium, j);
|
||||
if(i == 4)
|
||||
this.dropItem(ModItems.man_core, 1);
|
||||
if(i == 5) {
|
||||
this.dropItem(ModItems.sulfur, j * 2);
|
||||
this.dropItem(ModItems.niter, j * 2);
|
||||
}
|
||||
if(i == 6)
|
||||
this.dropItem(ModItems.syringe_awesome, 1);
|
||||
if(i == 7)
|
||||
this.dropItem(ModItems.fusion_core, 1);
|
||||
if(i == 8)
|
||||
this.dropItem(ModItems.syringe_metal_stimpak, 1);
|
||||
if(i == 9) {
|
||||
switch(rand.nextInt(4)) {
|
||||
case 0:
|
||||
this.dropItem(ModItems.t45_helmet, 1);
|
||||
break;
|
||||
case 1:
|
||||
this.dropItem(ModItems.t45_plate, 1);
|
||||
break;
|
||||
case 2:
|
||||
this.dropItem(ModItems.t45_legs, 1);
|
||||
break;
|
||||
case 3:
|
||||
this.dropItem(ModItems.t45_boots, 1);
|
||||
break;
|
||||
}
|
||||
this.dropItem(ModItems.fusion_core, 1);
|
||||
}
|
||||
if(i == 10)
|
||||
this.entityDropItem(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH), 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity p_70652_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean getPowered() {
|
||||
return this.dataWatcher.getWatchableObjectByte(17) == 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getCreeperFlashIntensity(float p_70831_1_) {
|
||||
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem() {
|
||||
return Item.getItemFromBlock(Blocks.tnt);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
|
||||
|
||||
super.dropFewItems(p_70628_1_, p_70628_2_);
|
||||
|
||||
if(rand.nextInt(3) == 0)
|
||||
this.dropItem(ModItems.coin_creeper, 1);
|
||||
}
|
||||
|
||||
public int getCreeperState() {
|
||||
return this.dataWatcher.getWatchableObjectByte(16);
|
||||
}
|
||||
|
||||
public void setCreeperState(int p_70829_1_) {
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte) p_70829_1_));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
|
||||
super.onStruckByLightning(p_70077_1_);
|
||||
this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean interact(EntityPlayer p_70085_1_) {
|
||||
ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
|
||||
|
||||
if(itemstack != null && itemstack.getItem() == Items.flint_and_steel) {
|
||||
this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
|
||||
p_70085_1_.swingItem();
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.func_146079_cb();
|
||||
itemstack.damageItem(1, p_70085_1_);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.interact(p_70085_1_);
|
||||
}
|
||||
|
||||
private void func_146077_cc() {
|
||||
if(!this.worldObj.isRemote) {
|
||||
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
if(this.getPowered()) {
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "muke");
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250));
|
||||
worldObj.playSoundEffect(posX, posY + 0.5, posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
||||
|
||||
if(flag) {
|
||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, 50, posX, posY, posZ).mute());
|
||||
} else {
|
||||
ExplosionNukeGeneric.dealDamage(worldObj, posX, posY + 0.5, posZ, 100);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(flag) {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_MEDIUM);
|
||||
} else {
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_SAFE);
|
||||
}
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean func_146078_ca() {
|
||||
return this.dataWatcher.getWatchableObjectByte(18) != 0;
|
||||
}
|
||||
|
||||
public void func_146079_cb() {
|
||||
this.dataWatcher.updateObject(18, Byte.valueOf((byte) 1));
|
||||
}
|
||||
|
||||
public void setPowered(int power) {
|
||||
this.dataWatcher.updateObject(17, power);
|
||||
}
|
||||
}
|
||||
@ -1,286 +0,0 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.entity.mob.ai.EntityAITaintedCreeperSwell;
|
||||
|
||||
import api.hbm.entity.IRadiationImmune;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityTaintedCreeper extends EntityMob implements IRadiationImmune {
|
||||
|
||||
private int lastActiveTime;
|
||||
private int timeSinceIgnited;
|
||||
private int fuseTime = 30;
|
||||
private int explosionRadius = 20;
|
||||
|
||||
public EntityTaintedCreeper(World p_i1733_1_) {
|
||||
super(p_i1733_1_);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, new EntityAITaintedCreeperSwell(this));
|
||||
this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 0.8D));
|
||||
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(6, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
|
||||
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
|
||||
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityOcelot.class, 0, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAIEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSafePointTries() {
|
||||
return this.getAttackTarget() == null ? 3 : 3 + (int) (this.getHealth() - 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fall(float p_70069_1_) {
|
||||
super.fall(p_70069_1_);
|
||||
this.timeSinceIgnited = (int) (this.timeSinceIgnited + p_70069_1_ * 1.5F);
|
||||
|
||||
if(this.timeSinceIgnited > this.fuseTime - 5) {
|
||||
this.timeSinceIgnited = this.fuseTime - 5;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte) -1));
|
||||
this.dataWatcher.addObject(17, Byte.valueOf((byte) 0));
|
||||
this.dataWatcher.addObject(18, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
super.writeEntityToNBT(p_70014_1_);
|
||||
|
||||
if(this.dataWatcher.getWatchableObjectByte(17) == 1) {
|
||||
p_70014_1_.setBoolean("powered", true);
|
||||
}
|
||||
|
||||
p_70014_1_.setShort("Fuse", (short) this.fuseTime);
|
||||
p_70014_1_.setByte("ExplosionRadius", (byte) this.explosionRadius);
|
||||
p_70014_1_.setBoolean("ignited", this.func_146078_ca());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
super.readEntityFromNBT(p_70037_1_);
|
||||
this.dataWatcher.updateObject(17, Byte.valueOf((byte) (p_70037_1_.getBoolean("powered") ? 1 : 0)));
|
||||
|
||||
if(p_70037_1_.hasKey("Fuse", 99)) {
|
||||
this.fuseTime = p_70037_1_.getShort("Fuse");
|
||||
}
|
||||
|
||||
if(p_70037_1_.hasKey("ExplosionRadius", 99)) {
|
||||
this.explosionRadius = p_70037_1_.getByte("ExplosionRadius");
|
||||
}
|
||||
|
||||
if(p_70037_1_.getBoolean("ignited")) {
|
||||
this.func_146079_cb();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if(this.isEntityAlive()) {
|
||||
this.lastActiveTime = this.timeSinceIgnited;
|
||||
|
||||
if(this.func_146078_ca()) {
|
||||
this.setCreeperState(1);
|
||||
}
|
||||
|
||||
int i = this.getCreeperState();
|
||||
|
||||
if(i > 0 && this.timeSinceIgnited == 0) {
|
||||
this.playSound("creeper.primed", 1.0F * 30 / 75, 0.5F);
|
||||
}
|
||||
|
||||
this.timeSinceIgnited += i;
|
||||
|
||||
if(this.timeSinceIgnited < 0) {
|
||||
this.timeSinceIgnited = 0;
|
||||
}
|
||||
|
||||
if(this.timeSinceIgnited >= this.fuseTime) {
|
||||
this.timeSinceIgnited = this.fuseTime;
|
||||
this.func_146077_cc();
|
||||
}
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if(this.getHealth() < this.getMaxHealth() && this.ticksExisted % 10 == 0) {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getHurtSound() {
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDeathSound() {
|
||||
return "mob.creeper.death";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity p_70652_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean getPowered() {
|
||||
return this.dataWatcher.getWatchableObjectByte(17) == 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getCreeperFlashIntensity(float p_70831_1_) {
|
||||
return (this.lastActiveTime + (this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (this.fuseTime - 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem() {
|
||||
return Item.getItemFromBlock(Blocks.tnt);
|
||||
}
|
||||
|
||||
public int getCreeperState() {
|
||||
return this.dataWatcher.getWatchableObjectByte(16);
|
||||
}
|
||||
|
||||
public void setCreeperState(int p_70829_1_) {
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte) p_70829_1_));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
|
||||
super.onStruckByLightning(p_70077_1_);
|
||||
this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean interact(EntityPlayer p_70085_1_) {
|
||||
ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
|
||||
|
||||
if(itemstack != null && itemstack.getItem() == Items.flint_and_steel) {
|
||||
this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F);
|
||||
p_70085_1_.swingItem();
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.func_146079_cb();
|
||||
itemstack.damageItem(1, p_70085_1_);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.interact(p_70085_1_);
|
||||
}
|
||||
|
||||
private void func_146077_cc() {
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
if(this.getPowered()) {
|
||||
this.explosionRadius *= 3;
|
||||
}
|
||||
|
||||
worldObj.newExplosion(this, posX, posY, posZ, 5.0F, false, false);
|
||||
|
||||
if(this.getPowered()) {
|
||||
|
||||
for(int i = 0; i < 255; i++) {
|
||||
int a = rand.nextInt(15) + (int) posX - 7;
|
||||
int b = rand.nextInt(15) + (int) posY - 7;
|
||||
int c = rand.nextInt(15) + (int) posZ - 7;
|
||||
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) {
|
||||
|
||||
if(!GeneralConfig.enableHardcoreTaint)
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 5, 2);
|
||||
else
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 2);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
for(int i = 0; i < 85; i++) {
|
||||
int a = rand.nextInt(7) + (int) posX - 3;
|
||||
int b = rand.nextInt(7) + (int) posY - 3;
|
||||
int c = rand.nextInt(7) + (int) posZ - 3;
|
||||
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && hasPosNeightbour(worldObj, a, b, c)) {
|
||||
|
||||
if(!GeneralConfig.enableHardcoreTaint)
|
||||
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(6) + 10, 2);
|
||||
else
|
||||
worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3) + 4, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasPosNeightbour(World world, int x, int y, int z) {
|
||||
Block b0 = world.getBlock(x + 1, y, z);
|
||||
Block b1 = world.getBlock(x, y + 1, z);
|
||||
Block b2 = world.getBlock(x, y, z + 1);
|
||||
Block b3 = world.getBlock(x - 1, y, z);
|
||||
Block b4 = world.getBlock(x, y - 1, z);
|
||||
Block b5 = world.getBlock(x, y, z - 1);
|
||||
boolean b = (b0.renderAsNormalBlock() && b0.getMaterial().isOpaque()) || (b1.renderAsNormalBlock() && b1.getMaterial().isOpaque()) || (b2.renderAsNormalBlock() && b2.getMaterial().isOpaque()) || (b3.renderAsNormalBlock() && b3.getMaterial().isOpaque()) || (b4.renderAsNormalBlock() && b4.getMaterial().isOpaque()) || (b5.renderAsNormalBlock() && b5.getMaterial().isOpaque());
|
||||
return b;
|
||||
}
|
||||
|
||||
public boolean func_146078_ca() {
|
||||
return this.dataWatcher.getWatchableObjectByte(18) != 0;
|
||||
}
|
||||
|
||||
public void func_146079_cb() {
|
||||
this.dataWatcher.updateObject(18, Byte.valueOf((byte) 1));
|
||||
}
|
||||
|
||||
public void setPowered(int power) {
|
||||
this.dataWatcher.updateObject(17, power);
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
package com.hbm.entity.mob.ai;
|
||||
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
|
||||
public class EntityAINuclearCreeperSwell extends EntityAIBase {
|
||||
/** The creeper that is swelling. */
|
||||
EntityNuclearCreeper swellingCreeper;
|
||||
/** The creeper's attack target. This is used for the changing of the creeper's state. */
|
||||
EntityLivingBase creeperAttackTarget;
|
||||
public EntityAINuclearCreeperSwell(EntityNuclearCreeper p_i1655_1_)
|
||||
{
|
||||
this.swellingCreeper = p_i1655_1_;
|
||||
this.setMutexBits(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the EntityAIBase should begin execution.
|
||||
*/
|
||||
@Override
|
||||
public boolean shouldExecute()
|
||||
{
|
||||
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSqToEntity(entitylivingbase) < 9.0D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a one shot task or start executing a continuous task
|
||||
*/
|
||||
@Override
|
||||
public void startExecuting()
|
||||
{
|
||||
this.swellingCreeper.getNavigator().clearPathEntity();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the task
|
||||
*/
|
||||
@Override
|
||||
public void resetTask()
|
||||
{
|
||||
this.creeperAttackTarget = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the task
|
||||
*/
|
||||
@Override
|
||||
public void updateTask()
|
||||
{
|
||||
if (this.creeperAttackTarget == null)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
package com.hbm.entity.mob.ai;
|
||||
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
|
||||
public class EntityAITaintedCreeperSwell extends EntityAIBase {
|
||||
/** The creeper that is swelling. */
|
||||
EntityTaintedCreeper swellingCreeper;
|
||||
/** The creeper's attack target. This is used for the changing of the creeper's state. */
|
||||
EntityLivingBase creeperAttackTarget;
|
||||
public EntityAITaintedCreeperSwell(EntityTaintedCreeper p_i1655_1_)
|
||||
{
|
||||
this.swellingCreeper = p_i1655_1_;
|
||||
this.setMutexBits(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the EntityAIBase should begin execution.
|
||||
*/
|
||||
@Override
|
||||
public boolean shouldExecute()
|
||||
{
|
||||
EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget();
|
||||
return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSqToEntity(entitylivingbase) < 9.0D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a one shot task or start executing a continuous task
|
||||
*/
|
||||
@Override
|
||||
public void startExecuting()
|
||||
{
|
||||
this.swellingCreeper.getNavigator().clearPathEntity();
|
||||
this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the task
|
||||
*/
|
||||
@Override
|
||||
public void resetTask()
|
||||
{
|
||||
this.creeperAttackTarget = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the task
|
||||
*/
|
||||
@Override
|
||||
public void updateTask()
|
||||
{
|
||||
if (this.creeperAttackTarget == null)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D)
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget))
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.swellingCreeper.setCreeperState(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ import net.minecraft.world.World;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.RedBarrel;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||
import com.hbm.entity.particle.EntityBSmokeFX;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
@ -494,7 +494,7 @@ public class EntityBullet extends Entity implements IProjectile {
|
||||
if (entitylivingbase instanceof EntityPlayer
|
||||
&& ArmorUtil.checkForHazmat((EntityPlayer) entitylivingbase)) {
|
||||
} else if (entitylivingbase instanceof EntityCreeper) {
|
||||
EntityNuclearCreeper creep = new EntityNuclearCreeper(this.worldObj);
|
||||
EntityCreeperNuclear creep = new EntityCreeperNuclear(this.worldObj);
|
||||
creep.setLocationAndAngles(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ,
|
||||
entitylivingbase.rotationYaw, entitylivingbase.rotationPitch);
|
||||
if (!entitylivingbase.isDead)
|
||||
@ -509,7 +509,7 @@ public class EntityBullet extends Entity implements IProjectile {
|
||||
if (!this.worldObj.isRemote)
|
||||
this.worldObj.spawnEntityInWorld(creep);
|
||||
} else if (entitylivingbase instanceof EntityLivingBase
|
||||
&& !(entitylivingbase instanceof EntityNuclearCreeper)
|
||||
&& !(entitylivingbase instanceof EntityCreeperNuclear)
|
||||
&& !(entitylivingbase instanceof EntityMooshroom)
|
||||
&& !(entitylivingbase instanceof EntityZombie)) {
|
||||
entitylivingbase.addPotionEffect(new PotionEffect(Potion.poison.getId(), 2 * 60 * 20, 2));
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.trait.FT_Combustible;
|
||||
import com.hbm.inventory.fluid.trait.FT_Corrosive;
|
||||
import com.hbm.inventory.fluid.trait.FT_Flammable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Poison;
|
||||
import com.hbm.inventory.fluid.trait.FT_Toxin;
|
||||
import com.hbm.inventory.fluid.trait.FT_VentRadiation;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
@ -253,6 +254,14 @@ public class EntityChemical extends EntityThrowableNT {
|
||||
}
|
||||
}
|
||||
|
||||
if(type.hasTrait(FT_Toxin.class)) {
|
||||
FT_Toxin trait = type.getTrait(FT_Toxin.class);
|
||||
|
||||
if(living != null) {
|
||||
trait.affect(living, intensity);
|
||||
}
|
||||
}
|
||||
|
||||
if(type == Fluids.XPJUICE) {
|
||||
|
||||
if(e instanceof EntityPlayer) {
|
||||
|
||||
59
src/main/java/com/hbm/handler/nei/ConstructionHandler.java
Normal file
@ -0,0 +1,59 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ConstructionHandler extends NEIUniversalHandler {
|
||||
|
||||
public ConstructionHandler() {
|
||||
super("Construction", getRecipes(true), getRecipes(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmConstruction";
|
||||
}
|
||||
|
||||
public static HashMap<Object[], Object> bufferedRecipes = new HashMap();
|
||||
public static HashMap<Object[], Object> bufferedTools = new HashMap();
|
||||
|
||||
public static HashMap<Object[], Object> getRecipes(boolean recipes) {
|
||||
|
||||
if(!bufferedRecipes.isEmpty()) {
|
||||
return recipes ? bufferedRecipes : bufferedTools;
|
||||
}
|
||||
|
||||
/* WATZ */
|
||||
ItemStack[] watz = new ItemStack[] {
|
||||
new ItemStack(ModBlocks.watz_end, 48),
|
||||
new ItemStack(ModItems.bolt_dura_steel, 64),
|
||||
new ItemStack(ModItems.bolt_dura_steel, 64),
|
||||
new ItemStack(ModItems.bolt_dura_steel, 64),
|
||||
new ItemStack(ModBlocks.watz_element, 36),
|
||||
new ItemStack(ModBlocks.watz_cooler, 26),
|
||||
new ItemStack(ModItems.boltgun)};
|
||||
|
||||
bufferedRecipes.put(watz, new ItemStack(ModBlocks.watz));
|
||||
bufferedTools.put(watz, new ItemStack(ModBlocks.struct_watz_core));
|
||||
|
||||
/* ITER */
|
||||
ItemStack[] iter = new ItemStack[] {
|
||||
new ItemStack(ModBlocks.fusion_conductor, 64),
|
||||
new ItemStack(ModBlocks.fusion_conductor, 64),
|
||||
new ItemStack(ModBlocks.fusion_conductor, 64),
|
||||
new ItemStack(ModBlocks.fusion_conductor, 64),
|
||||
new ItemStack(ModBlocks.fusion_conductor, 36),
|
||||
new ItemStack(ModBlocks.fusion_center, 64),
|
||||
new ItemStack(ModBlocks.fusion_motor, 4),
|
||||
new ItemStack(ModBlocks.reinforced_glass, 8)};
|
||||
|
||||
bufferedRecipes.put(iter, new ItemStack(ModBlocks.iter));
|
||||
bufferedTools.put(iter, new ItemStack(ModBlocks.struct_iter_core));
|
||||
|
||||
return recipes ? bufferedRecipes : bufferedTools;
|
||||
}
|
||||
}
|
||||
@ -32,12 +32,19 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
public final String display;
|
||||
public final ItemStack[] machine;
|
||||
public final HashMap<Object, Object> recipes;
|
||||
public HashMap<Object, Object> machineOverrides;
|
||||
/// SETUP ///
|
||||
|
||||
|
||||
public NEIUniversalHandler(String display, ItemStack machine[], HashMap recipes) {
|
||||
this.display = display;
|
||||
this.machine = machine;
|
||||
this.recipes = recipes;
|
||||
this.machineOverrides = null;
|
||||
}
|
||||
|
||||
public NEIUniversalHandler(String display, HashMap recipes, HashMap machines) {
|
||||
this(display, (ItemStack[]) null, recipes);
|
||||
this.machineOverrides = machines;
|
||||
}
|
||||
|
||||
public NEIUniversalHandler(String display, ItemStack machine, HashMap recipes) { this(display, new ItemStack[]{machine}, recipes); }
|
||||
@ -50,22 +57,32 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
PositionedStack[] output;
|
||||
PositionedStack machinePositioned;
|
||||
|
||||
public RecipeSet(ItemStack[][] in, ItemStack[][] out) {
|
||||
public RecipeSet(ItemStack[][] in, ItemStack[][] out, Object originalInputInstance /* for custom machine lookup */) {
|
||||
|
||||
input = new PositionedStack[in.length];
|
||||
int[][] inPos = NEIUniversalHandler.getInputCoords(in.length);
|
||||
for(int i = 0; i < in.length; i++) {
|
||||
ItemStack[] sub = in[i];
|
||||
this.input[i] = new PositionedStack(sub, 48 + i * -18, 24);
|
||||
this.input[i] = new PositionedStack(sub, inPos[i][0], inPos[i][1]);
|
||||
}
|
||||
output = new PositionedStack[out.length];
|
||||
int[][] outPos = NEIUniversalHandler.getOutputCoords(out.length);
|
||||
for(int i = 0; i < out.length; i++) {
|
||||
ItemStack[] sub = out[i];
|
||||
|
||||
boolean twos = out.length > 3;
|
||||
this.output[i] = new PositionedStack(sub, 102 + i * 18 - ((twos && i > 1) ? 36 : 0), 24 + (twos ? (i < 2 ? -9 : 9) : 0));
|
||||
this.output[i] = new PositionedStack(sub, outPos[i][0], outPos[i][1]);
|
||||
}
|
||||
|
||||
this.machinePositioned = new PositionedStack(machine, 75, 31);
|
||||
ItemStack[] m = machine;
|
||||
|
||||
if(NEIUniversalHandler.this.machineOverrides != null) {
|
||||
Object key = NEIUniversalHandler.this.machineOverrides.get(originalInputInstance);
|
||||
|
||||
if(key != null) {
|
||||
this.machinePositioned = new PositionedStack(key, 75, 31);
|
||||
}
|
||||
}
|
||||
|
||||
if(machinePositioned == null) this.machinePositioned = new PositionedStack(m, 75, 31);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -104,16 +121,115 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
super.drawBackground(recipe);
|
||||
|
||||
RecipeSet rec = (RecipeSet) this.arecipes.get(recipe);
|
||||
|
||||
for(int i = 0; i < rec.input.length; i++)
|
||||
drawTexturedModalRect(47 + i * -18, 23, 5, 87, 18, 18);
|
||||
for(int i = 0; i < rec.output.length; i++) {
|
||||
boolean twos = rec.output.length > 3;
|
||||
drawTexturedModalRect(101 + i * 18 - ((twos && i > 1) ? 36 : 0), 23 + (twos ? (i < 2 ? -9 : 9) : 0), 5, 87, 18, 18);
|
||||
|
||||
int[][] inPos = NEIUniversalHandler.getInputCoords(rec.input.length);
|
||||
for(int[] pos : inPos) {
|
||||
drawTexturedModalRect(pos[0] - 1, pos[1] - 1, 5, 87, 18, 18);
|
||||
}
|
||||
int[][] outPos = NEIUniversalHandler.getOutputCoords(rec.output.length);
|
||||
for(int[] pos : outPos) {
|
||||
drawTexturedModalRect(pos[0] - 1, pos[1] - 1, 5, 87, 18, 18);
|
||||
}
|
||||
|
||||
drawTexturedModalRect(74, 14, 59, 87, 18, 38);
|
||||
}
|
||||
|
||||
public static int[][] getInputCoords(int count) {
|
||||
|
||||
switch(count) {
|
||||
case 1: return new int[][] {
|
||||
{48, 24}
|
||||
};
|
||||
case 2: return new int[][] {
|
||||
{48, 24},
|
||||
{30, 24}
|
||||
};
|
||||
case 3: return new int[][] {
|
||||
{48, 24},
|
||||
{30, 24},
|
||||
{12, 24}
|
||||
};
|
||||
case 4: return new int[][] {
|
||||
{48, 24 - 9},
|
||||
{30, 24 - 9},
|
||||
{48, 24 + 9},
|
||||
{30, 24 + 9}
|
||||
};
|
||||
case 5: return new int[][] {
|
||||
{48, 24 - 9},
|
||||
{30, 24 - 9},
|
||||
{12, 24},
|
||||
{48, 24 + 9},
|
||||
{30, 24 + 9},
|
||||
};
|
||||
case 6: return new int[][] {
|
||||
{48, 24 - 9},
|
||||
{30, 24 - 9},
|
||||
{12, 24 - 9},
|
||||
{48, 24 + 9},
|
||||
{30, 24 + 9},
|
||||
{12, 24 + 9}
|
||||
};
|
||||
case 7: return new int[][] {
|
||||
{48, 24 - 18},
|
||||
{30, 24 - 9},
|
||||
{12, 24 - 9},
|
||||
{48, 24},
|
||||
{30, 24 + 9},
|
||||
{12, 24 + 9},
|
||||
{48, 24 + 18}
|
||||
};
|
||||
case 8: return new int[][] {
|
||||
{48, 24 - 18},
|
||||
{30, 24 - 18},
|
||||
{12, 24 - 9},
|
||||
{48, 24},
|
||||
{30, 24},
|
||||
{12, 24 + 9},
|
||||
{48, 24 + 18},
|
||||
{30, 24 + 18}
|
||||
};
|
||||
case 9: return new int[][] {
|
||||
{48, 24 - 18},
|
||||
{30, 24 - 18},
|
||||
{12, 24 - 18},
|
||||
{48, 24},
|
||||
{30, 24},
|
||||
{12, 24},
|
||||
{48, 24 + 18},
|
||||
{30, 24 + 18},
|
||||
{12, 24 + 18}
|
||||
};
|
||||
}
|
||||
|
||||
return new int[count][2];
|
||||
}
|
||||
|
||||
public static int[][] getOutputCoords(int count) {
|
||||
|
||||
switch(count) {
|
||||
case 1: return new int[][] {
|
||||
{102, 24}
|
||||
};
|
||||
case 2: return new int[][] {
|
||||
{102, 24},
|
||||
{120, 24}
|
||||
};
|
||||
case 3: return new int[][] {
|
||||
{102, 24},
|
||||
{120, 24},
|
||||
{138, 24}
|
||||
};
|
||||
case 4: return new int[][] {
|
||||
{102, 24 - 9},
|
||||
{120, 24 - 9},
|
||||
{138 + 36, 24 + 9},
|
||||
{156 + 36, 24 + 9}
|
||||
};
|
||||
}
|
||||
|
||||
return new int[count][2];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
@ -123,7 +239,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
for(Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
ItemStack[][] ins = InventoryUtil.extractObject(recipe.getKey());
|
||||
ItemStack[][] outs = InventoryUtil.extractObject(recipe.getValue());
|
||||
this.arecipes.add(new RecipeSet(ins, outs));
|
||||
this.arecipes.add(new RecipeSet(ins, outs, recipe.getKey()));
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -142,7 +258,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
for(ItemStack[] array : outs) {
|
||||
for(ItemStack stack : array) {
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(stack, result)) {
|
||||
this.arecipes.add(new RecipeSet(ins, outs));
|
||||
this.arecipes.add(new RecipeSet(ins, outs, recipe.getKey()));
|
||||
break match;
|
||||
}
|
||||
}
|
||||
@ -170,7 +286,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
for(ItemStack[] array : ins) {
|
||||
for(ItemStack stack : array) {
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)) {
|
||||
this.arecipes.add(new RecipeSet(ins, outs));
|
||||
this.arecipes.add(new RecipeSet(ins, outs, recipe.getKey()));
|
||||
break match;
|
||||
}
|
||||
}
|
||||
|
||||
15
src/main/java/com/hbm/handler/nei/ToolingHandler.java
Normal file
@ -0,0 +1,15 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.generic.BlockToolConversion;
|
||||
|
||||
public class ToolingHandler extends NEIUniversalHandler {
|
||||
|
||||
public ToolingHandler() {
|
||||
super("Tooling", BlockToolConversion.getRecipes(true), BlockToolConversion.getRecipes(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmTooling";
|
||||
}
|
||||
}
|
||||
@ -28,6 +28,7 @@ import com.hbm.items.ItemEnums.EnumCokeType;
|
||||
import com.hbm.items.ItemEnums.EnumTarType;
|
||||
import com.hbm.items.special.ItemBedrockOre.EnumBedrockOre;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
@ -110,7 +111,7 @@ public class OreDictManager {
|
||||
/*
|
||||
* RADIOACTIVE
|
||||
*/
|
||||
public static final DictFrame U = new DictFrame("Uranium");
|
||||
public static final DictFrame U = new DictFrame(Compat.isModLoaded(Compat.MOD_GT6) ? "Uraninite" : "Uranium");
|
||||
public static final DictFrame U233 = new DictFrame("Uranium233", "U233");
|
||||
public static final DictFrame U235 = new DictFrame("Uranium235", "U235");
|
||||
public static final DictFrame U238 = new DictFrame("Uranium238", "U238");
|
||||
|
||||
@ -455,17 +455,41 @@ public class RecipesCommon {
|
||||
this.block = block;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + Block.blockRegistry.getNameForObject(block).hashCode();
|
||||
result = prime * result + meta;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(this == obj)
|
||||
return true;
|
||||
if(obj == null)
|
||||
return false;
|
||||
if(getClass() != obj.getClass())
|
||||
return false;
|
||||
MetaBlock other = (MetaBlock) obj;
|
||||
if(block == null) {
|
||||
if(other.block != null)
|
||||
return false;
|
||||
} else if(!block.equals(other.block))
|
||||
return false;
|
||||
if(meta != other.meta)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public MetaBlock(Block block) {
|
||||
this(block, 0);
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + Block.getIdFromBlock(block);
|
||||
result = prime * result + meta;
|
||||
return result;
|
||||
@Deprecated public int getID() {
|
||||
return hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,10 +6,16 @@ import java.util.List;
|
||||
|
||||
import com.hbm.inventory.fluid.trait.*;
|
||||
import com.hbm.inventory.fluid.trait.FluidTraitSimple.*;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.inventory.fluid.trait.FT_Combustible.FuelGrade;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
|
||||
import com.hbm.inventory.fluid.trait.FT_Toxin.*;
|
||||
import com.hbm.render.util.EnumSymbol;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
public class Fluids {
|
||||
|
||||
@ -253,7 +259,6 @@ public class Fluids {
|
||||
MUSTARDGAS = new FluidType("MUSTARDGAS", 0xBAB572, 4, 1, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xBAB572, 0x361414)).addTraits(GASEOUS);
|
||||
IONGEL = new FluidType(103, "IONGEL", 0xB8FFFF, 1, 0, 4, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
|
||||
|
||||
// ^ ^ ^ ^ ^ ^ ^ ^
|
||||
//ADD NEW FLUIDS HERE
|
||||
//AND DON'T FORGET THE META DOWN HERE
|
||||
@ -377,6 +382,11 @@ public class Fluids {
|
||||
metaOrder.add(PLASMA_XM);
|
||||
metaOrder.add(PLASMA_BF);
|
||||
|
||||
CHLORINE.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 2F, 20, HazardClass.GAS_CHLORINE, false)));
|
||||
PHOSGENE.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 4F, 20, HazardClass.GAS_CHLORINE, false)));
|
||||
MUSTARDGAS.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 4F, 10, HazardClass.GAS_CORROSIVE, false))
|
||||
.addEntry(new ToxinEffects(HazardClass.GAS_CORROSIVE, true).add(new PotionEffect(Potion.wither.id, 100, 1), new PotionEffect(Potion.confusion.id, 100, 0))));
|
||||
|
||||
double eff_steam_boil = 1.0D;
|
||||
double eff_steam_heatex = 0.25D;
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
@Deprecated //use FT_Toxin instead
|
||||
public class FT_Poison extends FluidTrait {
|
||||
|
||||
protected boolean withering = false;
|
||||
|
||||
133
src/main/java/com/hbm/inventory/fluid/trait/FT_Toxin.java
Normal file
@ -0,0 +1,133 @@
|
||||
package com.hbm.inventory.fluid.trait;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.util.ArmorRegistry;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.StringUtils;
|
||||
|
||||
public class FT_Toxin extends FluidTrait {
|
||||
|
||||
public List<ToxinEntry> entries = new ArrayList();
|
||||
|
||||
public FT_Toxin addEntry(ToxinEntry entry) {
|
||||
entries.add(entry);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInfoHidden(List<String> info) {
|
||||
info.add(EnumChatFormatting.LIGHT_PURPLE + "[Toxin]");
|
||||
|
||||
for(ToxinEntry entry : entries) {
|
||||
entry.addInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
public void affect(EntityLivingBase entity, double intensity) {
|
||||
|
||||
for(ToxinEntry entry : entries) {
|
||||
entry.poison(entity, intensity);
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class ToxinEntry {
|
||||
|
||||
public HazardClass clazz;
|
||||
public boolean fullBody = false;
|
||||
|
||||
public ToxinEntry(HazardClass clazz, boolean fullBody) {
|
||||
this.clazz = clazz;
|
||||
this.fullBody = fullBody;
|
||||
}
|
||||
|
||||
public boolean isProtected(EntityLivingBase entity) {
|
||||
|
||||
boolean hasMask = clazz == null;
|
||||
boolean hasSuit = !fullBody;
|
||||
|
||||
if(clazz != null && ArmorRegistry.hasAllProtection(entity, 3, clazz)) {
|
||||
ArmorUtil.damageGasMaskFilter(entity, 1);
|
||||
hasMask = true;
|
||||
}
|
||||
|
||||
if(fullBody && ArmorUtil.checkForHazmat(entity)) {
|
||||
hasSuit = true;
|
||||
}
|
||||
|
||||
return hasMask && hasSuit;
|
||||
}
|
||||
|
||||
public abstract void poison(EntityLivingBase entity, double intensity);
|
||||
public abstract void addInfo(List<String> info);
|
||||
}
|
||||
|
||||
public static class ToxinDirectDamage extends ToxinEntry {
|
||||
|
||||
public DamageSource damage;
|
||||
public float amount;
|
||||
public int delay;
|
||||
|
||||
public ToxinDirectDamage(DamageSource damage, float amount, int delay, HazardClass clazz, boolean fullBody) {
|
||||
super(clazz, fullBody);
|
||||
this.damage = damage;
|
||||
this.amount = amount;
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void poison(EntityLivingBase entity, double intensity) {
|
||||
|
||||
if(isProtected(entity)) return;
|
||||
|
||||
if(delay == 0 || entity.worldObj.getTotalWorldTime() % delay == 0) {
|
||||
entity.attackEntityFrom(damage, (float) (amount * intensity));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInfo(List<String> info) {
|
||||
info.add(EnumChatFormatting.YELLOW + "- " + I18nUtil.resolveKey(clazz.lang) + (fullBody ? EnumChatFormatting.RED + " (requires hazmat suit)" : "") + ": " + EnumChatFormatting.YELLOW + String.format("%,.1f", amount * 20 / delay) + " DPS");
|
||||
}
|
||||
}
|
||||
|
||||
public static class ToxinEffects extends ToxinEntry {
|
||||
|
||||
public List<PotionEffect> effects = new ArrayList();
|
||||
|
||||
public ToxinEffects(HazardClass clazz, boolean fullBody) {
|
||||
super(clazz, fullBody);
|
||||
}
|
||||
|
||||
public ToxinEffects add(PotionEffect... effs) {
|
||||
for(PotionEffect eff : effs) this.effects.add(eff);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void poison(EntityLivingBase entity, double intensity) {
|
||||
|
||||
for(PotionEffect eff : effects) {
|
||||
entity.addPotionEffect(new PotionEffect(eff.getPotionID(), (int) (eff.getDuration() * intensity), eff.getAmplifier()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInfo(List<String> info) {
|
||||
info.add(EnumChatFormatting.YELLOW + "- " + I18nUtil.resolveKey(clazz.lang) + (fullBody ? EnumChatFormatting.RED + " (requires hazmat suit)" + EnumChatFormatting.YELLOW : "") + ":");
|
||||
|
||||
for(PotionEffect eff : effects) {
|
||||
info.add(EnumChatFormatting.YELLOW + " - " + I18nUtil.resolveKey(eff.getEffectName()) + (eff.getAmplifier() > 0 ? " " + StatCollector.translateToLocal("potion.potency." + eff.getAmplifier()).trim() : "") + " " + StringUtils.ticksToElapsedTime(eff.getDuration()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10,6 +10,7 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
@ -41,8 +42,8 @@ public class CyclotronRecipes extends SerializableRecipe {
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustPolonium"), new ItemStack(ModItems.powder_astatine), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustLanthanium"), new ItemStack(ModItems.powder_cerium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustActinium"), new ItemStack(ModItems.powder_thorium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustUranium"), new ItemStack(ModItems.powder_neptunium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustNeptunium"), new ItemStack(ModItems.powder_plutonium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack(U.dust()), new ItemStack(ModItems.powder_neptunium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack(NP237.dust()), new ItemStack(ModItems.powder_plutonium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new ComparableStack(ModItems.powder_reiium), new ItemStack(ModItems.powder_weidanium), liA);
|
||||
/// LITHIUM END ///
|
||||
|
||||
@ -68,7 +69,7 @@ public class CyclotronRecipes extends SerializableRecipe {
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_lanthanium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_neodymium), new ItemStack(ModItems.powder_gold), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.ingot_mercury), new ItemStack(ModItems.powder_polonium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_lead), new ItemStack(ModItems.powder_ra226),caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new OreDictStack(PB.dust()), new ItemStack(ModItems.powder_ra226),caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_astatine), new ItemStack(ModItems.powder_actinium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_australium), new ItemStack(ModItems.powder_verticium), caA);
|
||||
/// CARBON END ///
|
||||
@ -93,7 +94,7 @@ public class CyclotronRecipes extends SerializableRecipe {
|
||||
int plA = 100;
|
||||
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new OreDictStack("dustPhosphorus"), new ItemStack(ModItems.powder_tennessine), plA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new OreDictStack("dustPlutonium"), new ItemStack(ModItems.powder_tennessine), plA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new OreDictStack(PU.dust()), new ItemStack(ModItems.powder_tennessine), plA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.powder_tennessine), new ItemStack(ModItems.powder_reiium), plA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.pellet_charged), new ItemStack(ModItems.nugget_schrabidium), 1000);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.powder_unobtainium), new ItemStack(ModItems.powder_daffergon), plA);
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -29,8 +30,8 @@ public class SILEXRecipes {
|
||||
public static void register() {
|
||||
|
||||
itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.UF6.getID()), new ComparableStack(ModItems.ingot_uranium));
|
||||
dictTranslation.put("dustUranium", "ingotUranium");
|
||||
recipes.put("ingotUranium", new SILEXRecipe(900, 100, EnumWavelengths.UV)
|
||||
dictTranslation.put(U.dust(), U.ingot());
|
||||
recipes.put(U.ingot(), new SILEXRecipe(900, 100, EnumWavelengths.UV)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 1))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 11))
|
||||
);
|
||||
@ -46,8 +47,8 @@ public class SILEXRecipes {
|
||||
);
|
||||
|
||||
itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.PUF6.getID()), new ComparableStack(ModItems.ingot_plutonium));
|
||||
dictTranslation.put("dustPlutonium", "ingotPlutonium");
|
||||
recipes.put("ingotPlutonium", new SILEXRecipe(900, 100, 2)
|
||||
dictTranslation.put(PU.dust(), PU.ingot());
|
||||
recipes.put(PU.ingot(), new SILEXRecipe(900, 100, 2)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 3))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 4))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 2))
|
||||
|
||||
14
src/main/java/com/hbm/items/IAnimatedItem.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.hbm.items;
|
||||
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IAnimatedItem {
|
||||
|
||||
public BusAnimation getAnimation(NBTTagCompound data, ItemStack stack);
|
||||
}
|
||||
@ -1802,6 +1802,7 @@ public class ModItems {
|
||||
public static Item chemistry_set_boron;
|
||||
public static Item blowtorch;
|
||||
public static Item acetylene_torch;
|
||||
public static Item boltgun;
|
||||
public static Item overfuse;
|
||||
public static Item arc_electrode;
|
||||
public static Item arc_electrode_burnt;
|
||||
@ -4408,6 +4409,7 @@ public class ModItems {
|
||||
chemistry_set_boron = new ItemCraftingDegradation(0).setUnlocalizedName("chemistry_set_boron");
|
||||
blowtorch = new ItemBlowtorch().setUnlocalizedName("blowtorch");
|
||||
acetylene_torch = new ItemBlowtorch().setUnlocalizedName("acetylene_torch");
|
||||
boltgun = new ItemBoltgun().setUnlocalizedName("boltgun");
|
||||
overfuse = new ItemCustomLore().setUnlocalizedName("overfuse").setMaxStackSize(1).setFull3D().setTextureName(RefStrings.MODID + ":overfuse");
|
||||
arc_electrode = new ItemCustomLore().setUnlocalizedName("arc_electrode").setMaxDamage(250).setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setFull3D().setTextureName(RefStrings.MODID + ":arc_electrode");
|
||||
arc_electrode_burnt = new Item().setUnlocalizedName("arc_electrode_burnt").setMaxStackSize(1).setFull3D().setTextureName(RefStrings.MODID + ":arc_electrode_burnt");
|
||||
@ -6431,15 +6433,12 @@ public class ModItems {
|
||||
GameRegistry.registerItem(chemistry_set_boron, chemistry_set_boron.getUnlocalizedName());
|
||||
GameRegistry.registerItem(blowtorch, blowtorch.getUnlocalizedName());
|
||||
GameRegistry.registerItem(acetylene_torch, acetylene_torch.getUnlocalizedName());
|
||||
GameRegistry.registerItem(boltgun, boltgun.getUnlocalizedName());
|
||||
GameRegistry.registerItem(overfuse, overfuse.getUnlocalizedName());
|
||||
GameRegistry.registerItem(arc_electrode, arc_electrode.getUnlocalizedName());
|
||||
GameRegistry.registerItem(arc_electrode_burnt, arc_electrode_burnt.getUnlocalizedName());
|
||||
GameRegistry.registerItem(arc_electrode_desh, arc_electrode_desh.getUnlocalizedName());
|
||||
|
||||
//Particle Collider Items
|
||||
//GameRegistry.registerItem(crystal_energy, crystal_energy.getUnlocalizedName());
|
||||
//GameRegistry.registerItem(pellet_coolant, pellet_coolant.getUnlocalizedName());
|
||||
|
||||
//Particle Collider Fuel
|
||||
GameRegistry.registerItem(part_lithium, part_lithium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(part_beryllium, part_beryllium.getUnlocalizedName());
|
||||
|
||||
@ -2,12 +2,11 @@ package com.hbm.items.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.blocks.IBlockMulti;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -41,10 +40,8 @@ public class ItemBlockBase extends ItemBlock {
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
|
||||
if(field_150939_a instanceof BlockEnumMulti && ((BlockEnumMulti)field_150939_a).multiName) {
|
||||
|
||||
Enum num = EnumUtil.grabEnumSafely(((BlockEnumMulti)field_150939_a).theEnum, stack.getItemDamage());
|
||||
return super.getUnlocalizedName() + "." + num.name().toLowerCase();
|
||||
if(field_150939_a instanceof BlockMulti) {
|
||||
return ((BlockMulti)field_150939_a).getUnlocalizedName(stack);
|
||||
} else {
|
||||
return super.getUnlocalizedName(stack);
|
||||
}
|
||||
|
||||
@ -28,8 +28,11 @@ import net.minecraft.world.World;
|
||||
public class ItemBlowtorch extends Item implements IFillableItem {
|
||||
|
||||
public ItemBlowtorch() {
|
||||
this.setMaxStackSize(1);
|
||||
this.setFull3D();
|
||||
this.setCreativeTab(MainRegistry.controlTab);
|
||||
|
||||
ToolType.TORCH.register(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
127
src/main/java/com/hbm/items/tool/ItemBoltgun.java
Normal file
@ -0,0 +1,127 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.IAnimatedItem;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import api.hbm.block.IToolable.ToolType;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ItemBoltgun extends Item implements IAnimatedItem {
|
||||
|
||||
public ItemBoltgun() {
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(MainRegistry.controlTab);
|
||||
|
||||
ToolType.BOLT.register(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String unlocalizedName) {
|
||||
super.setUnlocalizedName(unlocalizedName);
|
||||
this.setTextureName(RefStrings.MODID + ":"+ unlocalizedName);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||
|
||||
World world = player.worldObj;
|
||||
if(!entity.isEntityAlive()) return false;
|
||||
|
||||
Item[] bolts = new Item[] { ModItems.bolt_dura_steel, ModItems.bolt_tungsten, Item.getItemFromBlock(ModBlocks.steel_beam) };
|
||||
|
||||
for(Item item : bolts) {
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack slot = player.inventory.getStackInSlot(i);
|
||||
|
||||
if(slot != null) {
|
||||
if(slot.getItem() == item) {
|
||||
if(!world.isRemote) {
|
||||
player.inventory.decrStackSize(i, 1);
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage(player).setDamageBypassesArmor(), 10F);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "vanillaExt");
|
||||
data.setString("mode", "largeexplode");
|
||||
data.setFloat("size", 1F);
|
||||
data.setByte("count", (byte)1);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, entity.posX, entity.posY + entity.height / 2 - entity.yOffset, entity.posZ), new TargetPoint(world.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 50));
|
||||
} else {
|
||||
// doing this on the client outright removes the packet delay and makes the animation silky-smooth
|
||||
NBTTagCompound d0 = new NBTTagCompound();
|
||||
d0.setString("type", "anim");
|
||||
d0.setString("mode", "generic");
|
||||
MainRegistry.proxy.effectNT(d0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {
|
||||
|
||||
Block b = world.getBlock(x, y, z);
|
||||
|
||||
if(b instanceof IToolable && ((IToolable)b).onScrew(world, player, x, y, z, side, fX, fY, fZ, ToolType.BOLT)) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
double off = 0.25;
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "vanillaExt");
|
||||
data.setString("mode", "largeexplode");
|
||||
data.setFloat("size", 1F);
|
||||
data.setByte("count", (byte)1);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + fX + dir.offsetX * off, y + fY + dir.offsetY * off, z + fZ + dir.offsetZ * off), new TargetPoint(world.provider.dimensionId, x, y, z, 50));
|
||||
|
||||
NBTTagCompound d0 = new NBTTagCompound();
|
||||
d0.setString("type", "anim");
|
||||
d0.setString("mode", "generic");
|
||||
PacketDispatcher.wrapper.sendTo(new AuxParticlePacketNT(d0, 0, 0, 0), (EntityPlayerMP) player);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BusAnimation getAnimation(NBTTagCompound data, ItemStack stack) {
|
||||
return new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 1, 50))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 100)));
|
||||
}
|
||||
}
|
||||
@ -18,6 +18,8 @@ public class ItemTooling extends ItemCraftingDegradation {
|
||||
this.type = type;
|
||||
this.setFull3D();
|
||||
this.setCreativeTab(MainRegistry.controlTab);
|
||||
|
||||
type.register(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -64,7 +64,9 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.HbmKeybinds;
|
||||
import com.hbm.handler.ImpactWorldHandler;
|
||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
||||
import com.hbm.items.IAnimatedItem;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.particle.*;
|
||||
import com.hbm.particle.psys.engine.EventHandlerParticleEngine;
|
||||
import com.hbm.render.anim.*;
|
||||
@ -428,6 +430,7 @@ public class ClientProxy extends ServerProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.mese_gavel, new ItemRenderGavel());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.crucible, new ItemRenderCrucible());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.chainsaw, new ItemRenderChainsaw());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.boltgun, new ItemRenderBoltgun());
|
||||
//guns
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_rpg, new ItemRenderRpg());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_karl, new ItemRenderRpg());
|
||||
@ -575,6 +578,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCog.class, new RenderCog());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySawblade.class, new RenderSawblade());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChemical.class, new RenderChemical());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMist.class, new RenderMist());
|
||||
//grenades
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeGeneric.class, new RenderSnowball(ModItems.grenade_generic));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeStrong.class, new RenderSnowball(ModItems.grenade_strong));
|
||||
@ -680,27 +684,28 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMovingPackage.class, new RenderMovingPackage());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTNTPrimedBase.class, new RenderTNTPrimedBase());
|
||||
//mobs
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNuclearCreeper.class, new RenderNuclearCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintedCreeper.class, new RenderTaintedCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHunterChopper.class, new RenderHunterChopper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCyberCrab.class, new RenderCyberCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTeslaCrab.class, new RenderTeslaCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintCrab.class, new RenderTaintCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMaskMan.class, new RenderMaskMan());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeHead.class, new RenderWormHead());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeBody.class, new RenderWormBody());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDuck.class, new RenderDuck(new ModelChicken(), 0.3F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityQuackos.class, new RenderQuacc(new ModelChicken(), 7.5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFBI.class, new RenderFBI());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityRADBeast.class, new RenderRADBeast());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBlockSpider.class, new RenderBlockSpider());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityUFO.class, new RenderUFO());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeZombie.class, new RenderSiegeZombie());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeUFO.class, new RenderSiegeUFO());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeCraft.class, new RenderSiegeCraft());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeSkeleton.class, new RenderSiegeSkeleton());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeTunneler.class, new RenderSiegeTunneler());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new RenderGhost());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperNuclear.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor.png").setSwellMod(5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperTainted.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_tainted.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor_taint.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperPhosgene.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_phosgene.png", "textures/entity/creeper/creeper_armor.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHunterChopper.class, new RenderHunterChopper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCyberCrab.class, new RenderCyberCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTeslaCrab.class, new RenderTeslaCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTaintCrab.class, new RenderTaintCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMaskMan.class, new RenderMaskMan());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeHead.class, new RenderWormHead());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBOTPrimeBody.class, new RenderWormBody());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDuck.class, new RenderDuck(new ModelChicken(), 0.3F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityQuackos.class, new RenderQuacc(new ModelChicken(), 7.5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFBI.class, new RenderFBI());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityRADBeast.class, new RenderRADBeast());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBlockSpider.class, new RenderBlockSpider());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityUFO.class, new RenderUFO());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeZombie.class, new RenderSiegeZombie());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeUFO.class, new RenderSiegeUFO());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeCraft.class, new RenderSiegeCraft());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeSkeleton.class, new RenderSiegeSkeleton());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeTunneler.class, new RenderSiegeTunneler());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new RenderGhost());
|
||||
//"particles"
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.smoke1, ModItems.smoke2, ModItems.smoke3, ModItems.smoke4, ModItems.smoke5, ModItems.smoke6, ModItems.smoke7, ModItems.smoke8 }));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.b_smoke1, ModItems.b_smoke2, ModItems.b_smoke3, ModItems.b_smoke4, ModItems.b_smoke5, ModItems.b_smoke6, ModItems.b_smoke7, ModItems.b_smoke8 }));
|
||||
@ -1630,8 +1635,10 @@ public class ClientProxy extends ServerProxy {
|
||||
|
||||
if("anim".equals(type)) {
|
||||
|
||||
String mode = data.getString("mode");
|
||||
|
||||
/* crucible deploy */
|
||||
if("crucible".equals(data.getString("mode")) && player.getHeldItem() != null) {
|
||||
if("crucible".equals(mode) && player.getHeldItem() != null) {
|
||||
|
||||
BusAnimation animation = new BusAnimation()
|
||||
.addBus("GUARD_ROT", new BusAnimationSequence()
|
||||
@ -1643,7 +1650,7 @@ public class ClientProxy extends ServerProxy {
|
||||
}
|
||||
|
||||
/* crucible swing */
|
||||
if("cSwing".equals(data.getString("mode"))) {
|
||||
if("cSwing".equals(mode)) {
|
||||
|
||||
if(HbmAnimations.getRelevantTransformation("SWING_ROT")[0] == 0) {
|
||||
|
||||
@ -1666,7 +1673,7 @@ public class ClientProxy extends ServerProxy {
|
||||
}
|
||||
|
||||
/* chainsaw swing */
|
||||
if("sSwing".equals(data.getString("mode")) || "lSwing".equals(data.getString("mode"))) { //temp for lance
|
||||
if("sSwing".equals(mode) || "lSwing".equals(mode)) { //temp for lance
|
||||
|
||||
int forward = 150;
|
||||
int sideways = 100;
|
||||
@ -1709,6 +1716,19 @@ public class ClientProxy extends ServerProxy {
|
||||
HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation);
|
||||
}
|
||||
}
|
||||
|
||||
if("generic".equals(mode)) {
|
||||
ItemStack stack = player.getHeldItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IAnimatedItem) {
|
||||
IAnimatedItem item = (IAnimatedItem) stack.getItem();
|
||||
BusAnimation anim = item.getAnimation(data, stack);
|
||||
|
||||
if(anim != null) {
|
||||
HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), anim);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if("tau".equals(type)) {
|
||||
|
||||
@ -46,6 +46,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.hbm.blocks.BlockEnums.EnumStoneType;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres;
|
||||
import com.hbm.blocks.generic.BlockToolConversion;
|
||||
import com.hbm.commands.CommandReloadRecipes;
|
||||
import com.hbm.config.*;
|
||||
import com.hbm.creativetabs.*;
|
||||
@ -829,6 +830,7 @@ public class MainRegistry {
|
||||
HazmatRegistry.registerHazmats();
|
||||
FluidContainerRegistry.register();
|
||||
TileEntityMachineReactorLarge.registerAll();
|
||||
BlockToolConversion.registerRecipes();
|
||||
|
||||
proxy.registerMissileItems();
|
||||
|
||||
|
||||
@ -22,9 +22,9 @@ import com.hbm.entity.missile.EntityMissileBaseAdvanced;
|
||||
import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.entity.mob.EntityCyberCrab;
|
||||
import com.hbm.entity.mob.EntityDuck;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||
import com.hbm.entity.mob.EntityQuackos;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperTainted;
|
||||
import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.entity.projectile.EntityBurningFOEQ;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
@ -284,7 +284,7 @@ public class ModEventHandler {
|
||||
event.entity.dropItem(ModItems.book_of_, 1);
|
||||
}
|
||||
|
||||
if(event.entity instanceof EntityTaintedCreeper && event.source == ModDamageSource.boxcar) {
|
||||
if(event.entity instanceof EntityCreeperTainted && event.source == ModDamageSource.boxcar) {
|
||||
|
||||
for(Object o : event.entity.worldObj.getEntitiesWithinAABB(EntityPlayer.class, event.entity.boundingBox.expand(50, 50, 50))) {
|
||||
EntityPlayer player = (EntityPlayer)o;
|
||||
@ -577,7 +577,7 @@ public class ModEventHandler {
|
||||
if(entity instanceof EntityCreeper && eRad >= 200 && entity.getHealth() > 0) {
|
||||
|
||||
if(event.world.rand.nextInt(3) == 0 ) {
|
||||
EntityNuclearCreeper creep = new EntityNuclearCreeper(event.world);
|
||||
EntityCreeperNuclear creep = new EntityCreeperNuclear(event.world);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
|
||||
if(!entity.isDead)
|
||||
|
||||
@ -53,6 +53,8 @@ public class NEIConfig implements IConfigureNEI {
|
||||
registerHandler(new CrucibleSmeltingHandler());
|
||||
registerHandler(new CrucibleAlloyingHandler());
|
||||
registerHandler(new CrucibleCastingHandler());
|
||||
registerHandler(new ToolingHandler());
|
||||
registerHandler(new ConstructionHandler());
|
||||
|
||||
//universal boyes
|
||||
registerHandler(new ZirnoxRecipeHandler());
|
||||
|
||||
@ -681,6 +681,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom gavel = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/gavel.obj"));
|
||||
public static final IModelCustom crucible = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/crucible.obj"));
|
||||
public static final IModelCustom chainsaw = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/chainsaw.obj"), false);
|
||||
public static final IModelCustom boltgun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/boltgun.obj"));
|
||||
|
||||
public static final IModelCustom hk69 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/hk69.obj"));
|
||||
public static final IModelCustom deagle = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/deagle.obj"));
|
||||
@ -754,6 +755,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation crucible_guard = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/crucible_guard.png");
|
||||
public static final ResourceLocation crucible_blade = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/crucible_blade.png");
|
||||
public static final ResourceLocation chainsaw_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/chainsaw.png");
|
||||
public static final ResourceLocation boltgun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/boltgun.png");
|
||||
|
||||
public static final ResourceLocation hk69_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/hk69.png");
|
||||
public static final ResourceLocation deagle_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/deagle.png");
|
||||
|
||||
@ -7,7 +7,7 @@ import com.hbm.blocks.bomb.BlockTaint;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.PotionConfig;
|
||||
import com.hbm.entity.mob.EntityTaintCrab;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperTainted;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -102,7 +102,7 @@ public class HbmPotion extends Potion {
|
||||
|
||||
if(this == taint) {
|
||||
|
||||
if(!(entity instanceof EntityTaintedCreeper) && !(entity instanceof EntityTaintCrab) && entity.worldObj.rand.nextInt(40) == 0)
|
||||
if(!(entity instanceof EntityCreeperTainted) && !(entity instanceof EntityTaintCrab) && entity.worldObj.rand.nextInt(40) == 0)
|
||||
entity.attackEntityFrom(ModDamageSource.taint, (level + 1));
|
||||
|
||||
if(GeneralConfig.enableHardcoreTaint && !entity.worldObj.isRemote) {
|
||||
|
||||
18
src/main/java/com/hbm/render/entity/effect/RenderMist.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.hbm.render.entity.effect;
|
||||
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderMist extends Render {
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package com.hbm.render.entity.mob;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderCreeper;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderCreeperUniversal extends RenderCreeper {
|
||||
|
||||
private final ResourceLocation creeperTextures;
|
||||
private final ResourceLocation armoredCreeperTextures;
|
||||
private float swellMod = 1.0F;
|
||||
|
||||
public RenderCreeperUniversal(String texture, String overlay) {
|
||||
super();
|
||||
|
||||
creeperTextures = new ResourceLocation(texture);
|
||||
armoredCreeperTextures = new ResourceLocation(overlay);
|
||||
}
|
||||
|
||||
public RenderCreeperUniversal setSwellMod(float mod) {
|
||||
this.swellMod = mod;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityCreeper creeper, float interp) {
|
||||
float swell = creeper.getCreeperFlashIntensity(interp);
|
||||
float flash = 1.0F + MathHelper.sin(swell * 100.0F) * swell * 0.01F;
|
||||
|
||||
if(swell < 0.0F) {
|
||||
swell = 0.0F;
|
||||
}
|
||||
|
||||
if(swell > 1.0F) {
|
||||
swell = 1.0F;
|
||||
}
|
||||
|
||||
swell *= swell;
|
||||
swell *= swell;
|
||||
swell *= swellMod;
|
||||
float scaleHorizontal = (1.0F + swell * 0.4F) * flash;
|
||||
float scaleVertical = (1.0F + swell * 0.1F) / flash;
|
||||
GL11.glScalef(scaleHorizontal, scaleVertical, scaleHorizontal);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int shouldRenderPass(EntityCreeper creeper, int pass, float interp) {
|
||||
if(creeper.getPowered()) {
|
||||
if(creeper.isInvisible()) {
|
||||
GL11.glDepthMask(false);
|
||||
} else {
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
if(pass == 1) {
|
||||
float time = (float) creeper.ticksExisted + interp;
|
||||
this.bindTexture(armoredCreeperTextures);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
float x = time * 0.01F;
|
||||
float y = time * 0.01F;
|
||||
GL11.glTranslatef(x, y, 0.0F);
|
||||
this.setRenderPassModel(this.creeperModel);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float flashColor = 0.5F;
|
||||
GL11.glColor4f(flashColor, flashColor, flashColor, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(pass == 2) {
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityCreeper p_110775_1_) {
|
||||
return creeperTextures;
|
||||
}
|
||||
}
|
||||
@ -1,189 +0,0 @@
|
||||
package com.hbm.render.entity.mob;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelCreeper;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderNuclearCreeper extends RenderLiving
|
||||
{
|
||||
private static final ResourceLocation armoredCreeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_armor.png");
|
||||
private static final ResourceLocation creeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper.png");
|
||||
/** The creeper model. */
|
||||
private ModelBase creeperModel = new ModelCreeper(2.0F);
|
||||
|
||||
public RenderNuclearCreeper()
|
||||
{
|
||||
super(new ModelCreeper(), 0.5F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
|
||||
* entityLiving, partialTickTime
|
||||
*/
|
||||
protected void preRenderCallback(EntityNuclearCreeper p_77041_1_, float p_77041_2_)
|
||||
{
|
||||
float f1 = p_77041_1_.getCreeperFlashIntensity(p_77041_2_);
|
||||
float f2 = 1.0F + MathHelper.sin(f1 * 100.0F) * f1 * 0.01F;
|
||||
|
||||
if (f1 < 0.0F)
|
||||
{
|
||||
f1 = 0.0F;
|
||||
}
|
||||
|
||||
if (f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
|
||||
f1 *= f1;
|
||||
f1 *= f1;
|
||||
float f3 = (1.0F + f1 * 0.4F) * f2;
|
||||
float f4 = (1.0F + f1 * 0.1F) / f2;
|
||||
GL11.glScalef(f3, f4, f3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
|
||||
*/
|
||||
protected int getColorMultiplier(EntityNuclearCreeper p_77030_1_, float p_77030_2_, float p_77030_3_)
|
||||
{
|
||||
float f2 = p_77030_1_.getCreeperFlashIntensity(p_77030_3_);
|
||||
|
||||
if ((int)(f2 * 10.0F) % 2 == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i = (int)(f2 * 0.2F * 255.0F);
|
||||
|
||||
if (i < 0)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
|
||||
if (i > 255)
|
||||
{
|
||||
i = 255;
|
||||
}
|
||||
|
||||
short short1 = 255;
|
||||
short short2 = 255;
|
||||
short short3 = 255;
|
||||
return i << 24 | short1 << 16 | short2 << 8 | short3;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries whether should render the specified pass or not.
|
||||
*/
|
||||
protected int shouldRenderPass(EntityNuclearCreeper p_77032_1_, int p_77032_2_, float p_77032_3_)
|
||||
{
|
||||
if (p_77032_1_.getPowered())
|
||||
{
|
||||
if (p_77032_1_.isInvisible())
|
||||
{
|
||||
GL11.glDepthMask(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
if (p_77032_2_ == 1)
|
||||
{
|
||||
float f1 = p_77032_1_.ticksExisted + p_77032_3_;
|
||||
this.bindTexture(armoredCreeperTextures);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
float f2 = f1 * 0.01F;
|
||||
float f3 = f1 * 0.01F;
|
||||
GL11.glTranslatef(f2, f3, 0.0F);
|
||||
this.setRenderPassModel(this.creeperModel);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float f4 = 0.5F;
|
||||
GL11.glColor4f(f4, f4, f4, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (p_77032_2_ == 2)
|
||||
{
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
protected int inheritRenderPass(EntityNuclearCreeper p_77035_1_, int p_77035_2_, float p_77035_3_)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntityNuclearCreeper p_110775_1_)
|
||||
{
|
||||
return creeperTextures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
|
||||
* entityLiving, partialTickTime
|
||||
*/
|
||||
@Override
|
||||
protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_)
|
||||
{
|
||||
this.preRenderCallback((EntityNuclearCreeper)p_77041_1_, p_77041_2_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
|
||||
*/
|
||||
@Override
|
||||
protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_)
|
||||
{
|
||||
return this.getColorMultiplier((EntityNuclearCreeper)p_77030_1_, p_77030_2_, p_77030_3_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries whether should render the specified pass or not.
|
||||
*/
|
||||
@Override
|
||||
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
|
||||
{
|
||||
return this.shouldRenderPass((EntityNuclearCreeper)p_77032_1_, p_77032_2_, p_77032_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_)
|
||||
{
|
||||
return this.inheritRenderPass((EntityNuclearCreeper)p_77035_1_, p_77035_2_, p_77035_3_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
|
||||
{
|
||||
return this.getEntityTexture((EntityNuclearCreeper)p_110775_1_);
|
||||
}
|
||||
}
|
||||
@ -1,189 +0,0 @@
|
||||
package com.hbm.render.entity.mob;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelCreeper;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderTaintedCreeper extends RenderLiving
|
||||
{
|
||||
private static final ResourceLocation armoredCreeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_armor_taint.png");
|
||||
private static final ResourceLocation creeperTextures = new ResourceLocation(RefStrings.MODID + ":" + "textures/entity/creeper_tainted.png");
|
||||
/** The creeper model. */
|
||||
private ModelBase creeperModel = new ModelCreeper(2.0F);
|
||||
|
||||
public RenderTaintedCreeper()
|
||||
{
|
||||
super(new ModelCreeper(), 0.5F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
|
||||
* entityLiving, partialTickTime
|
||||
*/
|
||||
protected void preRenderCallback(EntityTaintedCreeper p_77041_1_, float p_77041_2_)
|
||||
{
|
||||
float f1 = p_77041_1_.getCreeperFlashIntensity(p_77041_2_);
|
||||
float f2 = 1.0F + MathHelper.sin(f1 * 100.0F) * f1 * 0.01F;
|
||||
|
||||
if (f1 < 0.0F)
|
||||
{
|
||||
f1 = 0.0F;
|
||||
}
|
||||
|
||||
if (f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
|
||||
f1 *= f1;
|
||||
f1 *= f1;
|
||||
float f3 = (1.0F + f1 * 0.4F) * f2;
|
||||
float f4 = (1.0F + f1 * 0.1F) / f2;
|
||||
GL11.glScalef(f3, f4, f3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
|
||||
*/
|
||||
protected int getColorMultiplier(EntityTaintedCreeper p_77030_1_, float p_77030_2_, float p_77030_3_)
|
||||
{
|
||||
float f2 = p_77030_1_.getCreeperFlashIntensity(p_77030_3_);
|
||||
|
||||
if ((int)(f2 * 10.0F) % 2 == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i = (int)(f2 * 0.2F * 255.0F);
|
||||
|
||||
if (i < 0)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
|
||||
if (i > 255)
|
||||
{
|
||||
i = 255;
|
||||
}
|
||||
|
||||
short short1 = 255;
|
||||
short short2 = 255;
|
||||
short short3 = 255;
|
||||
return i << 24 | short1 << 16 | short2 << 8 | short3;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries whether should render the specified pass or not.
|
||||
*/
|
||||
protected int shouldRenderPass(EntityTaintedCreeper p_77032_1_, int p_77032_2_, float p_77032_3_)
|
||||
{
|
||||
if (p_77032_1_.getPowered())
|
||||
{
|
||||
if (p_77032_1_.isInvisible())
|
||||
{
|
||||
GL11.glDepthMask(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
if (p_77032_2_ == 1)
|
||||
{
|
||||
float f1 = p_77032_1_.ticksExisted + p_77032_3_;
|
||||
this.bindTexture(armoredCreeperTextures);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
float f2 = f1 * 0.01F;
|
||||
float f3 = f1 * 0.01F;
|
||||
GL11.glTranslatef(f2, f3, 0.0F);
|
||||
this.setRenderPassModel(this.creeperModel);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float f4 = 0.5F;
|
||||
GL11.glColor4f(f4, f4, f4, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (p_77032_2_ == 2)
|
||||
{
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
protected int inheritRenderPass(EntityTaintedCreeper p_77035_1_, int p_77035_2_, float p_77035_3_)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(EntityTaintedCreeper p_110775_1_)
|
||||
{
|
||||
return creeperTextures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
|
||||
* entityLiving, partialTickTime
|
||||
*/
|
||||
@Override
|
||||
protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_)
|
||||
{
|
||||
this.preRenderCallback((EntityTaintedCreeper)p_77041_1_, p_77041_2_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
|
||||
*/
|
||||
@Override
|
||||
protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_)
|
||||
{
|
||||
return this.getColorMultiplier((EntityTaintedCreeper)p_77030_1_, p_77030_2_, p_77030_3_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries whether should render the specified pass or not.
|
||||
*/
|
||||
@Override
|
||||
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
|
||||
{
|
||||
return this.shouldRenderPass((EntityTaintedCreeper)p_77032_1_, p_77032_2_, p_77032_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_)
|
||||
{
|
||||
return this.inheritRenderPass((EntityTaintedCreeper)p_77035_1_, p_77035_2_, p_77035_3_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
|
||||
{
|
||||
return this.getEntityTexture((EntityTaintedCreeper)p_110775_1_);
|
||||
}
|
||||
}
|
||||
103
src/main/java/com/hbm/render/item/ItemRenderBoltgun.java
Normal file
@ -0,0 +1,103 @@
|
||||
package com.hbm.render.item;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderBoltgun implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch(type) {
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case ENTITY:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.boltgun_tex);
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
|
||||
double s0 = 0.15D;
|
||||
GL11.glTranslated(0.5, 0.35, -0.25F);
|
||||
GL11.glRotated(15, 0, 0, 1);
|
||||
GL11.glRotated(80, 0, 1, 0);
|
||||
GL11.glScaled(s0, s0, s0);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
double[] anim = HbmAnimations.getRelevantTransformation("RECOIL");
|
||||
GL11.glTranslated(0, 0, -anim[0]);
|
||||
if(anim[0] != 0) player.isSwingInProgress = false;
|
||||
ResourceManager.boltgun.renderPart("Barrel");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
|
||||
double scale = 0.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotated(10, 0, 1, 0);
|
||||
GL11.glRotated(10, 0, 0, 1);
|
||||
GL11.glRotated(10, 1, 0, 0);
|
||||
GL11.glTranslated(1.5, -0.25, 1);
|
||||
|
||||
break;
|
||||
|
||||
case ENTITY:
|
||||
|
||||
double s1 = 0.1D;
|
||||
GL11.glScaled(s1, s1, s1);
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
double s = 1.75D;
|
||||
GL11.glTranslated(7, 10, 0);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
GL11.glRotated(-135, 1, 0, 0);
|
||||
GL11.glScaled(s, s, -s);
|
||||
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
ResourceManager.boltgun.renderPart("Gun");
|
||||
if(type != type.EQUIPPED_FIRST_PERSON) {
|
||||
ResourceManager.boltgun.renderPart("Barrel");
|
||||
}
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -12,8 +12,6 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderChainsaw implements IItemRenderer {
|
||||
|
||||
public ItemRenderChainsaw() { }
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
@ -29,7 +27,6 @@ public class ItemRenderChainsaw implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
|
||||
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
|
||||
}
|
||||
|
||||
|
||||
@ -44,15 +44,15 @@ public class RenderWatzMultiblock extends TileEntitySpecialRenderer {
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, 1F, i, -2F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_cooler, 0, -1F, i, -2F);
|
||||
for(int j = -1; j < 2; j++) {
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, 3F, i, j);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, j, i, 3F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, -3F, i, j);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, j, i, -3F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 1, 3F, i, j);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 1, j, i, 3F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 1, -3F, i, j);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 1, j, i, -3F);
|
||||
}
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, 2F, i, 2F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, 2F, i, -2F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, -2F, i, 2F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 0, -2F, i, -2F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 1, 2F, i, 2F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 1, 2F, i, -2F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 1, -2F, i, 2F);
|
||||
SmallBlockPronter.drawSmolBlockAt(ModBlocks.watz_end, 1, -2F, i, -2F);
|
||||
}
|
||||
|
||||
SmallBlockPronter.draw();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.inventory.OreDictManager;
|
||||
import com.hbm.inventory.container.ContainerMachineSchrabidiumTransmutator;
|
||||
import com.hbm.inventory.gui.GUIMachineSchrabidiumTransmutator;
|
||||
import com.hbm.inventory.recipes.MachineRecipes;
|
||||
@ -50,7 +51,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
if (MachineRecipes.mODE(stack, "ingotUranium"))
|
||||
if (MachineRecipes.mODE(stack, OreDictManager.U.ingot()))
|
||||
return true;
|
||||
break;
|
||||
case 2:
|
||||
@ -113,7 +114,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
if (power >= 4990000 && slots[0] != null && MachineRecipes.mODE(slots[0], "ingotUranium") && slots[2] != null
|
||||
if (power >= 4990000 && slots[0] != null && MachineRecipes.mODE(slots[0], OreDictManager.U.ingot()) && slots[2] != null
|
||||
&& slots[2].getItem() == ModItems.redcoil_capacitor
|
||||
&& ItemCapacitor.getDura(slots[2]) > 0
|
||||
&& (slots[1] == null || (slots[1] != null && slots[1].getItem() == VersatileConfig.getTransmutatorItem()
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.mob.EntityCyberCrab;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityTaintCrab;
|
||||
import com.hbm.entity.mob.EntityTeslaCrab;
|
||||
import com.hbm.lib.Library;
|
||||
@ -134,10 +133,6 @@ public class TileEntityTesla extends TileEntityMachineBase implements IEnergyUse
|
||||
((EntityCreeper)e).getDataWatcher().updateObject(17, Byte.valueOf((byte)1));
|
||||
}
|
||||
|
||||
if(e instanceof EntityNuclearCreeper) {
|
||||
((EntityNuclearCreeper)e).getDataWatcher().updateObject(17, Byte.valueOf((byte)1));
|
||||
}
|
||||
|
||||
double offset = 0;
|
||||
|
||||
if(source != null && e instanceof EntityPlayer && worldObj.isRemote)
|
||||
|
||||
@ -131,11 +131,7 @@ public class TileEntityWatz extends TileEntityMachineBase implements IFluidStand
|
||||
|
||||
/** basic sanity checking, usually wouldn't do anything except when NBT loading borks */
|
||||
public void setupCoolant() {
|
||||
|
||||
if(!tanks[0].getTankType().hasTrait(FT_Heatable.class)) {
|
||||
tanks[0].setTankType(Fluids.COOLANT);
|
||||
}
|
||||
|
||||
tanks[0].setTankType(Fluids.COOLANT);
|
||||
tanks[1].setTankType(tanks[0].getTankType().getTrait(FT_Heatable.class).getFirstStep().typeProduced);
|
||||
}
|
||||
|
||||
|
||||
@ -49,20 +49,20 @@ public class TileEntityWatzStruct extends TileEntity {
|
||||
if(!cbr(ModBlocks.watz_cooler, -1, i, -2)) return;
|
||||
|
||||
for(int j = -1; j < 2; j++) {
|
||||
if(!cbr(ModBlocks.watz_end, 3, i, j)) return;
|
||||
if(!cbr(ModBlocks.watz_end, j, i, 3)) return;
|
||||
if(!cbr(ModBlocks.watz_end, -3, i, j)) return;
|
||||
if(!cbr(ModBlocks.watz_end, j, i, -3)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 1, 3, i, j)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 1, j, i, 3)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 1, -3, i, j)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 1, j, i, -3)) return;
|
||||
}
|
||||
if(!cbr(ModBlocks.watz_end, 2, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 2, i, -2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, -2, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, -2, i, -2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 1, 2, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 1, 2, i, -2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 1, -2, i, 2)) return;
|
||||
if(!cbr(ModBlocks.watz_end, 1, -2, i, -2)) return;
|
||||
}
|
||||
|
||||
Watz watz = (Watz)ModBlocks.watz;
|
||||
BlockDummyable.safeRem = true;
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.watz, this.getBlockMetadata() + BlockDummyable.offset, 3);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.watz, 12, 3);
|
||||
watz.fillSpace(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, 0);
|
||||
BlockDummyable.safeRem = false;
|
||||
}
|
||||
@ -72,10 +72,18 @@ public class TileEntityWatzStruct extends TileEntity {
|
||||
return worldObj.getBlock(xCoord + x, yCoord + y, zCoord + z);
|
||||
}
|
||||
|
||||
/** [G]et [M]eta at [R]elative position */
|
||||
private int gmr(int x, int y, int z) {
|
||||
return worldObj.getBlockMetadata(xCoord + x, yCoord + y, zCoord + z);
|
||||
}
|
||||
|
||||
/** [C]heck [B]lock at [R]elative position */
|
||||
private boolean cbr(Block b, int x, int y, int z) {
|
||||
return b == gbr(x, y, z);
|
||||
}
|
||||
private boolean cbr(Block b, int meta, int x, int y, int z) {
|
||||
return b == gbr(x, y, z) && meta == gmr(x, y, z);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -1,17 +1,10 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.recipes.CrackingRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
@ -24,20 +17,17 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase implements IFluidSource, IFluidAcceptor, INBTPacketReceiver, IFluidStandardTransceiver {
|
||||
public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase implements INBTPacketReceiver, IFluidStandardTransceiver {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public List<IFluidAcceptor> list1 = new ArrayList();
|
||||
public List<IFluidAcceptor> list2 = new ArrayList();
|
||||
public List<IFluidAcceptor> list3 = new ArrayList();
|
||||
|
||||
public TileEntityMachineCatalyticCracker() {
|
||||
tanks = new FluidTank[5];
|
||||
tanks[0] = new FluidTank(Fluids.BITUMEN, 4000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.STEAM, 8000, 1);
|
||||
tanks[2] = new FluidTank(Fluids.OIL, 4000, 2);
|
||||
tanks[3] = new FluidTank(Fluids.PETROLEUM, 4000, 3);
|
||||
tanks[4] = new FluidTank(Fluids.SPENTSTEAM, 800, 4);
|
||||
tanks[0] = new FluidTank(Fluids.BITUMEN, 4000);
|
||||
tanks[1] = new FluidTank(Fluids.STEAM, 8000);
|
||||
tanks[2] = new FluidTank(Fluids.OIL, 4000);
|
||||
tanks[3] = new FluidTank(Fluids.PETROLEUM, 4000);
|
||||
tanks[4] = new FluidTank(Fluids.SPENTSTEAM, 800);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -51,14 +41,11 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
|
||||
updateConnections();
|
||||
|
||||
this.worldObj.theProfiler.endStartSection("catalyticCracker_do_recipe");
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0)
|
||||
if(worldObj.getTotalWorldTime() % 5 == 0)
|
||||
crack();
|
||||
|
||||
this.worldObj.theProfiler.endStartSection("catalyticCracker_send_fluid");
|
||||
if(worldObj.getTotalWorldTime() % 10 == 0) {
|
||||
fillFluidInit(tanks[2].getTankType());
|
||||
fillFluidInit(tanks[3].getTankType());
|
||||
fillFluidInit(tanks[4].getTankType());
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
for(int i = 2; i <= 4; i++) {
|
||||
@ -149,63 +136,6 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
|
||||
for(int i = 0; i < 5; i++)
|
||||
tanks[i].writeToNBT(nbt, "tank" + i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 5 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
this.tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
if(type == tanks[0].getTankType())
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type == tanks[1].getTankType())
|
||||
return tanks[1].getMaxFill();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
fillFluid(xCoord + dir.offsetX * 4 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 4 + rot.offsetZ * 1, this.getTact(), type);
|
||||
fillFluid(xCoord + dir.offsetX * 4 - rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 4 - rot.offsetZ * 2, this.getTact(), type);
|
||||
fillFluid(xCoord - dir.offsetX * 4 + rot.offsetX * 1, yCoord, zCoord - dir.offsetZ * 4 + rot.offsetZ * 1, this.getTact(), type);
|
||||
fillFluid(xCoord - dir.offsetX * 4 - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 4 - rot.offsetZ * 2, this.getTact(), type);
|
||||
|
||||
fillFluid(xCoord + dir.offsetX * 2 + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * 3, this.getTact(), type);
|
||||
fillFluid(xCoord + dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord + dir.offsetZ * 2 - rot.offsetZ * 4, this.getTact(), type);
|
||||
fillFluid(xCoord - dir.offsetX * 2 + rot.offsetX * 3, yCoord, zCoord - dir.offsetZ * 2 + rot.offsetZ * 3, this.getTact(), type);
|
||||
fillFluid(xCoord - dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ * 4, this.getTact(), type);
|
||||
}
|
||||
|
||||
protected DirPos[] getConPos() {
|
||||
|
||||
@ -223,31 +153,6 @@ public class TileEntityMachineCatalyticCracker extends TileEntityLoadedBase impl
|
||||
new DirPos(xCoord - dir.offsetX * 2 - rot.offsetX * 4, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ * 4, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
return worldObj.getTotalWorldTime() % 20 < 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
if(type == tanks[2].getTankType()) return list1;
|
||||
if(type == tanks[3].getTankType()) return list2;
|
||||
if(type == tanks[4].getTankType()) return list3;
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
if(type == tanks[2].getTankType()) list1.clear();
|
||||
if(type == tanks[3].getTankType()) list2.clear();
|
||||
if(type == tanks[4].getTankType()) list3.clear();
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -117,13 +117,4 @@ public class ArmorRegistry {
|
||||
this.lang = lang;
|
||||
}
|
||||
}
|
||||
|
||||
/*public static enum ArmorClass {
|
||||
MASK_FILTERED,
|
||||
MASK_OXY,
|
||||
GOGGLES,
|
||||
HAZMAT_HEAT,
|
||||
HAZMAT_RADIATION,
|
||||
HAZMAT_BIO;
|
||||
}*/
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.util;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.hbm.entity.mob.EntityDuck;
|
||||
import com.hbm.entity.mob.EntityNuclearCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||
import com.hbm.entity.mob.EntityQuackos;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.HazmatRegistry;
|
||||
@ -65,7 +65,7 @@ public class ContaminationUtil {
|
||||
return true;
|
||||
|
||||
if(immuneEntities.isEmpty()) {
|
||||
immuneEntities.add(EntityNuclearCreeper.class);
|
||||
immuneEntities.add(EntityCreeperNuclear.class);
|
||||
immuneEntities.add(EntityMooshroom.class);
|
||||
immuneEntities.add(EntityZombie.class);
|
||||
immuneEntities.add(EntitySkeleton.class);
|
||||
|
||||
10
src/main/resources/META-INF/HBM_at.cfg
Normal file
@ -0,0 +1,10 @@
|
||||
# It's access transformer time, baby!
|
||||
# Cracks open stupid as shit keywords that are being used wrong because Mojang shouldn't be entrusted with computers.
|
||||
# After changing anything here, run `./gradlew clean setupDecompWorkspace`, this should scrap all the cached nonsense and patch the src to reflect changes made.
|
||||
|
||||
# EntityCreeper
|
||||
public net.minecraft.entity.monster.EntityCreeper field_82225_f # fuseTime
|
||||
public net.minecraft.entity.monster.EntityCreeper func_146077_cc()V # explode
|
||||
|
||||
# RenderCreeper
|
||||
public net.minecraft.client.renderer.entity.RenderCreeper field_77064_a # creeperModel
|
||||
@ -503,6 +503,7 @@ entity.hbm.entity_ntm_ufo.name=Marsianisches Invasionsschiff
|
||||
entity.entity_mob_hunter_chopper.name=Jagdschrauber
|
||||
entity.entity_mob_mask_man.name=Maskenmann
|
||||
entity.entity_mob_nuclear_creeper.name=Nuklearer Creeper
|
||||
entity.entity_mob_phosgene_creeper.name=Phosgen-Creeper
|
||||
entity.entity_mob_tainted_creeper.name=Verseuchter Creeper
|
||||
entity.entity_taint_crab.name=Verseuchte Krabbe
|
||||
entity.entity_tesla_crab.name=Tesla-Krabbe
|
||||
@ -1204,6 +1205,7 @@ item.bobmazon_weapons.name=Bobmazon: Waffen und Sprengstoffe
|
||||
item.bolt_compound.name=Verstärkte Turbinenwelle
|
||||
item.bolt_dura_steel.name=Schnellarbeitsstahlbolzen
|
||||
item.bolt_tungsten.name=Wolframbolzen
|
||||
item.boltgun.name=Pneumatische Nietenpistole
|
||||
item.bomb_caller.name=Luftschlag Zielmarker
|
||||
item.bomb_waffle.name=Massenvernichtungswaffel
|
||||
item.guide_book.name=Handbuch
|
||||
@ -4221,6 +4223,7 @@ tile.struct_launcher_core_large.name=Startrampe-Kernkomponente
|
||||
tile.struct_plasma_core.name=Plasmaerhitzer-Kernkomponente
|
||||
tile.struct_scaffold.name=Startrampe-Gerüstblock
|
||||
tile.struct_soyuz_core.name=Soyuz-Startrampe-Kernkomponente
|
||||
tile.struct_watz_core.name=Watzkraftwerk-Kernkomponente
|
||||
tile.substation.name=Umspannwerk
|
||||
tile.sulfuric_acid_block.name=Schwefelsäure
|
||||
tile.taint.name=Korrupter Schmutz
|
||||
@ -4280,6 +4283,7 @@ tile.watz_cooler.name=Watz-Superkühler
|
||||
tile.watz_core.name=Watzreaktorkern
|
||||
tile.watz_element.name=Watzreaktionskammer
|
||||
tile.watz_end.name=Watz-Stabilitätselement
|
||||
tile.watz_end_bolted.name=Watz-Stabilitätselement (Genietet)
|
||||
tile.watz_hatch.name=Watzreaktorzugriffsluke
|
||||
tile.yellow_barrel.name=Radioaktives Fass
|
||||
tile.zirnox_destroyed.name=Zerstörter ZINOX
|
||||
|
||||
@ -948,6 +948,7 @@ entity.hbm.entity_ntm_ufo.name=Martian Invasion Ship
|
||||
entity.entity_mob_hunter_chopper.name=Hunter Chopper
|
||||
entity.entity_mob_mask_man.name=Mask Man
|
||||
entity.entity_mob_nuclear_creeper.name=Nuclear Creeper
|
||||
entity.entity_mob_phosgene_creeper.name=Phosgene Creeper
|
||||
entity.entity_mob_tainted_creeper.name=Tainted Creeper
|
||||
entity.entity_taint_crab.name=Taint Crab
|
||||
entity.entity_tesla_crab.name=Tesla Crab
|
||||
@ -1791,6 +1792,7 @@ item.bobmazon_weapons.name=Bobmazon: Weapons and Explosives
|
||||
item.bolt_compound.name=Reinforced Turbine Shaft
|
||||
item.bolt_dura_steel.name=High-Speed Steel Bolt
|
||||
item.bolt_tungsten.name=Tungsten Bolt
|
||||
item.boltgun.name=Pneumatic Rivet Gun
|
||||
item.bomb_caller.name=Airstrike Designator
|
||||
item.bomb_waffle.name=Waffle of Mass Destruction
|
||||
item.book_guide.name=Guide Book
|
||||
@ -5037,6 +5039,7 @@ tile.struct_launcher_core_large.name=Launch Table Core Component
|
||||
tile.struct_plasma_core.name=Plasma Heater Core Component
|
||||
tile.struct_scaffold.name=Launch Pad Scaffold Block
|
||||
tile.struct_soyuz_core.name=Soyuz Launcher Core Component
|
||||
tile.struct_watz_core.name=Watz Powerplant Core Component
|
||||
tile.substation.name=Substation
|
||||
tile.sulfuric_acid_block.name=Sulfuric Acid
|
||||
tile.taint.name=Taint
|
||||
@ -5098,6 +5101,7 @@ tile.watz_cooler.name=Watz Reactor Supercooler
|
||||
tile.watz_core.name=Watz Reactor Control
|
||||
tile.watz_element.name=Watz Reaction Chamber
|
||||
tile.watz_end.name=Watz Reactor Stability Element
|
||||
tile.watz_end_bolted.name=Watz Reactor Stability Element (Riveted)
|
||||
tile.watz_hatch.name=Watz Reactor Access Hatch
|
||||
tile.yellow_barrel.name=Radioactive Barrel
|
||||
tile.zirnox_destroyed.name=Destroyed ZINROX
|
||||
|
||||
2415
src/main/resources/assets/hbm/models/weapons/boltgun.obj
Normal file
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 128 B |
|
After Width: | Height: | Size: 460 B |
BIN
src/main/resources/assets/hbm/textures/entity/creeper_base.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 1.1 KiB |