fixed beta food, some crunchy stuff
|
Before Width: | Height: | Size: 435 B |
|
Before Width: | Height: | Size: 423 B |
BIN
src/main/java/assets/hbm/textures/blocks/hadron_access.png
Normal file
|
After Width: | Height: | Size: 469 B |
|
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 133 B After Width: | Height: | Size: 133 B |
BIN
src/main/java/assets/hbm/textures/blocks/hadron_core.png
Normal file
|
After Width: | Height: | Size: 674 B |
BIN
src/main/java/assets/hbm/textures/blocks/hadron_core_in.png
Normal file
|
After Width: | Height: | Size: 511 B |
BIN
src/main/java/assets/hbm/textures/blocks/hadron_core_out.png
Normal file
|
After Width: | Height: | Size: 525 B |
BIN
src/main/java/assets/hbm/textures/blocks/hadron_diode.png
Normal file
|
After Width: | Height: | Size: 443 B |
|
Before Width: | Height: | Size: 509 B After Width: | Height: | Size: 509 B |
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
|
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 310 B |
|
After Width: | Height: | Size: 330 B |
|
Before Width: | Height: | Size: 433 B After Width: | Height: | Size: 433 B |
|
After Width: | Height: | Size: 303 B |
|
After Width: | Height: | Size: 524 B |
|
After Width: | Height: | Size: 465 B |
|
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 446 B |
BIN
src/main/java/assets/hbm/textures/blocks/hadron_power.png
Normal file
|
After Width: | Height: | Size: 660 B |
@ -18,7 +18,6 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.BlockFalling;
|
import net.minecraft.block.BlockFalling;
|
||||||
import net.minecraft.block.material.*;
|
import net.minecraft.block.material.*;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
|
||||||
@ -445,6 +444,21 @@ public class ModBlocks {
|
|||||||
public static Block machine_cyclotron;
|
public static Block machine_cyclotron;
|
||||||
public static final int guiID_machine_cyclotron = 41;
|
public static final int guiID_machine_cyclotron = 41;
|
||||||
|
|
||||||
|
public static Block hadron_plating;
|
||||||
|
public static Block hadron_plating_blue;
|
||||||
|
public static Block hadron_plating_black;
|
||||||
|
public static Block hadron_plating_yellow;
|
||||||
|
public static Block hadron_plating_striped;
|
||||||
|
public static Block hadron_plating_voltz;
|
||||||
|
public static Block hadron_plating_glass;
|
||||||
|
public static Block hadron_coil_alloy;
|
||||||
|
public static Block hadron_coil_schrabidium;
|
||||||
|
public static Block hadron_coil_starmetal;
|
||||||
|
public static Block hadron_power;
|
||||||
|
public static Block hadron_diode;
|
||||||
|
public static Block hadron_access;
|
||||||
|
public static Block hadron_core;
|
||||||
|
|
||||||
public static Block machine_electric_furnace_off;
|
public static Block machine_electric_furnace_off;
|
||||||
public static Block machine_electric_furnace_on;
|
public static Block machine_electric_furnace_on;
|
||||||
public static final int guiID_electric_furnace = 16;
|
public static final int guiID_electric_furnace = 16;
|
||||||
@ -1175,6 +1189,32 @@ public class ModBlocks {
|
|||||||
machine_cyclotron = new MachineCyclotron(Material.iron).setBlockName("machine_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cyclotron");
|
machine_cyclotron = new MachineCyclotron(Material.iron).setBlockName("machine_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cyclotron");
|
||||||
machine_radgen = new MachineRadGen(Material.iron).setBlockName("machine_radgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_radgen");
|
machine_radgen = new MachineRadGen(Material.iron).setBlockName("machine_radgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_radgen");
|
||||||
|
|
||||||
|
hadron_plating = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating");
|
||||||
|
hadron_plating_blue = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_blue").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_blue");
|
||||||
|
hadron_plating_black = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_black").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_black");
|
||||||
|
hadron_plating_yellow = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_yellow").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_yellow");
|
||||||
|
hadron_plating_striped = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_striped").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_striped");
|
||||||
|
hadron_plating_voltz = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_voltz").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_voltz");
|
||||||
|
hadron_plating_glass = new BlockNTMGlass(RefStrings.MODID + ":hadron_plating_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_glass");
|
||||||
|
hadron_coil_alloy = new BlockHadronCoil(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_alloy").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_alloy");
|
||||||
|
hadron_coil_schrabidium = new BlockHadronCoil(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_schrabidium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_schrabidium");
|
||||||
|
hadron_coil_starmetal = new BlockHadronCoil(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_starmetal").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_starmetal");
|
||||||
|
hadron_diode = new BlockHadronDiode(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_diode").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||||
|
|
||||||
|
/*public static Block hadron_plating;
|
||||||
|
public static Block hadron_plating_blue;
|
||||||
|
public static Block hadron_plating_black;
|
||||||
|
public static Block hadron_plating_yellow;
|
||||||
|
public static Block hadron_plating_striped;
|
||||||
|
public static Block hadron_plating_glass;
|
||||||
|
public static Block hadron_plating_voltz;
|
||||||
|
public static Block hadron_coil_alloy;
|
||||||
|
public static Block hadron_coil_schrabidium;
|
||||||
|
public static Block hadron_coil_starmetal;
|
||||||
|
public static Block hadron_power;
|
||||||
|
public static Block hadron_access;
|
||||||
|
public static Block hadron_core;*/
|
||||||
|
|
||||||
machine_electric_furnace_off = new MachineElectricFurnace(false).setBlockName("machine_electric_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
machine_electric_furnace_off = new MachineElectricFurnace(false).setBlockName("machine_electric_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||||
machine_electric_furnace_on = new MachineElectricFurnace(true).setBlockName("machine_electric_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
machine_electric_furnace_on = new MachineElectricFurnace(true).setBlockName("machine_electric_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||||
machine_arc_furnace_off = new MachineArcFurnace(false).setBlockName("machine_arc_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
machine_arc_furnace_off = new MachineArcFurnace(false).setBlockName("machine_arc_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||||
@ -1936,6 +1976,32 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(machine_spp_bottom, machine_spp_bottom.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_spp_bottom, machine_spp_bottom.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_spp_top, machine_spp_top.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_spp_top, machine_spp_top.getUnlocalizedName());
|
||||||
|
|
||||||
|
GameRegistry.registerBlock(hadron_plating, hadron_plating.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_plating_blue, hadron_plating_blue.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_plating_black, hadron_plating_black.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_plating_yellow, hadron_plating_yellow.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_plating_striped, hadron_plating_striped.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_plating_glass, hadron_plating_glass.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_plating_voltz, hadron_plating_voltz.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_coil_alloy, hadron_coil_alloy.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_coil_schrabidium, hadron_coil_schrabidium.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_coil_starmetal, hadron_coil_starmetal.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(hadron_diode, hadron_diode.getUnlocalizedName());
|
||||||
|
|
||||||
|
/*public static Block hadron_plating;
|
||||||
|
public static Block hadron_plating_blue;
|
||||||
|
public static Block hadron_plating_black;
|
||||||
|
public static Block hadron_plating_yellow;
|
||||||
|
public static Block hadron_plating_striped;
|
||||||
|
public static Block hadron_plating_glass;
|
||||||
|
public static Block hadron_plating_voltz;
|
||||||
|
public static Block hadron_coil_alloy;
|
||||||
|
public static Block hadron_coil_schrabidium;
|
||||||
|
public static Block hadron_coil_starmetal;
|
||||||
|
public static Block hadron_power;
|
||||||
|
public static Block hadron_access;
|
||||||
|
public static Block hadron_core;*/
|
||||||
|
|
||||||
GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName());
|
GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(red_pylon, red_pylon.getUnlocalizedName());
|
GameRegistry.registerBlock(red_pylon, red_pylon.getUnlocalizedName());
|
||||||
|
|||||||
11
src/main/java/com/hbm/blocks/machine/BlockHadronCoil.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
|
public class BlockHadronCoil extends Block {
|
||||||
|
|
||||||
|
public BlockHadronCoil(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
}
|
||||||
|
}
|
||||||
81
src/main/java/com/hbm/blocks/machine/BlockHadronDiode.java
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityHadronDiode;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityHadronDiode.DiodeConfig;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class BlockHadronDiode extends BlockContainer {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon iconIn;
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon iconOut;
|
||||||
|
|
||||||
|
public BlockHadronDiode(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||||
|
return new TileEntityHadronDiode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
|
this.iconIn = iconRegister.registerIcon(RefStrings.MODID + ":hadron_diode_in");
|
||||||
|
this.iconOut = iconRegister.registerIcon(RefStrings.MODID + ":hadron_diode_out");
|
||||||
|
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":hadron_diode");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
|
||||||
|
TileEntityHadronDiode diode = (TileEntityHadronDiode) world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
DiodeConfig conf = diode.getConfig(side);
|
||||||
|
|
||||||
|
switch(conf) {
|
||||||
|
case NONE:
|
||||||
|
return blockIcon;
|
||||||
|
case IN:
|
||||||
|
return iconIn;
|
||||||
|
case OUT:
|
||||||
|
default:
|
||||||
|
return iconOut;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float fx, float fy, float fz) {
|
||||||
|
|
||||||
|
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.screwdriver) {
|
||||||
|
|
||||||
|
if(!world.isRemote) {
|
||||||
|
TileEntityHadronDiode diode = (TileEntityHadronDiode) world.getTileEntity(x, y, z);
|
||||||
|
int config = diode.getConfig(side).ordinal();
|
||||||
|
config += 1;
|
||||||
|
config %= DiodeConfig.values().length;
|
||||||
|
diode.setConfig(side, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
world.markBlockForUpdate(x, y, z);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/main/java/com/hbm/blocks/machine/BlockHadronPlating.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
|
public class BlockHadronPlating extends Block {
|
||||||
|
|
||||||
|
public BlockHadronPlating(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -3633,7 +3633,7 @@ public class ModItems {
|
|||||||
starmetal_legs = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_legs").setTextureName(RefStrings.MODID + ":starmetal_legs");
|
starmetal_legs = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_legs").setTextureName(RefStrings.MODID + ":starmetal_legs");
|
||||||
starmetal_boots = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_boots").setTextureName(RefStrings.MODID + ":starmetal_boots");
|
starmetal_boots = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_boots").setTextureName(RefStrings.MODID + ":starmetal_boots");
|
||||||
|
|
||||||
bj_helmet = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000).setMod(0.25F).setCap(7.5F)
|
bj_helmet = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000).setMod(0.25F).setCap(4.0F)
|
||||||
.setFireproof(true)
|
.setFireproof(true)
|
||||||
.enableThermalSight(true)
|
.enableThermalSight(true)
|
||||||
.addEffect(new PotionEffect(Potion.jump.id, 20, 0))
|
.addEffect(new PotionEffect(Potion.jump.id, 20, 0))
|
||||||
|
|||||||
@ -421,6 +421,7 @@ public class MainRegistry {
|
|||||||
GameRegistry.registerTileEntity(TileEntityTrappedBrick.class, "tileentity_trapped_brick");
|
GameRegistry.registerTileEntity(TileEntityTrappedBrick.class, "tileentity_trapped_brick");
|
||||||
GameRegistry.registerTileEntity(TileEntityPlasmaStruct.class, "tileentity_plasma_struct");
|
GameRegistry.registerTileEntity(TileEntityPlasmaStruct.class, "tileentity_plasma_struct");
|
||||||
GameRegistry.registerTileEntity(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine");
|
GameRegistry.registerTileEntity(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine");
|
||||||
|
GameRegistry.registerTileEntity(TileEntityHadronDiode.class, "tileentity_hadron_diode");
|
||||||
|
|
||||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.hbm.main;
|
package com.hbm.main;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -42,6 +43,7 @@ import cpw.mods.fml.common.gameevent.PlayerEvent;
|
|||||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
|
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
|
||||||
|
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.monster.EntityCreeper;
|
import net.minecraft.entity.monster.EntityCreeper;
|
||||||
@ -60,6 +62,7 @@ import net.minecraft.potion.PotionEffect;
|
|||||||
import net.minecraft.tileentity.TileEntitySign;
|
import net.minecraft.tileentity.TileEntitySign;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.FoodStats;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@ -330,17 +333,17 @@ public class ModEventHandler
|
|||||||
entity.getEntityData().setFloat("hfr_radiation", 2500);
|
entity.getEntityData().setFloat("hfr_radiation", 2500);
|
||||||
|
|
||||||
if(eRad >= 1000) {
|
if(eRad >= 1000) {
|
||||||
if(entity.attackEntityFrom(ModDamageSource.radiation, entity.getMaxHealth() * 100)) {
|
|
||||||
entity.getEntityData().setFloat("hfr_radiation", 0);
|
|
||||||
|
|
||||||
if(entity instanceof EntityPlayer)
|
entity.attackEntityFrom(ModDamageSource.radiation, 1000F);
|
||||||
((EntityPlayer)entity).triggerAchievement(MainRegistry.achRadDeath);
|
entity.getEntityData().setFloat("hfr_radiation", 0);
|
||||||
|
|
||||||
|
if(entity.getHealth() > 0) {
|
||||||
|
entity.setHealth(0);
|
||||||
|
entity.onDeath(ModDamageSource.radiation);
|
||||||
}
|
}
|
||||||
|
|
||||||
//.attackEntityFrom ensures the recentlyHit var is set to enable drops.
|
if(entity instanceof EntityPlayer)
|
||||||
//if the attack is canceled, then nothing will drop.
|
((EntityPlayer)entity).triggerAchievement(MainRegistry.achRadDeath);
|
||||||
//that's what you get for trying to cheat death
|
|
||||||
entity.setHealth(0);
|
|
||||||
|
|
||||||
} else if(eRad >= 800) {
|
} else if(eRad >= 800) {
|
||||||
if(event.world.rand.nextInt(300) == 0)
|
if(event.world.rand.nextInt(300) == 0)
|
||||||
@ -463,13 +466,18 @@ public class ModEventHandler
|
|||||||
|
|
||||||
/// BETA HEALTH START ///
|
/// BETA HEALTH START ///
|
||||||
if(player.getUniqueID().toString().equals(Library.Dr_Nostalgia)) {
|
if(player.getUniqueID().toString().equals(Library.Dr_Nostalgia)) {
|
||||||
if(player.getFoodStats().getFoodLevel() < 10) {
|
|
||||||
player.getFoodStats().setFoodLevel(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(player.getFoodStats().getFoodLevel() > 10) {
|
if(player.getFoodStats().getFoodLevel() > 10) {
|
||||||
player.heal(player.getFoodStats().getFoodLevel() - 10);
|
player.heal(player.getFoodStats().getFoodLevel() - 10);
|
||||||
player.getFoodStats().setFoodLevel(10);
|
}
|
||||||
|
|
||||||
|
if(player.getFoodStats().getFoodLevel() != 10) {
|
||||||
|
|
||||||
|
// Why can't you be normal??
|
||||||
|
try {
|
||||||
|
Field food = ReflectionHelper.findField(FoodStats.class, "field_149334_b", "foodLevel");
|
||||||
|
food.setInt(player.getFoodStats(), 10);
|
||||||
|
} catch(Exception e) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// BETA HEALTH END ///
|
/// BETA HEALTH END ///
|
||||||
|
|||||||
@ -0,0 +1,107 @@
|
|||||||
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
|
import com.hbm.tileentity.TileEntityTickingBase;
|
||||||
|
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
public class TileEntityHadronDiode extends TileEntityTickingBase {
|
||||||
|
|
||||||
|
int age = 0;
|
||||||
|
boolean fatherIAskOfYouToUpdateMe = false;
|
||||||
|
|
||||||
|
public DiodeConfig[] sides = new DiodeConfig[6];
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getInventoryName() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity() {
|
||||||
|
|
||||||
|
if(!worldObj.isRemote) {
|
||||||
|
age++;
|
||||||
|
|
||||||
|
if(age >= 20) {
|
||||||
|
age = 0;
|
||||||
|
sendSides();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(fatherIAskOfYouToUpdateMe) {
|
||||||
|
fatherIAskOfYouToUpdateMe = false;
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendSides() {
|
||||||
|
|
||||||
|
NBTTagCompound data = new NBTTagCompound();
|
||||||
|
|
||||||
|
for(int i = 0; i < 6; i++) {
|
||||||
|
|
||||||
|
if(sides[i] != null)
|
||||||
|
data.setInteger("" + i, sides[i].ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.networkPack(data, 250);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void networkUnpack(NBTTagCompound nbt) {
|
||||||
|
|
||||||
|
for(int i = 0; i < 6; i++) {
|
||||||
|
sides[i] = DiodeConfig.values()[nbt.getInteger("" + i)];
|
||||||
|
}
|
||||||
|
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DiodeConfig getConfig(int side) {
|
||||||
|
|
||||||
|
if(ForgeDirection.getOrientation(side) == ForgeDirection.UNKNOWN)
|
||||||
|
return DiodeConfig.NONE;
|
||||||
|
|
||||||
|
DiodeConfig conf = sides[side];
|
||||||
|
|
||||||
|
if(conf == null)
|
||||||
|
return DiodeConfig.NONE;
|
||||||
|
|
||||||
|
return conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfig(int side, int config) {
|
||||||
|
sides[side] = DiodeConfig.values()[config];
|
||||||
|
this.markDirty();
|
||||||
|
sendSides();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static enum DiodeConfig {
|
||||||
|
NONE,
|
||||||
|
IN,
|
||||||
|
OUT
|
||||||
|
}
|
||||||
|
|
||||||
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
|
super.readFromNBT(nbt);
|
||||||
|
|
||||||
|
for(int i = 0; i < 6; i++) {
|
||||||
|
sides[i] = DiodeConfig.values()[nbt.getInteger("side_" + i)];
|
||||||
|
}
|
||||||
|
|
||||||
|
fatherIAskOfYouToUpdateMe = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
|
super.writeToNBT(nbt);
|
||||||
|
|
||||||
|
for(int i = 0; i < 6; i++) {
|
||||||
|
|
||||||
|
if(sides[i] != null) {
|
||||||
|
nbt.setInteger("side_" + i, sides[i].ordinal());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -42,6 +42,9 @@ public class ContaminationUtil {
|
|||||||
if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
|
if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(e instanceof EntityPlayer && e.ticksExisted < 200)
|
||||||
|
return;
|
||||||
|
|
||||||
EntityLivingBase entity = (EntityLivingBase)e;
|
EntityLivingBase entity = (EntityLivingBase)e;
|
||||||
|
|
||||||
f *= calculateRadiationMod(entity);
|
f *= calculateRadiationMod(entity);
|
||||||
|
|||||||