Lithium and Tritium
@ -68,6 +68,8 @@ tile.float_bomb.name=Schwebebombe
|
||||
tile.therm_endo.name=Endothermische Bombe
|
||||
tile.therm_exo.name=Exothermische Bombe
|
||||
|
||||
tile.crashed_bomb.name=Blindgänger
|
||||
|
||||
tile.machine_difurnace_off.name=Legierungshochofen
|
||||
tile.machine_difurnace_on.name=Legierungshochofen
|
||||
container.diFurnace=Legierungshochofen
|
||||
@ -126,6 +128,7 @@ tile.fusion_motor.name=Magnetmotorstück
|
||||
tile.fusion_heater.name=Plasmaerhitzer
|
||||
tile.fusion_hatch.name=Fusionsreaktorzugriffsluke
|
||||
tile.fusion_core.name=Fusionsreaktorsteuerung
|
||||
tile.plasma.name=Plasma
|
||||
container.fusionMultiblock=Großer Fusionsreaktor
|
||||
|
||||
item.fuse.name=Sicherung
|
||||
@ -157,6 +160,9 @@ item.nugget_schrabidium.name=Schrabidiumnugget
|
||||
item.plate_copper.name=Kupferplatte
|
||||
item.ingot_advanced_alloy.name=Fortgeschrittene Legierung
|
||||
item.plate_advanced_alloy.name=Fortgeschrittene Legierungsplatte
|
||||
item.wire_advanced_alloy.name=Supraleiter
|
||||
item.coil_advanced_alloy.name=Supraleitende Magnetspule
|
||||
item.lithium.name=Lithiumwürfel
|
||||
|
||||
item.nugget_u235.name=U235-Nugget
|
||||
item.nugget_u238.name=U238-Nugget
|
||||
@ -236,6 +242,7 @@ item.battery_schrabidium.name=Schrabidiumbatterie
|
||||
item.battery_creative.name=Unendliche Batterie
|
||||
|
||||
item.fusion_core.name=Fusionskern
|
||||
item.energy_core.name=Selbstgebauter Energiekern
|
||||
|
||||
item.plate_iron.name=Eisenplatte
|
||||
item.plate_lead.name=Bleiplatte
|
||||
@ -257,7 +264,13 @@ item.cell_uf6.name=Uranhexafluorit-Zelle
|
||||
item.cell_puf6.name=Plutoniumhexafluorit-Zelle
|
||||
item.cell_antimatter.name=Antimaterienzelle
|
||||
item.cell_deuterium.name=Deuteriumzelle
|
||||
item.cell_tritium.name=Tritiumzelle
|
||||
item.cell_sas3.name=Schrabidiumtrisulfat-Zelle
|
||||
item.cell_anti_schrabidium.name=Antischrabidiumzelle
|
||||
|
||||
item.inf_water.name=Unendlicher Wassertank
|
||||
item.inf_deuterium.name=Unendlicher Deuteriumtank
|
||||
item.inf_tritium.name=Unendlicher Tritiumtank
|
||||
|
||||
item.canister_empty.name=Leerer Kanister
|
||||
item.canister_fuel.name=Treibstoffkanister
|
||||
@ -399,6 +412,14 @@ item.rod_coolant.name=Kühlzelle
|
||||
item.rod_dual_coolant.name=Doppelte Kühlzelle
|
||||
item.rod_quad_coolant.name=Vierfache Kühlzelle
|
||||
|
||||
item.rod_lithium.name=Lithiumstab
|
||||
item.rod_dual_lithium.name=Doppelter Lithiumstab
|
||||
item.rod_quad_lithium.name=Vierfacher Lithiumstab
|
||||
|
||||
item.rod_tritium.name=Tritiumzelle
|
||||
item.rod_dual_tritium.name=Doppelte Tritiumzelle
|
||||
item.rod_quad_tritium.name=Vierfache Tritiumzelle
|
||||
|
||||
item.levitation_unit.name=Gravitationsmanipulator
|
||||
item.thermo_unit_empty.name=Thermische Verteilungseinheit
|
||||
item.thermo_unit_endo.name=Kälteverteilungseinheit
|
||||
@ -561,4 +582,6 @@ item.fuel_tank_medium.name=Mittlerer Treibstofftank
|
||||
item.fuel_tank_large.name=Großer Treibstofftank
|
||||
item.thruster_small.name=Kleines Raketentriebwerk
|
||||
item.thruster_medium.name=Mittleres Raketentriebwerk
|
||||
item.thruster_large.name=Großes Raketentriebwerk
|
||||
item.thruster_large.name=Großes Raketentriebwerk
|
||||
|
||||
item.wand.name=Konstruktions-Zauberstab
|
||||
@ -68,6 +68,8 @@ tile.float_bomb.name=Levitation Bomb
|
||||
tile.therm_endo.name=Endothermic Bomb
|
||||
tile.therm_exo.name=Exothermic Bomb
|
||||
|
||||
tile.crashed_bomb.name=Dud
|
||||
|
||||
tile.machine_difurnace_off.name=Alloy Furnace
|
||||
tile.machine_difurnace_on.name=Alloy Furnace
|
||||
container.diFurnace=Alloy Furnace
|
||||
@ -126,6 +128,7 @@ tile.fusion_motor.name=Magnet Motor Piece
|
||||
tile.fusion_heater.name=Plasma Heater
|
||||
tile.fusion_hatch.name=Fusion Reactor Access Hatch
|
||||
tile.fusion_core.name=Fusion Reactor Control
|
||||
tile.plasma.name=Plasma
|
||||
container.fusionMultiblock=Big Fusion Reactor
|
||||
|
||||
item.fuse.name=Fuse
|
||||
@ -157,6 +160,9 @@ item.nugget_schrabidium.name=Schrabidium Nugget
|
||||
item.plate_copper.name=Copper Plate
|
||||
item.ingot_advanced_alloy.name=Advanced Alloy Ingot
|
||||
item.plate_advanced_alloy.name=Advanced Alloy Plate
|
||||
item.wire_advanced_alloy.name=Super Cunductor
|
||||
item.coil_advanced_alloy.name=Super Conducting Coil
|
||||
item.lithium.name=Lithium Cube
|
||||
|
||||
item.nugget_u235.name=U235 Nugget
|
||||
item.nugget_u238.name=U238 Nugget
|
||||
@ -236,6 +242,7 @@ item.battery_schrabidium.name=Schrabidium Battery
|
||||
item.battery_creative.name=Infinite Battery
|
||||
|
||||
item.fusion_core.name=Fusion Core
|
||||
item.energy_core.name=Makeshift Energy Core
|
||||
|
||||
item.plate_iron.name=Iron Plate
|
||||
item.plate_lead.name=Lead Plate
|
||||
@ -257,7 +264,13 @@ item.cell_uf6.name=Uranium Hexafluorite Cell
|
||||
item.cell_puf6.name=Plutonium Hexafluorite Cell
|
||||
item.cell_antimatter.name=Antimatter Cell
|
||||
item.cell_deuterium.name=Deuterium Cell
|
||||
item.cell_tritium.name=Tritium Cell
|
||||
item.cell_sas3.name=Schrabidiumtrisulfide Cell
|
||||
item.cell_anti_schrabidium.name=Antischrabidium Cell
|
||||
|
||||
item.inf_water.name=Infinite Water Tank
|
||||
item.inf_deuterium.name=Infinite Deuterium Tank
|
||||
item.inf_tritium.name=Infinite Tritium Tank
|
||||
|
||||
item.canister_empty.name=Empty Canister
|
||||
item.canister_fuel.name=Fuel Canister
|
||||
@ -400,6 +413,14 @@ item.rod_coolant.name=Coolant Cell
|
||||
item.rod_dual_coolant.name=Dual Coolant Cell
|
||||
item.rod_quad_coolant.name=Quad Coolant Cell
|
||||
|
||||
item.rod_lithium.name=Lithium Rod
|
||||
item.rod_dual_lithium.name=Dual Lithium Rod
|
||||
item.rod_quad_lithium.name=Quad Lithium Rod
|
||||
|
||||
item.rod_tritium.name=Tritium Cell
|
||||
item.rod_dual_tritium.name=Dual Tritium Cell
|
||||
item.rod_quad_tritium.name=Quad Tritium Cell
|
||||
|
||||
item.levitation_unit.name=Gravitymanipulator
|
||||
item.thermo_unit_empty.name=Thermic Distribution Unit
|
||||
item.thermo_unit_endo.name=Coldness Distribution Unit
|
||||
@ -562,4 +583,6 @@ item.fuel_tank_medium.name=Medium Fuel Tank
|
||||
item.fuel_tank_large.name=Large Fuel Tank
|
||||
item.thruster_small.name=Small Thruster
|
||||
item.thruster_medium.name=Medium Thruster
|
||||
item.thruster_large.name=Large Thruster
|
||||
item.thruster_large.name=Large Thruster
|
||||
|
||||
item.wand.name=Construction Wand
|
||||
BIN
assets/hbm/textures/blocks/crashed_balefire.png
Normal file
|
After Width: | Height: | Size: 248 B |
BIN
assets/hbm/textures/blocks/plasma.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
45
assets/hbm/textures/blocks/plasma.png.mcmeta
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"animation": {
|
||||
"frametime": 2,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
18,
|
||||
17,
|
||||
16,
|
||||
15,
|
||||
14,
|
||||
13,
|
||||
12,
|
||||
11,
|
||||
10,
|
||||
9,
|
||||
8,
|
||||
7,
|
||||
6,
|
||||
5,
|
||||
4,
|
||||
3,
|
||||
2,
|
||||
1
|
||||
]
|
||||
}
|
||||
}
|
||||
BIN
assets/hbm/textures/blocks/red_cable.png
Normal file
|
After Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 9.4 KiB |
BIN
assets/hbm/textures/items/alt.png
Normal file
|
After Width: | Height: | Size: 274 B |
BIN
assets/hbm/textures/items/cell_anti_schrabidium.png
Normal file
|
After Width: | Height: | Size: 247 B |
BIN
assets/hbm/textures/items/cell_tritium.png
Normal file
|
After Width: | Height: | Size: 252 B |
BIN
assets/hbm/textures/items/coil_advanced_alloy.png
Normal file
|
After Width: | Height: | Size: 297 B |
BIN
assets/hbm/textures/items/energy_core.png
Normal file
|
After Width: | Height: | Size: 284 B |
BIN
assets/hbm/textures/items/inf_deuterium.png
Normal file
|
After Width: | Height: | Size: 287 B |
BIN
assets/hbm/textures/items/inf_tritium.png
Normal file
|
After Width: | Height: | Size: 288 B |
BIN
assets/hbm/textures/items/inf_water.png
Normal file
|
After Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 361 B |
|
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 377 B |
BIN
assets/hbm/textures/items/rod_dual_lithium.png
Normal file
|
After Width: | Height: | Size: 278 B |
BIN
assets/hbm/textures/items/rod_dual_tritium.png
Normal file
|
After Width: | Height: | Size: 280 B |
BIN
assets/hbm/textures/items/rod_lithium.png
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
assets/hbm/textures/items/rod_quad_lithium.png
Normal file
|
After Width: | Height: | Size: 275 B |
BIN
assets/hbm/textures/items/rod_quad_tritium.png
Normal file
|
After Width: | Height: | Size: 280 B |
BIN
assets/hbm/textures/items/rod_tritium.png
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
assets/hbm/textures/items/wand.png
Normal file
|
After Width: | Height: | Size: 257 B |
BIN
assets/hbm/textures/items/wire_advanced_alloy.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
assets/hbm/textures/items/wire_copper - Kopie.png
Normal file
|
After Width: | Height: | Size: 233 B |
BIN
assets/hbm/textures/items/wire_red_copper - Kopie.png
Normal file
|
After Width: | Height: | Size: 250 B |
BIN
assets/hbm/textures/models/BaleFireCrashedUV.png
Normal file
|
After Width: | Height: | Size: 142 KiB |
BIN
assets/hbm/textures/models/BalefireCrashed.png
Normal file
|
After Width: | Height: | Size: 288 KiB |
37
com/hbm/blocks/BlockCable.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCable extends BlockContainer {
|
||||
|
||||
protected BlockCable(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
float p = 1F/16F;
|
||||
this.setBlockBounds(11 * p / 2, 11 * p / 2, 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2);
|
||||
this.useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityCable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
78
com/hbm/blocks/BlockCrashedBomb.java
Normal file
@ -0,0 +1,78 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.EntityNukeExplosionAdvanced;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCrashedBomb extends BlockContainer {
|
||||
|
||||
protected BlockCrashedBomb(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityCrashedBomb();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.crashed_balefire);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
if(i == 2)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
if(i == 3)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
55
com/hbm/blocks/BlockPlasma.java
Normal file
@ -0,0 +1,55 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPlasma extends Block {
|
||||
|
||||
protected BlockPlasma(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (world.getGameRules().getGameRuleBooleanValue("doFireTick"))
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_)
|
||||
{
|
||||
p_149670_5_.setFire(10);
|
||||
p_149670_5_.setInWeb();
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -116,6 +116,62 @@ public class FusionHatch extends Block {
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
if(world.getBlockMetadata(x, y, z) == 2)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z + 8) instanceof TileEntityFusionMultiblock)
|
||||
{
|
||||
if(((TileEntityFusionMultiblock)world.getTileEntity(x, y, z + 8)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_fusion_multiblock, world, x, y, z + 8);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Fusion Reactor Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 3)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z - 8) instanceof TileEntityFusionMultiblock)
|
||||
{
|
||||
if(((TileEntityFusionMultiblock)world.getTileEntity(x, y, z - 8)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_fusion_multiblock, world, x, y, z - 8);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Fusion Reactor Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 4)
|
||||
{
|
||||
if(world.getTileEntity(x + 8, y, z) instanceof TileEntityFusionMultiblock)
|
||||
{
|
||||
if(((TileEntityFusionMultiblock)world.getTileEntity(x + 8, y, z)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_fusion_multiblock, world, x + 8, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Fusion Reactor Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 5)
|
||||
{
|
||||
if(world.getTileEntity(x - 8, y, z) instanceof TileEntityFusionMultiblock)
|
||||
{
|
||||
if(((TileEntityFusionMultiblock)world.getTileEntity(x - 8, y, z)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_fusion_multiblock, world, x - 8, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Fusion Reactor Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@ -102,6 +102,7 @@ public class ModBlocks {
|
||||
public static Block det_cord;
|
||||
public static Block red_barrel;
|
||||
public static Block yellow_barrel;
|
||||
public static Block crashed_balefire;
|
||||
|
||||
public static Block nuke_gadget;
|
||||
public static final int guiID_nuke_gadget = 3;
|
||||
@ -169,6 +170,7 @@ public class ModBlocks {
|
||||
public static final int guiID_machine_coal = 22;
|
||||
|
||||
public static Block red_wire_coated;
|
||||
public static Block red_cable;
|
||||
|
||||
public static Block bomb_multi_large;
|
||||
public static final int guiID_bomb_multi_large = 18;
|
||||
@ -196,6 +198,7 @@ public class ModBlocks {
|
||||
public static Block fusion_heater;
|
||||
public static Block fusion_hatch;
|
||||
public static Block fusion_core;
|
||||
public static Block plasma;
|
||||
public static final int guiID_fusion_multiblock = 27;
|
||||
|
||||
public static Block launch_pad;
|
||||
@ -325,6 +328,7 @@ public class ModBlocks {
|
||||
det_cord = new DetCord(Material.iron).setBlockName("det_cord").setCreativeTab(MainRegistry.tabNuke).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_cord");
|
||||
red_barrel = new RedBarrel(Material.iron).setBlockName("red_barrel").setCreativeTab(MainRegistry.tabNuke).setHardness(0.5F).setResistance(2.5F);
|
||||
yellow_barrel = new YellowBarrel(Material.iron).setBlockName("yellow_barrel").setCreativeTab(MainRegistry.tabNuke).setHardness(0.5F).setResistance(2.5F);
|
||||
crashed_balefire = new BlockCrashedBomb(Material.iron).setBlockName("crashed_bomb").setCreativeTab(MainRegistry.tabNuke).setBlockUnbreakable().setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":crashed_balefire");
|
||||
|
||||
machine_difurnace_off = new MachineDiFurnace(false).setBlockName("machine_difurnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock);
|
||||
machine_difurnace_on = new MachineDiFurnace(true).setBlockName("machine_difurnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
@ -355,7 +359,8 @@ public class ModBlocks {
|
||||
machine_coal_off = new MachineCoal(false).setBlockName("machine_coal_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock);
|
||||
machine_coal_on = new MachineCoal(true).setBlockName("machine_coal_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
|
||||
red_wire_coated = new WireCoated(Material.iron).setBlockName("red_wire_coated").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":red_wire_coated");
|
||||
red_wire_coated = new WireCoated(Material.iron).setBlockName("red_wire_coated").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":red_wire_coated");
|
||||
red_cable = new BlockCable(Material.iron).setBlockName("red_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock);
|
||||
|
||||
factory_titanium_hull = new BlockGeneric(Material.iron).setBlockName("factory_titanium_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_hull");
|
||||
factory_titanium_furnace = new FactoryHatch(Material.iron).setBlockName("factory_titanium_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_furnace");
|
||||
@ -376,6 +381,7 @@ public class ModBlocks {
|
||||
fusion_heater = new BlockReactor(Material.iron).setBlockName("fusion_heater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":fusion_heater_side");
|
||||
fusion_hatch = new FusionHatch(Material.iron).setBlockName("fusion_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":fusion_hatch");
|
||||
fusion_core = new FusionCore(Material.iron).setBlockName("fusion_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":fusion_core_side");
|
||||
plasma = new BlockPlasma(Material.iron).setBlockName("plasma").setHardness(5.0F).setResistance(6000.0F).setLightLevel(1.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":plasma");
|
||||
|
||||
launch_pad = new LaunchPad(Material.iron).setBlockName("launch_pad").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":launch_pad");
|
||||
launch_pad_generic = new LaunchPad(Material.iron).setBlockName("launch_pad_generic").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":launch_pad");
|
||||
@ -499,6 +505,7 @@ public class ModBlocks {
|
||||
|
||||
//Generic Bombs
|
||||
GameRegistry.registerBlock(bomb_multi, bomb_multi.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crashed_balefire, crashed_balefire.getUnlocalizedName());
|
||||
//GameRegistry.registerBlock(bomb_multi_large, bomb_multi_large.getUnlocalizedName());
|
||||
|
||||
//Block Bombs
|
||||
@ -524,7 +531,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_coal_off, machine_coal_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_coal_on, machine_coal_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_generator, machine_generator.getUnlocalizedName());
|
||||
//GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_battery, machine_battery.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_electric_furnace_off, machine_electric_furnace_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_electric_furnace_on, machine_electric_furnace_on.getUnlocalizedName());
|
||||
@ -551,6 +559,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(fusion_heater, fusion_heater.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fusion_hatch, fusion_hatch.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fusion_core, fusion_core.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(plasma, plasma.getUnlocalizedName());
|
||||
|
||||
//Launch Pads
|
||||
GameRegistry.registerBlock(launch_pad, launch_pad.getUnlocalizedName());
|
||||
|
||||
7
com/hbm/blocks/TileEntityCable.java
Normal file
@ -0,0 +1,7 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityCable extends TileEntity {
|
||||
|
||||
}
|
||||
13
com/hbm/blocks/TileEntityCrashedBomb.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityCrashedBomb extends TileEntity {
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,87 +1,187 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.interfaces.IReactor;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityFusionMultiblock extends TileEntity implements ISidedInventory, IReactor {
|
||||
|
||||
public int water;
|
||||
public final static int waterMax = 10000000;
|
||||
public int deut;
|
||||
public final static int deutMax = 10000000;
|
||||
public int trit;
|
||||
public final static int tritMax = 10000000;
|
||||
public int power;
|
||||
public final static int maxPower = 10000000;
|
||||
private ItemStack slots[];
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityFusionMultiblock() {
|
||||
slots = new ItemStack[9];
|
||||
}
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
return slots.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int p_70301_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
return this.hasCustomInventoryName() ? this.customName : "container.fusionMultiblock";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||
{
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].stackSize <= j)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
}
|
||||
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||
if (slots[i].stackSize == 0)
|
||||
{
|
||||
slots[i] = null;
|
||||
}
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if(b0 >= 0 && b0 < slots.length)
|
||||
{
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
|
||||
water = nbt.getShort("water");
|
||||
deut = nbt.getShort("deut");
|
||||
power = nbt.getShort("power");
|
||||
trit = nbt.getShort("trit");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setShort("water", (short) water);
|
||||
nbt.setShort("deut", (short) deut);
|
||||
nbt.setShort("power", (short) power);
|
||||
nbt.setShort("trit", (short) trit);
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for(int i = 0; i < slots.length; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||
nbt1.setByte("slot", (byte)i);
|
||||
slots[i].writeToNBT(nbt1);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStructureValid(World world) {
|
||||
@ -625,21 +725,21 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord + 2) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord + 3) == ModBlocks.fusion_conductor &&
|
||||
|
||||
world.getBlock(this.xCoord + 6, this.yCoord, this.zCoord - 3) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 6, this.yCoord, this.zCoord - 2) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 6, this.yCoord, this.zCoord - 1) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 6, this.yCoord, this.zCoord + 0) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 6, this.yCoord, this.zCoord + 1) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 6, this.yCoord, this.zCoord + 2) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 6, this.yCoord, this.zCoord + 3) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 3, this.yCoord, this.zCoord + 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 2, this.yCoord, this.zCoord + 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord + 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 0, this.yCoord, this.zCoord + 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord + 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 2, this.yCoord, this.zCoord + 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 3, this.yCoord, this.zCoord + 6) == ModBlocks.fusion_conductor &&
|
||||
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord - 3) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord - 2) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord - 1) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord + 0) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord + 1) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord + 2) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 6, this.yCoord, this.zCoord + 3) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 3, this.yCoord, this.zCoord - 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 2, this.yCoord, this.zCoord - 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord - 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 0, this.yCoord, this.zCoord - 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord - 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 2, this.yCoord, this.zCoord - 6) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 3, this.yCoord, this.zCoord - 6) == ModBlocks.fusion_conductor &&
|
||||
|
||||
world.getBlock(this.xCoord + 5, this.yCoord, this.zCoord - 4) == ModBlocks.fusion_conductor &&
|
||||
world.getBlock(this.xCoord + 4, this.yCoord, this.zCoord - 5) == ModBlocks.fusion_conductor &&
|
||||
@ -830,62 +930,291 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve
|
||||
|
||||
@Override
|
||||
public boolean hasFuse() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getWaterScaled(int i) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
return (water * i) / waterMax;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCoolantScaled(int i) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
return (deut * i) / deutMax;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPowerScaled(int i) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getHeatScaled(int i) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
return (trit * i) / tritMax;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
public int getPowerScaled(int i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(isCoatingValid(worldObj))
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
worldObj.setBlock(xCoord, yCoord + 3, zCoord, Blocks.dirt);
|
||||
if(slots[0] != null && slots[0].getItem() == Items.water_bucket && this.water + 250000 <= waterMax)
|
||||
{
|
||||
this.slots[0].stackSize--;
|
||||
this.water += 250000;
|
||||
if(this.slots[0].stackSize == 0)
|
||||
{
|
||||
this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]);
|
||||
}
|
||||
}
|
||||
if(slots[0] != null && slots[0].getItem() == ModItems.rod_water && this.water + 250000 <= waterMax)
|
||||
{
|
||||
this.slots[0].stackSize--;
|
||||
this.water += 250000;
|
||||
if(this.slots[0].stackSize == 0)
|
||||
{
|
||||
this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]);
|
||||
}
|
||||
}
|
||||
if(slots[0] != null && slots[0].getItem() == ModItems.rod_dual_water && this.water + 500000 <= waterMax)
|
||||
{
|
||||
this.slots[0].stackSize--;
|
||||
this.water += 500000;
|
||||
if(this.slots[0].stackSize == 0)
|
||||
{
|
||||
this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]);
|
||||
}
|
||||
}
|
||||
if(slots[0] != null && slots[0].getItem() == ModItems.rod_quad_water && this.water + 1000000 <= waterMax)
|
||||
{
|
||||
this.slots[0].stackSize--;
|
||||
this.water += 1000000;
|
||||
if(this.slots[0].stackSize == 0)
|
||||
{
|
||||
this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if(slots[2] != null && slots[2].getItem() == ModItems.cell_deuterium && this.deut + 1000000 <= deutMax)
|
||||
{
|
||||
this.slots[2].stackSize--;
|
||||
this.deut += 1000000;
|
||||
}
|
||||
if(slots[3] != null && slots[3].getItem() == ModItems.cell_tritium && this.trit + 1000000 <= tritMax)
|
||||
{
|
||||
this.slots[3].stackSize--;
|
||||
this.trit += 1000000;
|
||||
}
|
||||
|
||||
if(slots[0] != null && slots[0].getItem() == ModItems.inf_water)
|
||||
{
|
||||
this.water = waterMax;
|
||||
}
|
||||
if(slots[2] != null && slots[2].getItem() == ModItems.inf_deuterium)
|
||||
{
|
||||
this.deut = deutMax;
|
||||
}
|
||||
if(slots[3] != null && slots[3].getItem() == ModItems.inf_tritium)
|
||||
{
|
||||
this.trit = tritMax;
|
||||
}
|
||||
|
||||
if(!isRunning() &&
|
||||
slots[4] != null && (slots[4].getItem() == ModItems.fusion_core || slots[4].getItem() == ModItems.energy_core) && slots[4].getItemDamage() == 0 &&
|
||||
slots[5] != null && (slots[5].getItem() == ModItems.fusion_core || slots[5].getItem() == ModItems.energy_core) && slots[5].getItemDamage() == 0 &&
|
||||
slots[6] != null && (slots[6].getItem() == ModItems.fusion_core || slots[6].getItem() == ModItems.energy_core) && slots[6].getItemDamage() == 0 &&
|
||||
slots[7] != null && (slots[7].getItem() == ModItems.fusion_core || slots[7].getItem() == ModItems.energy_core) && slots[7].getItemDamage() == 0 &&
|
||||
slots[8] != null && slots[8].getItem() == ModItems.fuse &&
|
||||
deut > 0 && trit > 0)
|
||||
{
|
||||
slots[4] = null;
|
||||
slots[5] = null;
|
||||
slots[6] = null;
|
||||
slots[7] = null;
|
||||
fillPlasma();
|
||||
} else {
|
||||
if(isStructureValid(worldObj) && isRunning())
|
||||
{
|
||||
deut -= 100;
|
||||
trit -= 100;
|
||||
|
||||
if(water - 1000 >= 0)
|
||||
{
|
||||
water -= 1000;
|
||||
power += 10000;
|
||||
|
||||
if(isCoatingValid(worldObj))
|
||||
{
|
||||
power += 10000;
|
||||
}
|
||||
|
||||
if(power > maxPower)
|
||||
{
|
||||
power = maxPower;
|
||||
}
|
||||
}
|
||||
|
||||
fillPlasma();
|
||||
} else {
|
||||
emptyPlasma();
|
||||
}
|
||||
}
|
||||
|
||||
if(!isRunning())
|
||||
{
|
||||
emptyPlasma();
|
||||
}
|
||||
|
||||
if(deut <= 0 || trit <= 0)
|
||||
{
|
||||
emptyPlasma();
|
||||
}
|
||||
if(power - 100 >= 0 && slots[1] != null && slots[1].getItem() == ModItems.battery_generic && slots[1].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[1].setItemDamage(slots[1].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[1] != null && slots[1].getItem() == ModItems.battery_advanced && slots[1].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[1].setItemDamage(slots[1].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[1] != null && slots[1].getItem() == ModItems.battery_schrabidium && slots[1].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[1].setItemDamage(slots[1].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[1] != null && slots[1].getItem() == ModItems.factory_core_titanium && slots[1].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[1].setItemDamage(slots[1].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[1] != null && slots[1].getItem() == ModItems.factory_core_advanced && slots[1].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[1].setItemDamage(slots[1].getItemDamage() - 1);
|
||||
}
|
||||
}
|
||||
if(isStructureValid(worldObj))
|
||||
}
|
||||
|
||||
public boolean isRunning() {
|
||||
if(slots[8] != null && slots[8].getItem() == ModItems.fuse && (
|
||||
worldObj.getBlock(xCoord + 4, yCoord, zCoord - 3) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 4, yCoord, zCoord - 2) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 4, yCoord, zCoord - 1) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 4, yCoord, zCoord + 0) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 4, yCoord, zCoord + 1) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 4, yCoord, zCoord + 2) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 4, yCoord, zCoord + 3) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 4, yCoord, zCoord - 3) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 4, yCoord, zCoord - 2) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 4, yCoord, zCoord - 1) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 4, yCoord, zCoord + 0) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 4, yCoord, zCoord + 1) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 4, yCoord, zCoord + 2) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 4, yCoord, zCoord + 3) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 3, yCoord, zCoord + 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 2, yCoord, zCoord + 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 1, yCoord, zCoord + 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 0, yCoord, zCoord + 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 1, yCoord, zCoord + 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 2, yCoord, zCoord + 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 3, yCoord, zCoord + 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 3, yCoord, zCoord - 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 2, yCoord, zCoord - 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 1, yCoord, zCoord - 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 0, yCoord, zCoord - 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 1, yCoord, zCoord - 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 2, yCoord, zCoord - 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 3, yCoord, zCoord - 4) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 3, yCoord, zCoord + 3) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord + 3, yCoord, zCoord - 3) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 3, yCoord, zCoord + 3) == ModBlocks.plasma ||
|
||||
worldObj.getBlock(xCoord - 3, yCoord, zCoord - 3) == ModBlocks.plasma))
|
||||
{
|
||||
worldObj.setBlock(xCoord, yCoord + 4, zCoord, Blocks.coal_block);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void fillPlasma() {
|
||||
setPlasma(xCoord + 4, yCoord, zCoord - 3);
|
||||
setPlasma(xCoord + 4, yCoord, zCoord - 2);
|
||||
setPlasma(xCoord + 4, yCoord, zCoord - 1);
|
||||
setPlasma(xCoord + 4, yCoord, zCoord + 0);
|
||||
setPlasma(xCoord + 4, yCoord, zCoord + 1);
|
||||
setPlasma(xCoord + 4, yCoord, zCoord + 2);
|
||||
setPlasma(xCoord + 4, yCoord, zCoord + 3);
|
||||
setPlasma(xCoord - 4, yCoord, zCoord - 3);
|
||||
setPlasma(xCoord - 4, yCoord, zCoord - 2);
|
||||
setPlasma(xCoord - 4, yCoord, zCoord - 1);
|
||||
setPlasma(xCoord - 4, yCoord, zCoord + 0);
|
||||
setPlasma(xCoord - 4, yCoord, zCoord + 1);
|
||||
setPlasma(xCoord - 4, yCoord, zCoord + 2);
|
||||
setPlasma(xCoord - 4, yCoord, zCoord + 3);
|
||||
setPlasma(xCoord - 3, yCoord, zCoord + 4);
|
||||
setPlasma(xCoord - 2, yCoord, zCoord + 4);
|
||||
setPlasma(xCoord - 1, yCoord, zCoord + 4);
|
||||
setPlasma(xCoord + 0, yCoord, zCoord + 4);
|
||||
setPlasma(xCoord + 1, yCoord, zCoord + 4);
|
||||
setPlasma(xCoord + 2, yCoord, zCoord + 4);
|
||||
setPlasma(xCoord + 3, yCoord, zCoord + 4);
|
||||
setPlasma(xCoord - 3, yCoord, zCoord - 4);
|
||||
setPlasma(xCoord - 2, yCoord, zCoord - 4);
|
||||
setPlasma(xCoord - 1, yCoord, zCoord - 4);
|
||||
setPlasma(xCoord + 0, yCoord, zCoord - 4);
|
||||
setPlasma(xCoord + 1, yCoord, zCoord - 4);
|
||||
setPlasma(xCoord + 2, yCoord, zCoord - 4);
|
||||
setPlasma(xCoord + 3, yCoord, zCoord - 4);
|
||||
setPlasma(xCoord + 3, yCoord, zCoord + 3);
|
||||
setPlasma(xCoord + 3, yCoord, zCoord - 3);
|
||||
setPlasma(xCoord - 3, yCoord, zCoord + 3);
|
||||
setPlasma(xCoord - 3, yCoord, zCoord - 3);
|
||||
}
|
||||
|
||||
public void emptyPlasma() {
|
||||
removePlasma(xCoord + 4, yCoord, zCoord - 3);
|
||||
removePlasma(xCoord + 4, yCoord, zCoord - 2);
|
||||
removePlasma(xCoord + 4, yCoord, zCoord - 1);
|
||||
removePlasma(xCoord + 4, yCoord, zCoord + 0);
|
||||
removePlasma(xCoord + 4, yCoord, zCoord + 1);
|
||||
removePlasma(xCoord + 4, yCoord, zCoord + 2);
|
||||
removePlasma(xCoord + 4, yCoord, zCoord + 3);
|
||||
removePlasma(xCoord - 4, yCoord, zCoord - 3);
|
||||
removePlasma(xCoord - 4, yCoord, zCoord - 2);
|
||||
removePlasma(xCoord - 4, yCoord, zCoord - 1);
|
||||
removePlasma(xCoord - 4, yCoord, zCoord + 0);
|
||||
removePlasma(xCoord - 4, yCoord, zCoord + 1);
|
||||
removePlasma(xCoord - 4, yCoord, zCoord + 2);
|
||||
removePlasma(xCoord - 4, yCoord, zCoord + 3);
|
||||
removePlasma(xCoord - 3, yCoord, zCoord + 4);
|
||||
removePlasma(xCoord - 2, yCoord, zCoord + 4);
|
||||
removePlasma(xCoord - 1, yCoord, zCoord + 4);
|
||||
removePlasma(xCoord + 0, yCoord, zCoord + 4);
|
||||
removePlasma(xCoord + 1, yCoord, zCoord + 4);
|
||||
removePlasma(xCoord + 2, yCoord, zCoord + 4);
|
||||
removePlasma(xCoord + 3, yCoord, zCoord + 4);
|
||||
removePlasma(xCoord - 3, yCoord, zCoord - 4);
|
||||
removePlasma(xCoord - 2, yCoord, zCoord - 4);
|
||||
removePlasma(xCoord - 1, yCoord, zCoord - 4);
|
||||
removePlasma(xCoord + 0, yCoord, zCoord - 4);
|
||||
removePlasma(xCoord + 1, yCoord, zCoord - 4);
|
||||
removePlasma(xCoord + 2, yCoord, zCoord - 4);
|
||||
removePlasma(xCoord + 3, yCoord, zCoord - 4);
|
||||
removePlasma(xCoord + 3, yCoord, zCoord + 3);
|
||||
removePlasma(xCoord + 3, yCoord, zCoord - 3);
|
||||
removePlasma(xCoord - 3, yCoord, zCoord + 3);
|
||||
removePlasma(xCoord - 3, yCoord, zCoord - 3);
|
||||
}
|
||||
|
||||
public void setPlasma(int x, int y, int z) {
|
||||
if(worldObj.getBlock(x, y, z) != ModBlocks.plasma)
|
||||
worldObj.setBlock(x, y, z, ModBlocks.plasma);
|
||||
}
|
||||
|
||||
public void removePlasma(int x, int y, int z) {
|
||||
if(worldObj.getBlock(x, y, z) == ModBlocks.plasma)
|
||||
worldObj.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -379,7 +379,7 @@ public class TileEntityWireCoated extends TileEntity {
|
||||
}
|
||||
}*/
|
||||
|
||||
Library.distributePower(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
//Library.distributePower(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -555,6 +555,7 @@ public class ExplosionParticle {
|
||||
world.spawnEntityInWorld(new EntitySmokeFX(world, x + 9, y + 6, z + 8,0.0, 0.0, 0.0));
|
||||
world.spawnEntityInWorld(new EntitySmokeFX(world, x + 4, y + 6, z + 9,0.0, 0.0, 0.0));
|
||||
world.spawnEntityInWorld(new EntitySmokeFX(world, x + 8, y + 6, z + 9,0.0, 0.0, 0.0));*/
|
||||
y--;
|
||||
world.spawnEntityInWorld(new EntitySmokeFX(world, x + 5, y + 7, z + 5,0.0, 0.0, 0.0));
|
||||
world.spawnEntityInWorld(new EntitySmokeFX(world, x + 7, y + 7, z + 5,0.0, 0.0, 0.0));
|
||||
world.spawnEntityInWorld(new EntitySmokeFX(world, x + 5, y + 7, z + 7,0.0, 0.0, 0.0));
|
||||
|
||||
141
com/hbm/gui/ContainerFusionMultiblock.java
Normal file
@ -0,0 +1,141 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import com.hbm.blocks.TileEntityFusionMultiblock;
|
||||
import com.hbm.blocks.TileEntityReactorMultiblock;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerFusionMultiblock extends Container {
|
||||
|
||||
private TileEntityFusionMultiblock diFurnace;
|
||||
|
||||
private int water;
|
||||
private int deut;
|
||||
private int power;
|
||||
private int trit;
|
||||
private boolean isRunning;
|
||||
|
||||
public ContainerFusionMultiblock(InventoryPlayer invPlayer, TileEntityFusionMultiblock tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 26, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 134, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 152, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 53, 45));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 107, 45));
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 53, 81));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 107, 81));
|
||||
this.addSlotToContainer(new Slot(tedf, 8, 80, 63));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, this.diFurnace.water);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.deut);
|
||||
crafting.sendProgressBarUpdate(this, 2, this.diFurnace.power);
|
||||
crafting.sendProgressBarUpdate(this, 3, this.diFurnace.trit);
|
||||
crafting.sendProgressBarUpdate(this, 4, isRunning ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.water != this.diFurnace.water)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 0, this.diFurnace.water);
|
||||
}
|
||||
|
||||
if(this.deut != this.diFurnace.deut)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.deut);
|
||||
}
|
||||
|
||||
if(this.power != this.diFurnace.power)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 2, this.diFurnace.power);
|
||||
}
|
||||
|
||||
if(this.trit != this.diFurnace.trit)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 3, this.diFurnace.trit);
|
||||
}
|
||||
|
||||
if(this.isRunning != this.diFurnace.isRunning())
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 4, this.diFurnace.isRunning() ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
this.water = this.diFurnace.water;
|
||||
this.deut = this.diFurnace.deut;
|
||||
this.power = this.diFurnace.power;
|
||||
this.trit = this.diFurnace.trit;
|
||||
this.isRunning = this.diFurnace.isRunning();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 0)
|
||||
{
|
||||
diFurnace.water = j;
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
diFurnace.deut = j;
|
||||
}
|
||||
if(i == 2)
|
||||
{
|
||||
diFurnace.power = j;
|
||||
}
|
||||
if(i == 3)
|
||||
{
|
||||
diFurnace.trit = j;
|
||||
}
|
||||
if(i == 4)
|
||||
{
|
||||
if(j == 0)
|
||||
{
|
||||
diFurnace.emptyPlasma();
|
||||
} else {
|
||||
diFurnace.fillPlasma();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
com/hbm/gui/GUIFusionMultiblock.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.TileEntityFusionMultiblock;
|
||||
import com.hbm.blocks.TileEntityReactorMultiblock;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIFusionMultiblock extends GuiContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_fusion_multiblock.png");
|
||||
private TileEntityFusionMultiblock diFurnace;
|
||||
|
||||
public GUIFusionMultiblock(InventoryPlayer invPlayer, TileEntityFusionMultiblock tedf) {
|
||||
super(new ContainerFusionMultiblock(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int i = diFurnace.getWaterScaled(88);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 106 - i, 176, 88 - i, 16, i);
|
||||
|
||||
int j = diFurnace.getCoolantScaled(88);
|
||||
drawTexturedModalRect(guiLeft + 134, guiTop + 106 - j, 208, 88 - j, 16, j);
|
||||
|
||||
int k = diFurnace.getPowerScaled(88);
|
||||
drawTexturedModalRect(guiLeft + 26, guiTop + 106 - k, 192, 88 - k, 16, k);
|
||||
|
||||
int l = diFurnace.getHeatScaled(88);
|
||||
drawTexturedModalRect(guiLeft + 152, guiTop + 106 - l, 224, 88 - l, 16, l);
|
||||
|
||||
if(diFurnace.isRunning())
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 18, 240, 0, 16, 16);
|
||||
}
|
||||
}
|
||||
@ -16,18 +16,12 @@ public class ItemBattery extends Item {
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
if(itemstack.getItem() != ModItems.fusion_core && itemstack.getItem() != ModItems.factory_core_titanium && itemstack.getItem() != ModItems.factory_core_advanced)
|
||||
if(itemstack.getItem() != ModItems.fusion_core && itemstack.getItem() != ModItems.factory_core_titanium && itemstack.getItem() != ModItems.factory_core_advanced && itemstack.getItem() != ModItems.energy_core)
|
||||
{
|
||||
list.add("Energy stored: " + ((this.getMaxDamage() - this.getDamage(itemstack)) * 100) + " HE");
|
||||
} else {
|
||||
if(this.getDamage(itemstack) != 0)
|
||||
{
|
||||
int charge = ((this.getMaxDamage() - this.getDamage(itemstack)) * 100) / this.getMaxDamage();
|
||||
charge++;
|
||||
list.add("Charge: " + charge + "%");
|
||||
} else {
|
||||
list.add("Charge: 100%");
|
||||
}
|
||||
int charge = ((this.getMaxDamage() - this.getDamage(itemstack)) * 100) / this.getMaxDamage();
|
||||
list.add("Charge: " + charge + "%");
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +33,7 @@ public class ItemBattery extends Item {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
if(this == ModItems.fusion_core || this == ModItems.factory_core_titanium || this == ModItems.factory_core_advanced)
|
||||
if(this == ModItems.fusion_core || this == ModItems.factory_core_titanium || this == ModItems.factory_core_advanced || this == ModItems.energy_core)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
66
com/hbm/items/ItemCell.java
Normal file
@ -0,0 +1,66 @@
|
||||
package com.hbm.items;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockCrashedBomb;
|
||||
import com.hbm.blocks.LaunchPad;
|
||||
import com.hbm.entity.EntityNukeExplosionAdvanced;
|
||||
import com.hbm.explosion.ExplosionParticle;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemCell extends Item {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
|
||||
{
|
||||
if(world.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) instanceof BlockCrashedBomb)
|
||||
{
|
||||
Random rand = new Random();
|
||||
int i = rand.nextInt(100);
|
||||
if(i == 0)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
EntityNukeExplosionAdvanced entity0 = new EntityNukeExplosionAdvanced(world);
|
||||
entity0.posX = p_77648_4_;
|
||||
entity0.posY = p_77648_5_;
|
||||
entity0.posZ = p_77648_6_;
|
||||
entity0.destructionRange = 35;
|
||||
entity0.speed = 25;
|
||||
entity0.coefficient = 10.0F;
|
||||
|
||||
world.spawnEntityInWorld(entity0);
|
||||
ExplosionParticle.spawnMush(world, p_77648_4_, p_77648_5_ - 3, p_77648_6_);
|
||||
}
|
||||
} else if(i < 90)
|
||||
{
|
||||
//if (!world.isRemote)
|
||||
{
|
||||
player.inventory.consumeInventoryItem(ModItems.cell_empty);
|
||||
|
||||
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.cell_antimatter)))
|
||||
{
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.cell_antimatter, 1, 0), false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//if (!world.isRemote)
|
||||
{
|
||||
player.inventory.consumeInventoryItem(ModItems.cell_empty);
|
||||
|
||||
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.cell_anti_schrabidium)))
|
||||
{
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.cell_anti_schrabidium, 1, 0), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -299,6 +299,21 @@ public class ItemCustomLore extends Item {
|
||||
list.add("from a reactor will instantly shut");
|
||||
list.add("it down.");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_lithium)
|
||||
{
|
||||
list.add("Turns into Tritium Rod");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_dual_lithium)
|
||||
{
|
||||
list.add("Turns into Dual Tritium Rod");
|
||||
}
|
||||
|
||||
if(this == ModItems.rod_quad_lithium)
|
||||
{
|
||||
list.add("Turns into Quad Tritium Rod");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -48,6 +48,6 @@ public class ItemDesingator extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
110
com/hbm/items/ItemWand.java
Normal file
@ -0,0 +1,110 @@
|
||||
package com.hbm.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.LaunchPad;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemWand extends Item {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
list.add("§5Creative-only item");
|
||||
list.add("§5\"§oDestruction brings creation§5\"");
|
||||
list.add("(Set positions with right click,");
|
||||
list.add("set block with shift-right click!)");
|
||||
|
||||
if(itemstack.stackTagCompound != null &&
|
||||
!(itemstack.stackTagCompound.getInteger("x") == 0 &&
|
||||
itemstack.stackTagCompound.getInteger("y") == 0 &&
|
||||
itemstack.stackTagCompound.getInteger("z") == 0))
|
||||
{
|
||||
list.add("Pos: " + itemstack.stackTagCompound.getInteger("x") + ", " + itemstack.stackTagCompound.getInteger("y") + ", " + itemstack.stackTagCompound.getInteger("z"));
|
||||
} else {
|
||||
list.add("Positions not set!");
|
||||
}
|
||||
if(itemstack.stackTagCompound != null)
|
||||
list.add("Block saved: " + Block.getBlockById(itemstack.stackTagCompound.getInteger("block")).getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
|
||||
{
|
||||
if(p_77648_1_.stackTagCompound == null)
|
||||
{
|
||||
p_77648_1_.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
|
||||
if(p_77648_2_.isSneaking())
|
||||
{
|
||||
p_77648_1_.stackTagCompound.setInteger("block", Block.getIdFromBlock(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_)));
|
||||
p_77648_1_.stackTagCompound.setInteger("meta", p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_));
|
||||
if(p_77648_3_.isRemote)
|
||||
p_77648_2_.addChatMessage(new ChatComponentText("Set block " + Block.getBlockById(p_77648_1_.stackTagCompound.getInteger("block")).getUnlocalizedName()));
|
||||
} else {
|
||||
if(p_77648_1_.stackTagCompound.getInteger("x") == 0 &&
|
||||
p_77648_1_.stackTagCompound.getInteger("y") == 0 &&
|
||||
p_77648_1_.stackTagCompound.getInteger("z") == 0)
|
||||
{
|
||||
p_77648_1_.stackTagCompound.setInteger("x", p_77648_4_);
|
||||
p_77648_1_.stackTagCompound.setInteger("y", p_77648_5_);
|
||||
p_77648_1_.stackTagCompound.setInteger("z", p_77648_6_);
|
||||
if(p_77648_3_.isRemote)
|
||||
p_77648_2_.addChatMessage(new ChatComponentText("Position set!"));
|
||||
} else {
|
||||
|
||||
int x = p_77648_1_.stackTagCompound.getInteger("x");
|
||||
int y = p_77648_1_.stackTagCompound.getInteger("y");
|
||||
int z = p_77648_1_.stackTagCompound.getInteger("z");
|
||||
|
||||
p_77648_1_.stackTagCompound.setInteger("x", 0);
|
||||
p_77648_1_.stackTagCompound.setInteger("y", 0);
|
||||
p_77648_1_.stackTagCompound.setInteger("z", 0);
|
||||
|
||||
if(!p_77648_3_.isRemote)
|
||||
{
|
||||
for(int i = Math.min(x, p_77648_4_); i <= Math.max(x, p_77648_4_); i++)
|
||||
{
|
||||
for(int j = Math.min(y, p_77648_5_); j <= Math.max(y, p_77648_5_); j++)
|
||||
{
|
||||
for(int k = Math.min(z, p_77648_6_); k <= Math.max(z, p_77648_6_); k++)
|
||||
{
|
||||
p_77648_3_.setBlock(i, j, k, Block.getBlockById(p_77648_1_.stackTagCompound.getInteger("block")), p_77648_1_.stackTagCompound.getInteger("meta"), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(p_77648_3_.isRemote)
|
||||
p_77648_2_.addChatMessage(new ChatComponentText("Selection filled!"));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(stack.stackTagCompound == null)
|
||||
{
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
if(player.isSneaking())
|
||||
{
|
||||
stack.stackTagCompound.setInteger("block", 0);
|
||||
stack.stackTagCompound.setInteger("meta", 0);
|
||||
if(world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("Set block " + Block.getBlockById(stack.stackTagCompound.getInteger("block")).getUnlocalizedName()));
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
}
|
||||
@ -54,6 +54,7 @@ public class ModItems {
|
||||
public static Item nugget_mox_fuel;
|
||||
public static Item nugget_schrabidium_fuel;
|
||||
public static Item ingot_advanced_alloy;
|
||||
public static Item lithium;
|
||||
|
||||
public static Item nugget_uranium;
|
||||
public static Item nugget_u235;
|
||||
@ -103,6 +104,8 @@ public class ModItems {
|
||||
public static Item wire_copper;
|
||||
public static Item wire_gold;
|
||||
public static Item wire_schrabidium;
|
||||
public static Item wire_advanced_alloy;
|
||||
public static Item coil_advanced_alloy;
|
||||
|
||||
public static Item circuit_aluminium;
|
||||
public static Item circuit_copper;
|
||||
@ -156,9 +159,14 @@ public class ModItems {
|
||||
public static Item cell_empty;
|
||||
public static Item cell_uf6;
|
||||
public static Item cell_puf6;
|
||||
public static Item cell_antimatter;
|
||||
public static Item cell_deuterium;
|
||||
public static Item cell_tritium;
|
||||
public static Item cell_sas3;
|
||||
public static Item cell_antimatter;
|
||||
public static Item cell_anti_schrabidium;
|
||||
public static Item inf_water;
|
||||
public static Item inf_deuterium;
|
||||
public static Item inf_tritium;
|
||||
|
||||
public static Item canister_empty;
|
||||
public static Item canister_fuel;
|
||||
@ -249,6 +257,13 @@ public class ModItems {
|
||||
public static Item rod_dual_waste;
|
||||
public static Item rod_quad_waste;
|
||||
|
||||
public static Item rod_lithium;
|
||||
public static Item rod_dual_lithium;
|
||||
public static Item rod_quad_lithium;
|
||||
public static Item rod_tritium;
|
||||
public static Item rod_dual_tritium;
|
||||
public static Item rod_quad_tritium;
|
||||
|
||||
public static Item test_nuke_igniter;
|
||||
public static Item test_nuke_propellant;
|
||||
public static Item test_nuke_tier1_shielding;
|
||||
@ -356,6 +371,7 @@ public class ModItems {
|
||||
public static Item battery_creative;
|
||||
|
||||
public static Item fusion_core;
|
||||
public static Item energy_core;
|
||||
public static Item fuse;
|
||||
|
||||
public static Item factory_core_titanium;
|
||||
@ -398,6 +414,8 @@ public class ModItems {
|
||||
public static Item hazmat_plate;
|
||||
public static Item hazmat_legs;
|
||||
public static Item hazmat_boots;
|
||||
|
||||
public static Item wand;
|
||||
|
||||
public static Item nuke_starter_kit;
|
||||
public static Item nuke_advanced_kit;
|
||||
@ -484,6 +502,9 @@ public class ModItems {
|
||||
plate_copper = new Item().setUnlocalizedName("plate_copper").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":plate_copper");
|
||||
plate_gold = new Item().setUnlocalizedName("plate_gold").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":plate_gold");
|
||||
plate_advanced_alloy = new Item().setUnlocalizedName("plate_advanced_alloy").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":plate_advanced_alloy");
|
||||
lithium = new Item().setUnlocalizedName("lithium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":lithium");
|
||||
wire_advanced_alloy = new Item().setUnlocalizedName("wire_advanced_alloy").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":wire_advanced_alloy");
|
||||
coil_advanced_alloy = new Item().setUnlocalizedName("coil_advanced_alloy").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":coil_advanced_alloy");
|
||||
|
||||
nugget_uranium = new Item().setUnlocalizedName("nugget_uranium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_uranium");
|
||||
nugget_u235 = new Item().setUnlocalizedName("nugget_u235").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_uranium");
|
||||
@ -574,12 +595,17 @@ public class ModItems {
|
||||
|
||||
pellet_rtg = new ItemCustomLore().setUnlocalizedName("pellet_rtg").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_rtg");
|
||||
|
||||
cell_empty = new Item().setUnlocalizedName("cell_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":cell_empty");
|
||||
cell_empty = new ItemCell().setUnlocalizedName("cell_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":cell_empty");
|
||||
cell_uf6 = new Item().setUnlocalizedName("cell_uf6").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_uf6");
|
||||
cell_puf6 = new Item().setUnlocalizedName("cell_puf6").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_puf6");
|
||||
cell_antimatter = new Item().setUnlocalizedName("cell_antimatter").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_antimatter");
|
||||
cell_deuterium = new Item().setUnlocalizedName("cell_deuterium").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_deuterium");
|
||||
cell_tritium = new Item().setUnlocalizedName("cell_tritium").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_tritium");
|
||||
cell_sas3 = new ItemCustomLore().setUnlocalizedName("cell_sas3").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_sas3");
|
||||
cell_anti_schrabidium = new Item().setUnlocalizedName("cell_anti_schrabidium").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.cell_empty).setTextureName(RefStrings.MODID + ":cell_anti_schrabidium");
|
||||
inf_water = new Item().setUnlocalizedName("inf_water").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":inf_water");
|
||||
inf_deuterium = new Item().setUnlocalizedName("inf_deuterium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":inf_deuterium");
|
||||
inf_tritium = new Item().setUnlocalizedName("inf_tritium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":inf_tritium");
|
||||
|
||||
canister_empty = new ItemCustomLore().setUnlocalizedName("canister_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":canister_empty");
|
||||
canister_fuel = new ItemCustomLore().setUnlocalizedName("canister_fuel").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_fuel");
|
||||
@ -644,7 +670,7 @@ public class ModItems {
|
||||
rod_dual_schrabidium_fuel = new ItemFuelRod().setUnlocalizedName("rod_dual_schrabidium_fuel").setMaxStackSize(1).setMaxDamage(5000000).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_schrabidium_fuel");
|
||||
rod_quad_schrabidium_fuel = new ItemFuelRod().setUnlocalizedName("rod_quad_schrabidium_fuel").setMaxStackSize(1).setMaxDamage(10000000).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_schrabidium_fuel");
|
||||
|
||||
rod_water= new ItemCustomLore().setUnlocalizedName("rod_water").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_water");
|
||||
rod_water = new ItemCustomLore().setUnlocalizedName("rod_water").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_water");
|
||||
rod_dual_water = new ItemCustomLore().setUnlocalizedName("rod_dual_water").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_water");
|
||||
rod_quad_water = new ItemCustomLore().setUnlocalizedName("rod_quad_water").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_water");
|
||||
|
||||
@ -652,6 +678,14 @@ public class ModItems {
|
||||
rod_dual_coolant = new ItemCustomLore().setUnlocalizedName("rod_dual_coolant").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_coolant");
|
||||
rod_quad_coolant = new ItemCustomLore().setUnlocalizedName("rod_quad_coolant").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_coolant");
|
||||
|
||||
rod_lithium = new ItemCustomLore().setUnlocalizedName("rod_lithium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_lithium");
|
||||
rod_dual_lithium = new ItemCustomLore().setUnlocalizedName("rod_dual_lithium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_lithium");
|
||||
rod_quad_lithium = new ItemCustomLore().setUnlocalizedName("rod_quad_lithium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_lithium");
|
||||
|
||||
rod_tritium = new ItemCustomLore().setUnlocalizedName("rod_tritium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_tritium");
|
||||
rod_dual_tritium = new ItemCustomLore().setUnlocalizedName("rod_dual_tritium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_tritium");
|
||||
rod_quad_tritium = new ItemCustomLore().setUnlocalizedName("rod_quad_tritium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_tritium");
|
||||
|
||||
trinitite = new Item().setUnlocalizedName("trinitite").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":trinitite_new");
|
||||
nuclear_waste = new Item().setUnlocalizedName("nuclear_waste").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nuclear_waste");
|
||||
rod_uranium_fuel_depleted = new Item().setUnlocalizedName("rod_uranium_fuel_depleted").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_uranium_fuel_depleted");
|
||||
@ -766,11 +800,14 @@ public class ModItems {
|
||||
battery_creative = new Item().setUnlocalizedName("battery_creative").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_creative");
|
||||
|
||||
fusion_core = new ItemBattery(5000).setUnlocalizedName("fusion_core").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fusion_core");
|
||||
energy_core = new ItemBattery(5000).setUnlocalizedName("energy_core").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":energy_core");
|
||||
fuse = new ItemCustomLore().setUnlocalizedName("fuse").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fuse");
|
||||
|
||||
factory_core_titanium = new ItemBattery(70400).setUnlocalizedName("factory_core_titanium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":factory_core_titanium");
|
||||
factory_core_advanced = new ItemBattery(41600).setUnlocalizedName("factory_core_advanced").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":factory_core_advanced");
|
||||
|
||||
wand = new ItemWand().setUnlocalizedName("wand").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setFull3D().setTextureName(RefStrings.MODID + ":wand");
|
||||
|
||||
nuke_starter_kit = new ItemStarterKit().setUnlocalizedName("nuke_starter_kit").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":nuke_starter_kit");
|
||||
nuke_advanced_kit = new ItemStarterKit().setUnlocalizedName("nuke_advanced_kit").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":nuke_advanced_kit");
|
||||
nuke_commercially_kit = new ItemStarterKit().setUnlocalizedName("nuke_commercially_kit").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":nuke_commercially_kit");
|
||||
@ -884,6 +921,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(ingot_schrabidium_fuel, ingot_schrabidium_fuel.getUnlocalizedName());
|
||||
|
||||
//Dusts & Other
|
||||
GameRegistry.registerItem(lithium, lithium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(sulfur, sulfur.getUnlocalizedName());
|
||||
GameRegistry.registerItem(niter, niter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fluorite, fluorite.getUnlocalizedName());
|
||||
@ -930,12 +968,14 @@ public class ModItems {
|
||||
GameRegistry.registerItem(wire_copper, wire_copper.getUnlocalizedName());
|
||||
GameRegistry.registerItem(wire_tungsten, wire_tungsten.getUnlocalizedName());
|
||||
GameRegistry.registerItem(wire_red_copper, wire_red_copper.getUnlocalizedName());
|
||||
GameRegistry.registerItem(wire_advanced_alloy, wire_advanced_alloy.getUnlocalizedName());
|
||||
GameRegistry.registerItem(wire_gold, wire_gold.getUnlocalizedName());
|
||||
GameRegistry.registerItem(wire_schrabidium, wire_schrabidium.getUnlocalizedName());
|
||||
|
||||
//Parts
|
||||
GameRegistry.registerItem(coil_copper, coil_copper.getUnlocalizedName());
|
||||
GameRegistry.registerItem(coil_copper_torus, coil_copper_torus.getUnlocalizedName());
|
||||
GameRegistry.registerItem(coil_advanced_alloy, coil_advanced_alloy.getUnlocalizedName());
|
||||
GameRegistry.registerItem(coil_tungsten, coil_tungsten.getUnlocalizedName());
|
||||
GameRegistry.registerItem(tank_steel, tank_steel.getUnlocalizedName());
|
||||
GameRegistry.registerItem(motor, motor.getUnlocalizedName());
|
||||
@ -1010,8 +1050,15 @@ public class ModItems {
|
||||
GameRegistry.registerItem(cell_uf6, cell_uf6.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cell_puf6, cell_puf6.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cell_deuterium, cell_deuterium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cell_tritium, cell_tritium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cell_sas3, cell_sas3.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cell_antimatter, cell_antimatter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cell_anti_schrabidium, cell_anti_schrabidium.getUnlocalizedName());
|
||||
|
||||
//Infinite Tanks
|
||||
GameRegistry.registerItem(inf_water, inf_water.getUnlocalizedName());
|
||||
GameRegistry.registerItem(inf_deuterium, inf_deuterium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(inf_tritium, inf_tritium.getUnlocalizedName());
|
||||
|
||||
//Canisters
|
||||
GameRegistry.registerItem(canister_empty, canister_empty.getUnlocalizedName());
|
||||
@ -1024,6 +1071,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(battery_schrabidium, battery_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(battery_creative, battery_creative.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fusion_core, fusion_core.getUnlocalizedName());
|
||||
GameRegistry.registerItem(energy_core, energy_core.getUnlocalizedName());
|
||||
GameRegistry.registerItem(factory_core_titanium, factory_core_titanium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(factory_core_advanced, factory_core_advanced.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fuse, fuse.getUnlocalizedName());
|
||||
@ -1097,6 +1145,14 @@ public class ModItems {
|
||||
GameRegistry.registerItem(rod_dual_coolant, rod_dual_coolant.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rod_quad_coolant, rod_quad_coolant.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(rod_lithium, rod_lithium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rod_dual_lithium, rod_dual_lithium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rod_quad_lithium, rod_quad_lithium.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(rod_tritium, rod_tritium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rod_dual_tritium, rod_dual_tritium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rod_quad_tritium, rod_quad_tritium.getUnlocalizedName());
|
||||
|
||||
//Nuclear Waste
|
||||
GameRegistry.registerItem(rod_uranium_fuel_depleted, rod_uranium_fuel_depleted.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rod_dual_uranium_fuel_depleted, rod_dual_uranium_fuel_depleted.getUnlocalizedName());
|
||||
@ -1261,6 +1317,9 @@ public class ModItems {
|
||||
GameRegistry.registerItem(watch, watch.getUnlocalizedName());
|
||||
GameRegistry.registerItem(mask_of_infamy, mask_of_infamy.getUnlocalizedName());
|
||||
|
||||
//OP Tools
|
||||
GameRegistry.registerItem(wand, wand.getUnlocalizedName());
|
||||
|
||||
//Kits
|
||||
GameRegistry.registerItem(nuke_starter_kit, nuke_starter_kit.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nuke_advanced_kit, nuke_advanced_kit.getUnlocalizedName());
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.world.Antenna;
|
||||
import com.hbm.world.Bunker;
|
||||
import com.hbm.world.CrashedVertibird;
|
||||
import com.hbm.world.DesertAtom001;
|
||||
import com.hbm.world.Dud;
|
||||
import com.hbm.world.Factory;
|
||||
import com.hbm.world.LibraryDungeon;
|
||||
import com.hbm.world.Radio01;
|
||||
@ -262,6 +263,15 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
|
||||
new Factory().generate(world, rand, x, y, z);
|
||||
}
|
||||
|
||||
if(rand.nextInt(500) == 0)
|
||||
{
|
||||
int x = i + rand.nextInt(16);
|
||||
int z = j + rand.nextInt(16);
|
||||
int y = world.getHeightValue(x, z);
|
||||
|
||||
new Dud().generate(world, rand, x, y, z);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.TileEntityBombMulti;
|
||||
import com.hbm.blocks.TileEntityCable;
|
||||
import com.hbm.blocks.TileEntityCrashedBomb;
|
||||
import com.hbm.blocks.TileEntityDecoBlock;
|
||||
import com.hbm.blocks.TileEntityDecoBlockAlt;
|
||||
import com.hbm.blocks.TileEntityDecoBlockAltF;
|
||||
@ -94,7 +96,9 @@ import com.hbm.render.ItemRenderTestContainer;
|
||||
import com.hbm.render.ModEffectRenderer;
|
||||
import com.hbm.render.RenderBigNuke;
|
||||
import com.hbm.render.RenderBombMulti;
|
||||
import com.hbm.render.RenderCable;
|
||||
import com.hbm.render.RenderCentrifuge;
|
||||
import com.hbm.render.RenderCrashedBomb;
|
||||
import com.hbm.render.RenderDecoBlock;
|
||||
import com.hbm.render.RenderDecoBlockAlt;
|
||||
import com.hbm.render.RenderFlare;
|
||||
@ -191,6 +195,8 @@ public class ClientProxy extends ServerProxy
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTestMissile.class, new RenderTestMissile());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeFleija.class, new RenderNukeFleija());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrashedBomb.class, new RenderCrashedBomb());
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNukeCloudSmall.class, new RenderSmallNukeAlt());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNukeCloudBig.class, new RenderBigNuke());
|
||||
@ -223,6 +229,8 @@ public class ClientProxy extends ServerProxy
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaunchPad.class, new RenderLaunchPadTier1());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCable.class, new RenderCable());
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMissileGeneric.class, new RenderMissileGeneric());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMissileAntiBallistic.class, new RenderMissileGeneric());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMissileIncendiary.class, new RenderMissileGeneric());
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.blocks.TileEntityBombMulti;
|
||||
import com.hbm.blocks.TileEntityCoreAdvanced;
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.blocks.TileEntityDiFurnace;
|
||||
import com.hbm.blocks.TileEntityFusionMultiblock;
|
||||
import com.hbm.blocks.TileEntityLaunchPad;
|
||||
import com.hbm.blocks.TileEntityMachineBattery;
|
||||
import com.hbm.blocks.TileEntityMachineCoal;
|
||||
@ -32,6 +33,7 @@ import com.hbm.gui.ContainerCentrifuge;
|
||||
import com.hbm.gui.ContainerCoreAdvanced;
|
||||
import com.hbm.gui.ContainerCoreTitanium;
|
||||
import com.hbm.gui.ContainerElectricFurnace;
|
||||
import com.hbm.gui.ContainerFusionMultiblock;
|
||||
import com.hbm.gui.ContainerGenerator;
|
||||
import com.hbm.gui.ContainerLaunchPadTier1;
|
||||
import com.hbm.gui.ContainerMachineBattery;
|
||||
@ -54,6 +56,7 @@ import com.hbm.gui.ContainerUF6Tank;
|
||||
import com.hbm.gui.GUIBombMulti;
|
||||
import com.hbm.gui.GUICoreAdvanced;
|
||||
import com.hbm.gui.GUICoreTitanium;
|
||||
import com.hbm.gui.GUIFusionMultiblock;
|
||||
import com.hbm.gui.GUILaunchPadTier1;
|
||||
import com.hbm.gui.GUIMachineBattery;
|
||||
import com.hbm.gui.GUIMachineCentrifuge;
|
||||
@ -290,6 +293,14 @@ public class GUIHandler implements IGuiHandler {
|
||||
return new ContainerReactorMultiblock(player.inventory, (TileEntityReactorMultiblock) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_fusion_multiblock:
|
||||
{
|
||||
if(entity instanceof TileEntityFusionMultiblock)
|
||||
{
|
||||
return new ContainerFusionMultiblock(player.inventory, (TileEntityFusionMultiblock) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -502,6 +513,14 @@ public class GUIHandler implements IGuiHandler {
|
||||
return new GUIReactorMultiblock(player.inventory, (TileEntityReactorMultiblock) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_fusion_multiblock:
|
||||
{
|
||||
if(entity instanceof TileEntityFusionMultiblock)
|
||||
{
|
||||
return new GUIFusionMultiblock(player.inventory, (TileEntityFusionMultiblock) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -19,14 +19,17 @@ import cpw.mods.fml.common.ModMetadata;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.TileEntityBombMulti;
|
||||
import com.hbm.blocks.TileEntityCable;
|
||||
import com.hbm.blocks.TileEntityCoreAdvanced;
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.blocks.TileEntityCrashedBomb;
|
||||
import com.hbm.blocks.TileEntityDecoBlock;
|
||||
import com.hbm.blocks.TileEntityDecoPoleSatelliteReceiver;
|
||||
import com.hbm.blocks.TileEntityDecoPoleTop;
|
||||
import com.hbm.blocks.TileEntityDecoSteelPoles;
|
||||
import com.hbm.blocks.TileEntityDecoTapeRecorder;
|
||||
import com.hbm.blocks.TileEntityDiFurnace;
|
||||
import com.hbm.blocks.TileEntityFusionMultiblock;
|
||||
import com.hbm.blocks.TileEntityLaunchPad;
|
||||
import com.hbm.blocks.TileEntityMachineBattery;
|
||||
import com.hbm.blocks.TileEntityMachineCoal;
|
||||
@ -206,6 +209,9 @@ public class MainRegistry
|
||||
GameRegistry.registerTileEntity(TileEntityCoreTitanium.class, "tileentity_core_titanium");
|
||||
GameRegistry.registerTileEntity(TileEntityCoreAdvanced.class, "tileentity_core_advanced");
|
||||
GameRegistry.registerTileEntity(TileEntityReactorMultiblock.class, "tileentity_reactor_multiblock");
|
||||
GameRegistry.registerTileEntity(TileEntityFusionMultiblock.class, "tileentity_fusion_multiblock");
|
||||
GameRegistry.registerTileEntity(TileEntityCrashedBomb.class, "tileentity_crashed_balefire");
|
||||
GameRegistry.registerTileEntity(TileEntityCable.class, "tileentity_cable");
|
||||
|
||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||
|
||||
77
com/hbm/render/RenderCable.java
Normal file
@ -0,0 +1,77 @@
|
||||
package com.hbm.render;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class RenderCable extends TileEntitySpecialRenderer {
|
||||
|
||||
public ResourceLocation texture = new ResourceLocation(RefStrings.MODID, "textures/blocks/red_cable.png");
|
||||
float pixel = 1F/16F;
|
||||
float textureP = 1F / 32F;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double offsetX, double offsetY, double offsetZ, float f) {
|
||||
GL11.glTranslated(offsetX, offsetY, offsetZ);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.bindTexture(texture);
|
||||
drawCore(tileentity);
|
||||
drawConnection(ForgeDirection.UP);
|
||||
GL11.glTranslated(-offsetX, -offsetY, -offsetZ);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
}
|
||||
|
||||
public void drawCore(TileEntity tileentity) {
|
||||
Tessellator tesseract = Tessellator.instance;
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP);
|
||||
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP);
|
||||
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 5 * textureP);
|
||||
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 5 * textureP);
|
||||
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP);
|
||||
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP);
|
||||
tesseract.draw();
|
||||
}
|
||||
|
||||
public void drawConnection(ForgeDirection direction)
|
||||
{
|
||||
if(direction.equals(ForgeDirection.UP))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Tessellator tesseract = Tessellator.instance;
|
||||
tesseract.draw();
|
||||
}
|
||||
|
||||
}
|
||||
50
com/hbm/render/RenderCrashedBomb.java
Normal file
@ -0,0 +1,50 @@
|
||||
package com.hbm.render;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
public class RenderCrashedBomb extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation objTesterModelRL = new ResourceLocation(/*"/assets/" + */RefStrings.MODID, "models/BalefireCrashed.obj");
|
||||
private IModelCustom manModel;
|
||||
private ResourceLocation manTexture;
|
||||
|
||||
public RenderCrashedBomb()
|
||||
{
|
||||
manModel = AdvancedModelLoader.loadModel(objTesterModelRL);
|
||||
manTexture = new ResourceLocation(RefStrings.MODID, "textures/models/BalefireCrashed.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
switch(tileEntity.getBlockMetadata())
|
||||
{
|
||||
case 5:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 2:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 4:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 3:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
bindTexture(manTexture);
|
||||
manModel.renderAll();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
92
com/hbm/world/Dud.java
Normal file
@ -0,0 +1,92 @@
|
||||
package com.hbm.world;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.HbmChestContents;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class Dud extends WorldGenerator
|
||||
{
|
||||
Block Block1 = ModBlocks.steel_scaffold;
|
||||
Block Block2 = ModBlocks.machine_difurnace_off;
|
||||
Block Block3 = ModBlocks.factory_titanium_core;
|
||||
Block Block4 = ModBlocks.steel_wall;
|
||||
Block Block5 = ModBlocks.reinforced_light;
|
||||
|
||||
protected Block[] GetValidSpawnBlocks()
|
||||
{
|
||||
return new Block[]
|
||||
{
|
||||
Blocks.grass,
|
||||
Blocks.dirt,
|
||||
Blocks.stone,
|
||||
Blocks.sand,
|
||||
Blocks.sandstone,
|
||||
};
|
||||
}
|
||||
|
||||
public boolean LocationIsValidSpawn(World world, int x, int y, int z)
|
||||
{
|
||||
|
||||
Block checkBlock = world.getBlock(x, y - 1, z);
|
||||
Block blockAbove = world.getBlock(x, y , z);
|
||||
Block blockBelow = world.getBlock(x, y - 2, z);
|
||||
|
||||
for (Block i : GetValidSpawnBlocks())
|
||||
{
|
||||
if (blockAbove != Blocks.air)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (checkBlock == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (checkBlock == Blocks.snow_layer && blockBelow == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (checkBlock.getMaterial() == Material.plants && blockBelow == i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean generate(World world, Random rand, int x, int y, int z)
|
||||
{
|
||||
int i = rand.nextInt(1);
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
generate_r0(world, rand, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public boolean generate_r0(World world, Random rand, int x, int y, int z)
|
||||
{
|
||||
if(!LocationIsValidSpawn(world, x, y, z))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
world.setBlock(x, y, z, ModBlocks.crashed_balefire, rand.nextInt(4) + 2, 3);
|
||||
if(MainRegistry.enableDebugMode)
|
||||
System.out.print("[Debug] Successfully spawned dud at " + x + " " + y +" " + z + "\n");
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||