Watz-tastic stuff

This commit is contained in:
HbmMods 2016-06-28 23:20:42 +02:00
parent ce50cdf444
commit 952ff60d38
63 changed files with 1773 additions and 52 deletions

View File

@ -5,6 +5,7 @@ itemGroup.tabNuke=Nuclear Tech Mod Bomben
death.attack.nuclearBlast=%1$s wurde von einer Atomexplosion weggeblasen.
death.attack.revolverBullet=%1$s wurde von %2$s in den Kopf geschossen.
death.attack.mudPoisoning=%1$s starb an Giftschlamm.
item.redstone_sword.name=Redstoneschwert
item.big_sword.name=Großes Schwert
@ -137,6 +138,15 @@ tile.fusion_core.name=Fusionsreaktorsteuerung
tile.plasma.name=Plasma
container.fusionMultiblock=Großer Fusionsreaktor
tile.watz_element.name=Watzreaktionskammer
tile.watz_control.name=Verstärkte Steuerstäbe
tile.watz_cooler.name=Watz-Superkühler
tile.watz_end.name=Watz-Stabilitätselement
tile.watz_hatch.name=Watzreaktorzugriffsluke
tile.watz_conductor.name=Watz-Stromanschluss
tile.watz_core.name=Watzreaktorkern
container.watzPowerplant=Watzkraftwerk
item.fuse.name=Sicherung
tile.test_nuke.name=Test Atombombe
@ -595,7 +605,7 @@ item.thruster_small.name=Kleines Raketentriebwerk
item.thruster_medium.name=Mittleres Raketentriebwerk
item.thruster_large.name=Großes Raketentriebwerk
item.wand.name=Konstruktions-Zauberstab
item.wand_k.name=Konstruktions-Zauberstab
item.wand_s.name=Struktur-Zauberstab
item.steel_helmet.name=Stahlhelm
@ -646,3 +656,22 @@ item.matchstick.name=Streichholz
item.redcoil_capacitor.name=Rotspulenkondensator
item.detonator.name=Fernzünder
item.ingot_hes.name=Stark angereicherter Schrabidiumkernbrennstoffbarren
item.ingot_les.name=Schwach angereicherter Schrabidiumkernbrennstoffbarren
item.nugget_hes.name=Stark angereichertes Schrabidiumkernbrennstoffnugget
item.nugget_les.name=Schwach angereichertes Schrabidiumkernbrennstoffnugget
item.pellet_schrabidium.name=Pures Schrabidium-Watzpellet
item.pellet_hes.name=HES-Watzpellet
item.pellet_mes.name=MES-Watzpellet
item.pellet_les.name=LES-Watzpellet
item.pellet_beryllium.name=Beryllium-Moderatonspellet
item.pellet_neptunium.name=Neptunium-Watzpellet
item.pellet_lead.name=Bleireflektorpellet
item.pellet_advanced.name=Fortgeschrittenes Watzaufwertugspellet
item.titanium_filter.name=Titanfilter
tile.mud_block.name=Giftiger Schlamm
item.bucket_mud.name=Eimer mit giftigem Schlamm

View File

@ -5,6 +5,7 @@ itemGroup.tabNuke=Nuclear Tech Mod Nukes
death.attack.nuclearBlast=%1$s was blown away by a nuclear explosion.
death.attack.revolverBullet=%1$s was shot in the head by %2$s.
death.attack.mudPoisoning=%1$s died in poisonous mud.
item.redstone_sword.name=Redstone Sword
item.big_sword.name=Great Sword
@ -137,6 +138,15 @@ tile.fusion_core.name=Fusion Reactor Control
tile.plasma.name=Plasma
container.fusionMultiblock=Big Fusion Reactor
tile.watz_element.name=Watz Reaction Chamber
tile.watz_control.name=Reinforced Control Rods
tile.watz_cooler.name=Watz Reactor Supercooler
tile.watz_end.name=Watz Reactor Stability Element
tile.watz_hatch.name=Watz Reactor Access Hatch
tile.watz_conductor.name=Watz Electricity Port
tile.watz_core.name=Watz Reactor Control
container.watzPowerplant=Watz Power Plant
item.fuse.name=Fuse
tile.test_nuke.name=Test Nuke
@ -369,7 +379,6 @@ item.missile_kit.name=Missile Kit
item.t45_kit.name=T45 Power Armor Kit
item.euphemium_kit.name=Euphemium Kit
tile.waste_earth.name=Dead Grass
tile.waste_trinitite.name=Trinitite Ore
tile.waste_trinitite_red.name=Red Trinitite Ore
@ -596,7 +605,7 @@ item.thruster_small.name=Small Thruster
item.thruster_medium.name=Medium Thruster
item.thruster_large.name=Large Thruster
item.wand.name=Construction Wand
item.wand_k.name=Construction Wand
item.wand_s.name=Structure Wand
item.steel_helmet.name=Steel Helmet
@ -647,3 +656,22 @@ item.matchstick.name=Matchstick
item.redcoil_capacitor.name=Redcoil Capacitor
item.detonator.name=Detonator
item.ingot_hes.name=Higly Enriched Schrabidium Fuel Ingot
item.ingot_les.name=Low Enriched Schrabidium Fuel Ingot
item.nugget_hes.name=Higly Enriched Schrabidium Fuel Nugget
item.nugget_les.name=Low Enriched Schrabidium Fuel Nugget
item.pellet_schrabidium.name=Pure Schrabidium Watz Pellet
item.pellet_hes.name=HES Watz Pellet
item.pellet_mes.name=MES Watz Pellet
item.pellet_les.name=LES Watz Pellet
item.pellet_beryllium.name=Beryllium Moderator Pellet
item.pellet_neptunium.name=Neptunium Watz Pellet
item.pellet_lead.name=Lead Reflector Pellet
item.pellet_advanced.name=Advanced Watz Performance Improver
item.titanium_filter.name=Titanium Filter
tile.mud_block.name=Poisonous Mud
item.bucket_mud.name=Bucket of Poisonous Mud

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View 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
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

View File

@ -66,6 +66,21 @@ public class BlockReactor extends Block {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":factory_advanced_conductor");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":factory_advanced_hull");
}
if(this == ModBlocks.watz_element)
{
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":watz_element_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":watz_element_side");
}
if(this == ModBlocks.watz_control)
{
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":watz_control_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":watz_control_side");
}
if(this == ModBlocks.watz_conductor)
{
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":watz_conductor_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":watz_conductor_side");
}
}
@Override

View File

@ -127,7 +127,7 @@ public class FusionHatch extends Block {
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Structure not valid!"));
}
} else {
player.addChatMessage(new ChatComponentText("[Fusion Reactor Error: Reactor Core not found!"));
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Core not found!"));
}
}
if(world.getBlockMetadata(x, y, z) == 3)
@ -141,7 +141,7 @@ public class FusionHatch extends Block {
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Structure not valid!"));
}
} else {
player.addChatMessage(new ChatComponentText("[Fusion Reactor Error: Reactor Core not found!"));
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Core not found!"));
}
}
if(world.getBlockMetadata(x, y, z) == 4)
@ -155,7 +155,7 @@ public class FusionHatch extends Block {
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Structure not valid!"));
}
} else {
player.addChatMessage(new ChatComponentText("[Fusion Reactor Error: Reactor Core not found!"));
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Core not found!"));
}
}
if(world.getBlockMetadata(x, y, z) == 5)
@ -169,7 +169,7 @@ public class FusionHatch extends Block {
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Structure not valid!"));
}
} else {
player.addChatMessage(new ChatComponentText("[Fusion Reactor Error: Reactor Core not found!"));
player.addChatMessage(new ChatComponentText("[Fusion Reactor] Error: Reactor Core not found!"));
}
}
return true;

View File

@ -3,12 +3,17 @@ package com.hbm.blocks;
import com.hbm.items.ItemPlasmaBlock;
import com.hbm.items.ItemPrototypeBlock;
import com.hbm.items.ItemSchrabidiumBlock;
import com.hbm.lib.ModDamageSource;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
public class ModBlocks {
@ -206,6 +211,15 @@ public class ModBlocks {
public static Block plasma;
public static final int guiID_fusion_multiblock = 27;
public static Block watz_element;
public static Block watz_control;
public static Block watz_cooler;
public static Block watz_end;
public static Block watz_hatch;
public static Block watz_conductor;
public static Block watz_core;
public static final int guiID_watz_multiblock = 32;
public static Block machine_converter_he_rf;
public static final int guiID_converter_he_rf = 28;
@ -244,6 +258,10 @@ public class ModBlocks {
public static Block statue_elb_w;
public static Block statue_elb_f;
public static Block mud_block;
public static Fluid mud_fluid;
public static final Material fluidmud = (new MaterialLiquid(MapColor.adobeColor));
private static void initializeBlock() {
@ -406,6 +424,14 @@ public class ModBlocks {
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");
watz_element = new BlockReactor(Material.iron).setBlockName("watz_element").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":watz_element");
watz_control = new BlockReactor(Material.iron).setBlockName("watz_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":watz_control");
watz_cooler = new BlockGeneric(Material.iron).setBlockName("watz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":watz_cooler");
watz_end = new BlockGeneric(Material.iron).setBlockName("watz_end").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":watz_end");
watz_hatch = new WatzHatch(Material.iron).setBlockName("watz_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":watz_hatch");
watz_conductor = new BlockReactor(Material.iron).setBlockName("watz_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":watz_conductor");
watz_core = new WatzCore(Material.iron).setBlockName("watz_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":watz_computer");
machine_converter_he_rf = new BlockConverterHeRf(Material.iron).setBlockName("machine_converter_he_rf").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_converter_he_rf");
machine_converter_rf_he = new BlockConverterRfHe(Material.iron).setBlockName("machine_converter_rf_he").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_converter_rf_he");
@ -435,6 +461,10 @@ public class ModBlocks {
statue_elb_g = new DecoBlockAlt(Material.iron).setBlockName("#void").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY);
statue_elb_w = new DecoBlockAlt(Material.iron).setBlockName("#ngtv").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY);
statue_elb_f = new DecoBlockAlt(Material.iron).setBlockName("#undef").setHardness(Float.POSITIVE_INFINITY).setLightLevel(1.0F).setResistance(Float.POSITIVE_INFINITY);
mud_fluid = new MudFluid().setDensity(2500).setViscosity(3000).setLuminosity(5).setTemperature(2773).setUnlocalizedName("mud_fluid");
FluidRegistry.registerFluid(mud_fluid);
mud_block = new MudBlock(mud_fluid, fluidmud.setReplaceable(), ModDamageSource.mudPoisoning).setBlockName("mud_block");
}
private static void registerBlock() {
@ -596,6 +626,14 @@ public class ModBlocks {
GameRegistry.registerBlock(fusion_core, fusion_core.getUnlocalizedName());
GameRegistry.registerBlock(plasma, ItemPlasmaBlock.class, plasma.getUnlocalizedName());
GameRegistry.registerBlock(watz_element, watz_element.getUnlocalizedName());
GameRegistry.registerBlock(watz_control, watz_control.getUnlocalizedName());
GameRegistry.registerBlock(watz_cooler, watz_cooler.getUnlocalizedName());
GameRegistry.registerBlock(watz_end, watz_end.getUnlocalizedName());
GameRegistry.registerBlock(watz_hatch, watz_hatch.getUnlocalizedName());
GameRegistry.registerBlock(watz_conductor, watz_conductor.getUnlocalizedName());
GameRegistry.registerBlock(watz_core, watz_core.getUnlocalizedName());
//Launch Pads
GameRegistry.registerBlock(launch_pad, launch_pad.getUnlocalizedName());
GameRegistry.registerBlock(launch_pad_generic, launch_pad_generic.getUnlocalizedName());
@ -623,5 +661,8 @@ public class ModBlocks {
GameRegistry.registerBlock(statue_elb_g, statue_elb_g.getUnlocalizedName());
GameRegistry.registerBlock(statue_elb_w, statue_elb_w.getUnlocalizedName());
GameRegistry.registerBlock(statue_elb_f, statue_elb_f.getUnlocalizedName());
//Fluids
GameRegistry.registerBlock(mud_block, mud_block.getUnlocalizedName());
}
}

View File

@ -0,0 +1,83 @@
package com.hbm.blocks;
import java.util.Random;
import com.hbm.lib.ModDamageSource;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
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.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
public class MudBlock extends BlockFluidClassic {
@SideOnly(Side.CLIENT)
public static IIcon stillIcon;
@SideOnly(Side.CLIENT)
public static IIcon flowingIcon;
public static DamageSource damageSource;
public MudBlock(Fluid fluid, Material material, DamageSource damage) {
super(fluid, material);
damageSource = damage;
setQuantaPerBlock(4);
setCreativeTab(null);
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return (side == 0 || side == 1) ? stillIcon : flowingIcon;
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister register) {
stillIcon = register.registerIcon(RefStrings.MODID + ":mud_still");
flowingIcon = register.registerIcon(RefStrings.MODID + ":mud_flowing");
}
public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
if (world.getBlock(x, y, z).getMaterial().isLiquid())
return false;
return super.canDisplace(world, x, y, z);
}
public boolean displaceIfPossible(World world, int x, int y, int z) {
if (world.getBlock(x, y, z).getMaterial().isLiquid())
return false;
return super.displaceIfPossible(world, x, y, z);
}
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
entity.motionY *= 0.05D;
entity.motionZ *= 0.05D;
entity.motionX *= 0.05D;
if (!world.isRemote) {
entity.attackEntityFrom(damageSource, 8.0F);
}
if(entity.fallDistance > 2)
entity.fallDistance = 2;
}
public void updateTick(World world, int x, int y, int z, Random rand) {
super.updateTick(world, x, y, z, rand);
}
public int tickRate(World p_149738_1_)
{
return 15;
}
}

View File

@ -0,0 +1,28 @@
package com.hbm.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.IIcon;
import net.minecraftforge.fluids.Fluid;
public class MudFluid extends Fluid {
public MudFluid() {
super("liquidHelium");
}
@SideOnly(Side.CLIENT)
public IIcon getIcon() {
return getStillIcon();
}
@SideOnly(Side.CLIENT)
public IIcon getStillIcon() {
return MudBlock.stillIcon;
}
@SideOnly(Side.CLIENT)
public IIcon getFlowingIcon() {
return MudBlock.flowingIcon;
}
}

View File

@ -13,8 +13,8 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityConverterHeRf extends TileEntity implements IConsumer, IEnergyProvider {
public int power;
public final int maxPower = 10000;
public EnergyStorage storage = new EnergyStorage(40000, 25000, 25000);
public final int maxPower = 1000000;
public EnergyStorage storage = new EnergyStorage(4000000, 2500000, 2500000);
//Thanks to the great people of Fusion Warfare for helping me with this part.
@ -22,6 +22,16 @@ public class TileEntityConverterHeRf extends TileEntity implements IConsumer, IE
public void updateEntity() {
if (!worldObj.isRemote) {
if(power >= 100000 && storage.getEnergyStored() + 400000 <= storage.getMaxEnergyStored())
{
power -= 100000;
storage.setEnergyStored(storage.getEnergyStored() + 400000);
}
if(power >= 10000 && storage.getEnergyStored() + 40000 <= storage.getMaxEnergyStored())
{
power -= 10000;
storage.setEnergyStored(storage.getEnergyStored() + 40000);
}
if(power >= 1000 && storage.getEnergyStored() + 4000 <= storage.getMaxEnergyStored())
{
power -= 1000;

View File

@ -19,15 +19,25 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityConverterRfHe extends TileEntity implements ISource, IEnergyReceiver {
public int power;
public final int maxPower = 10000;
public final int maxPower = 1000000;
public List<IConsumer> list = new ArrayList();
public int age = 0;
public EnergyStorage storage = new EnergyStorage(40000, 25000, 25000);
public EnergyStorage storage = new EnergyStorage(4000000, 2500000, 2500000);
@Override
public void updateEntity() {
if (!worldObj.isRemote) {
if(storage.getEnergyStored() >= 400000 && power + 100000 <= maxPower)
{
storage.setEnergyStored(storage.getEnergyStored() - 400000);
power += 100000;
}
if(storage.getEnergyStored() >= 40000 && power + 10000 <= maxPower)
{
storage.setEnergyStored(storage.getEnergyStored() - 40000);
power += 10000;
}
if(storage.getEnergyStored() >= 4000 && power + 1000 <= maxPower)
{
storage.setEnergyStored(storage.getEnergyStored() - 4000);

View File

@ -0,0 +1,769 @@
package com.hbm.blocks;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.hbm.calc.UnionOfTileEntitiesAndBooleans;
import com.hbm.interfaces.IConductor;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IReactor;
import com.hbm.interfaces.ISource;
import com.hbm.items.ModItems;
import com.hbm.items.WatzFuel;
import com.hbm.lib.Library;
import net.minecraft.block.Block;
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 TileEntityWatzCore extends TileEntity implements ISidedInventory, IReactor, ISource {
public int waste;
public final static int wasteMax = 10000000;
public int power;
public final static int maxPower = 100000000;
public int heat;
public int heatMultiplier;
public int powerMultiplier;
public int decayMultiplier;
public int heatList;
public int wasteList;
public int powerList;
Random rand = new Random();
private ItemStack slots[];
public int age = 0;
public List<IConsumer> list = new ArrayList();
private String customName;
public TileEntityWatzCore() {
slots = new ItemStack[39];
}
@Override
public int getSizeInventory() {
return slots.length;
}
@Override
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 void setInventorySlotContents(int i, ItemStack itemStack) {
slots[i] = itemStack;
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
{
itemStack.stackSize = getInventoryStackLimit();
}
}
@Override
public String getInventoryName() {
return this.hasCustomInventoryName() ? this.customName : "container.watzPowerplant";
}
@Override
public boolean hasCustomInventoryName() {
return this.customName != null && this.customName.length() > 0;
}
public void setCustomName(String name) {
this.customName = name;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
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 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);
waste = nbt.getShort("deut") * 1000;
power = nbt.getShort("power") * 10000;
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);
}
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setShort("deut", (short) (waste/1000));
nbt.setShort("power", (short) (power/10000));
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) {
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 3, this.yCoord + i, this.zCoord - 1) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 3, this.yCoord + i, this.zCoord + 1) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord - 2) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_element)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord) != ModBlocks.watz_control)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_element)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord + 2) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord - 3) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord - 2) != ModBlocks.watz_element)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_control)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord) != ModBlocks.watz_cooler)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_control)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord + 2) != ModBlocks.watz_element)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord + 3) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 0, this.yCoord + i, this.zCoord - 2) != ModBlocks.watz_control)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 0, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_cooler)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 0, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_cooler)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 0, this.yCoord + i, this.zCoord + 2) != ModBlocks.watz_control)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord - 3) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord - 2) != ModBlocks.watz_element)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_control)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord) != ModBlocks.watz_cooler)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_control)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord + 2) != ModBlocks.watz_element)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord + 3) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord - 2) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_element)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord) != ModBlocks.watz_control)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_element)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord + 2) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 3, this.yCoord + i, this.zCoord - 1) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 3, this.yCoord + i, this.zCoord + 1) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= -1; i++)
{
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord) != ModBlocks.watz_conductor)
return false;
}
for(int i = 1; i <= 5; i++)
{
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord) != ModBlocks.watz_conductor)
return false;
}
for(int i = -5; i <= -1; i++)
{
if(world.getBlock(this.xCoord + 3, this.yCoord + i, this.zCoord) != ModBlocks.reinforced_brick)
return false;
}
for(int i = 1; i <= 5; i++)
{
if(world.getBlock(this.xCoord + 3, this.yCoord + i, this.zCoord) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= -1; i++)
{
if(world.getBlock(this.xCoord - 3, this.yCoord + i, this.zCoord) != ModBlocks.reinforced_brick)
return false;
}
for(int i = 1; i <= 5; i++)
{
if(world.getBlock(this.xCoord - 3, this.yCoord + i, this.zCoord) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= -1; i++)
{
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord + 3) != ModBlocks.reinforced_brick)
return false;
}
for(int i = 1; i <= 5; i++)
{
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord + 3) != ModBlocks.reinforced_brick)
return false;
}
for(int i = -5; i <= -1; i++)
{
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord - 3) != ModBlocks.reinforced_brick)
return false;
}
for(int i = 1; i <= 5; i++)
{
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord - 3) != ModBlocks.reinforced_brick)
return false;
}
if(world.getBlock(this.xCoord + 3, this.yCoord, this.zCoord) != ModBlocks.watz_hatch)
return false;
if(world.getBlock(this.xCoord - 3, this.yCoord, this.zCoord) != ModBlocks.watz_hatch)
return false;
if(world.getBlock(this.xCoord, this.yCoord, this.zCoord + 3) != ModBlocks.watz_hatch)
return false;
if(world.getBlock(this.xCoord, this.yCoord, this.zCoord - 3) != ModBlocks.watz_hatch)
return false;
for(int i = -3; i <= 3; i++)
{
for(int j = -3; j <= 3; j++)
{
if(world.getBlock(this.xCoord + i, this.yCoord + 6, this.zCoord + j) != ModBlocks.watz_end && world.getBlock(this.xCoord + i, this.yCoord + 6, this.zCoord + j) != ModBlocks.watz_conductor)
return false;
}
}
for(int i = -3; i <= 3; i++)
{
for(int j = -3; j <= 3; j++)
{
if(world.getBlock(this.xCoord + i, this.yCoord - 6, this.zCoord + j) != ModBlocks.watz_end && world.getBlock(this.xCoord + i, this.yCoord - 6, this.zCoord + j) != ModBlocks.watz_conductor)
return false;
}
}
return true;
}
@Override
public boolean isCoatingValid(World world) {
{
return true;
}
//return false;
}
@Override
public boolean hasFuse() {
return slots[38] != null && slots[38].getItem() == ModItems.titanium_filter && slots[38].getItemDamage() < slots[38].getMaxDamage();
}
@Override
public int getWaterScaled(int i) {
return (waste * i) / wasteMax;
}
@Override
public int getPowerScaled(int i) {
return (power/100 * i) / (maxPower/100);
}
@Override
public int getCoolantScaled(int i) {
return 0;
}
@Override
public int getHeatScaled(int i) {
return 0;
}
@Override
public void updateEntity() {
if (this.isStructureValid(this.worldObj)) {
age++;
if (age >= 20) {
age = 0;
}
if (age == 9 || age == 19)
ffgeuaInit();
powerMultiplier = 100;
decayMultiplier = 100;
powerList = 0;
heatList = 0;
heat = 0;
if (hasFuse()) {
//Adds power and heat
for (int i = 0; i < 36; i++) {
surveyPellet(slots[i]);
}
//Calculates modifiers
for (int i = 0; i < 36; i++) {
surveyPelletAgain(slots[i]);
}
//Decays pellet by (DECAYMULTIPLIER * DEFAULTDECAY=100)/100 ticks
for (int i = 0; i < 36; i++) {
decayPellet(i);
}
}
//Only damages filter when heat is present (thus waste being created)
if (heatList > 0) {
slots[38].setItemDamage(slots[38].getItemDamage() + 1);
}
heat = heatList;
power += powerList;
waste += (decayMultiplier * heat) / 100;
if(power > maxPower)
power = maxPower;
//Gets rid of 1/4 of the total waste, if at least one access hatch is not occupied
if(waste > wasteMax)
emptyWaste();
if(power - 100 >= 0 && slots[37] != null && slots[37].getItem() == ModItems.battery_generic && slots[37].getItemDamage() > 0)
{
power -= 100;
slots[37].setItemDamage(slots[37].getItemDamage() - 1);
}
if(power - 100 >= 0 && slots[37] != null && slots[37].getItem() == ModItems.battery_advanced && slots[37].getItemDamage() > 0)
{
power -= 100;
slots[37].setItemDamage(slots[37].getItemDamage() - 1);
}
if(power - 100 >= 0 && slots[37] != null && slots[37].getItem() == ModItems.battery_schrabidium && slots[37].getItemDamage() > 0)
{
power -= 100;
slots[37].setItemDamage(slots[37].getItemDamage() - 1);
}
if(power - 100 >= 0 && slots[37] != null && slots[37].getItem() == ModItems.factory_core_titanium && slots[37].getItemDamage() > 0)
{
power -= 100;
slots[37].setItemDamage(slots[37].getItemDamage() - 1);
}
if(power - 100 >= 0 && slots[37] != null && slots[37].getItem() == ModItems.factory_core_advanced && slots[37].getItemDamage() > 0)
{
power -= 100;
slots[37].setItemDamage(slots[37].getItemDamage() - 1);
}
if(waste - 2500000 >= 0 && slots[36] != null && slots[36].getItem() == ModItems.tank_waste && slots[36].getItemDamage() < 8)
{
waste -= 2500000;
slots[36].setItemDamage(slots[36].getItemDamage() + 1);
}
}
}
public void surveyPellet(ItemStack stack) {
if(stack != null && stack.getItem() instanceof WatzFuel)
{
WatzFuel fuel = (WatzFuel)stack.getItem();
this.powerList += fuel.power;
this.heatList += fuel.heat;
}
}
public void surveyPelletAgain(ItemStack stack) {
if(stack != null && stack.getItem() instanceof WatzFuel)
{
WatzFuel fuel = (WatzFuel)stack.getItem();
this.powerList *= fuel.powerMultiplier;
this.heatList *= fuel.heatMultiplier;
this.decayMultiplier *= fuel.decayMultiplier;
}
}
public void decayPellet(int i) {
if(slots[i] != null && slots[i].getItem() instanceof WatzFuel)
{
WatzFuel fuel = (WatzFuel)slots[i].getItem();
slots[i].setItemDamage(slots[i].getItemDamage() + this.decayMultiplier);
if(slots[i].getItemDamage() >= slots[i].getMaxDamage())
{
if(slots[i].getItem() == ModItems.pellet_lead)
slots[i] = null;
else
slots[i] = new ItemStack(ModItems.pellet_lead);
}
}
}
public void emptyWaste() {
this.waste /= 4;
this.waste *= 3;
if (!worldObj.isRemote) {
if (this.worldObj.getBlock(this.xCoord + 4, this.yCoord, this.zCoord) == Blocks.air)
this.worldObj.setBlock(this.xCoord + 4, this.yCoord, this.zCoord, ModBlocks.mud_block);
else if (this.worldObj.getBlock(this.xCoord - 4, this.yCoord, this.zCoord) == Blocks.air)
this.worldObj.setBlock(this.xCoord - 4, this.yCoord, this.zCoord, ModBlocks.mud_block);
else if (this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord + 4) == Blocks.air)
this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord + 4, ModBlocks.mud_block);
else if (this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord - 4) == Blocks.air)
this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord - 4, ModBlocks.mud_block);
else {
for (int i = -3; i <= 3; i++)
for (int j = -5; j <= 5; j++)
for (int k = -3; k <= 3; k++)
if (rand.nextInt(2) == 0)
this.worldObj.setBlock(this.xCoord + i, this.yCoord + j, this.zCoord + k,
ModBlocks.mud_block);
this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, ModBlocks.mud_block);
}
}
}
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
}
@Override
public void ffgeuaInit() {
ffgeua(this.xCoord, this.yCoord + 7, this.zCoord, getTact());
ffgeua(this.xCoord, this.yCoord - 7, this.zCoord, getTact());
}
public boolean getTact() {
if(age >= 0 && age < 10)
{
return true;
}
return false;
}
}

View File

@ -0,0 +1,18 @@
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 WatzCore extends BlockContainer {
protected WatzCore(Material p_i45386_1_) {
super(p_i45386_1_);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityWatzCore();
}
}

View File

@ -0,0 +1,178 @@
package com.hbm.blocks;
import java.util.Random;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
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.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class WatzHatch extends Block {
@SideOnly(Side.CLIENT)
private IIcon iconFront;
protected WatzHatch(Material p_i45394_1_) {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":watz_hatch");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":reinforced_brick");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(this);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z);
//this.setDefaultDirection(world, x, y, z);
}
private void setDefaultDirection(World world, int x, int y, int z) {
if(!world.isRemote)
{
Block block1 = world.getBlock(x, y, z - 1);
Block block2 = world.getBlock(x, y, z + 1);
Block block3 = world.getBlock(x - 1, y, z);
Block block4 = world.getBlock(x + 1, y, z);
byte b0 = 3;
if(block1.func_149730_j() && !block2.func_149730_j())
{
b0 = 3;
}
if(block2.func_149730_j() && !block1.func_149730_j())
{
b0 = 2;
}
if(block3.func_149730_j() && !block4.func_149730_j())
{
b0 = 5;
}
if(block4.func_149730_j() && !block3.func_149730_j())
{
b0 = 4;
}
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
}
}
@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, 2, 2);
}
if(i == 1)
{
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
}
if(i == 2)
{
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
}
if(i == 3)
{
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
return true;
} else if(!player.isSneaking())
{
if(world.getBlockMetadata(x, y, z) == 2)
{
if(world.getTileEntity(x, y, z + 3) instanceof TileEntityWatzCore)
{
if(((TileEntityWatzCore)world.getTileEntity(x, y, z + 3)).isStructureValid(world))
{
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_watz_multiblock, world, x, y, z + 3);
} else {
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Structure not valid!"));
}
} else {
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Core not found!"));
}
}
if(world.getBlockMetadata(x, y, z) == 3)
{
if(world.getTileEntity(x, y, z - 3) instanceof TileEntityWatzCore)
{
if(((TileEntityWatzCore)world.getTileEntity(x, y, z - 3)).isStructureValid(world))
{
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_watz_multiblock, world, x, y, z - 3);
} else {
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Structure not valid!"));
}
} else {
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Core not found!"));
}
}
if(world.getBlockMetadata(x, y, z) == 4)
{
if(world.getTileEntity(x + 3, y, z) instanceof TileEntityWatzCore)
{
if(((TileEntityWatzCore)world.getTileEntity(x + 3, y, z)).isStructureValid(world))
{
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_watz_multiblock, world, x + 3, y, z);
} else {
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Structure not valid!"));
}
} else {
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Core not found!"));
}
}
if(world.getBlockMetadata(x, y, z) == 5)
{
if(world.getTileEntity(x - 3, y, z) instanceof TileEntityWatzCore)
{
if(((TileEntityWatzCore)world.getTileEntity(x - 3, y, z)).isStructureValid(world))
{
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_watz_multiblock, world, x - 3, y, z);
} else {
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Structure not valid!"));
}
} else {
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Core not found!"));
}
}
return true;
} else {
return false;
}
}
}

View File

@ -0,0 +1,158 @@
package com.hbm.gui;
import com.hbm.blocks.TileEntityFusionMultiblock;
import com.hbm.blocks.TileEntityWatzCore;
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 ContainerWatzCore extends Container {
private TileEntityWatzCore diFurnace;
private int water;
private int power;
private int trit;
public ContainerWatzCore(InventoryPlayer invPlayer, TileEntityWatzCore tedf) {
diFurnace = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 8, 18));
this.addSlotToContainer(new Slot(tedf, 1, 26, 18));
this.addSlotToContainer(new Slot(tedf, 2, 44, 18));
this.addSlotToContainer(new Slot(tedf, 3, 62, 18));
this.addSlotToContainer(new Slot(tedf, 4, 80, 18));
this.addSlotToContainer(new Slot(tedf, 5, 98, 18));
this.addSlotToContainer(new Slot(tedf, 6, 8, 36));
this.addSlotToContainer(new Slot(tedf, 7, 26, 36));
this.addSlotToContainer(new Slot(tedf, 8, 44, 36));
this.addSlotToContainer(new Slot(tedf, 9, 62, 36));
this.addSlotToContainer(new Slot(tedf, 10, 80, 36));
this.addSlotToContainer(new Slot(tedf, 11, 98, 36));
this.addSlotToContainer(new Slot(tedf, 12, 8, 54));
this.addSlotToContainer(new Slot(tedf, 13, 26, 54));
this.addSlotToContainer(new Slot(tedf, 14, 44, 54));
this.addSlotToContainer(new Slot(tedf, 15, 62, 54));
this.addSlotToContainer(new Slot(tedf, 16, 80, 54));
this.addSlotToContainer(new Slot(tedf, 17, 98, 54));
this.addSlotToContainer(new Slot(tedf, 18, 8, 72));
this.addSlotToContainer(new Slot(tedf, 19, 26, 72));
this.addSlotToContainer(new Slot(tedf, 20, 44, 72));
this.addSlotToContainer(new Slot(tedf, 21, 62, 72));
this.addSlotToContainer(new Slot(tedf, 22, 80, 72));
this.addSlotToContainer(new Slot(tedf, 23, 98, 72));
this.addSlotToContainer(new Slot(tedf, 24, 8, 90));
this.addSlotToContainer(new Slot(tedf, 25, 26, 90));
this.addSlotToContainer(new Slot(tedf, 26, 44, 90));
this.addSlotToContainer(new Slot(tedf, 27, 62, 90));
this.addSlotToContainer(new Slot(tedf, 28, 80, 90));
this.addSlotToContainer(new Slot(tedf, 29, 98, 90));
this.addSlotToContainer(new Slot(tedf, 30, 8, 108));
this.addSlotToContainer(new Slot(tedf, 31, 26, 108));
this.addSlotToContainer(new Slot(tedf, 32, 44, 108));
this.addSlotToContainer(new Slot(tedf, 33, 62, 108));
this.addSlotToContainer(new Slot(tedf, 34, 80, 108));
this.addSlotToContainer(new Slot(tedf, 35, 98, 108));
this.addSlotToContainer(new Slot(tedf, 36, 134, 108));
this.addSlotToContainer(new Slot(tedf, 37, 152, 108));
this.addSlotToContainer(new Slot(tedf, 38, 116, 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.waste);
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.power);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
{
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 38) {
if (!this.mergeItemStack(var5, 39, this.inventorySlots.size(), true))
{
return null;
}
} else {
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack) null);
}
else
{
var4.onSlotChanged();
}
}
return var3;
}
@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.waste)
{
par1.sendProgressBarUpdate(this, 0, this.diFurnace.waste);
}
if(this.power != this.diFurnace.power)
{
par1.sendProgressBarUpdate(this, 1, this.diFurnace.power);
}
}
this.water = this.diFurnace.waste;
this.power = this.diFurnace.power;
}
@Override
public void updateProgressBar(int i, int j) {
if(i == 0)
{
diFurnace.waste = j;
}
if(i == 1)
{
diFurnace.power = j;
}
}
}

View File

@ -0,0 +1,52 @@
package com.hbm.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.TileEntityReactorMultiblock;
import com.hbm.blocks.TileEntityWatzCore;
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 GUIWatzCore extends GuiContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_watz_multiblock.png");
private TileEntityWatzCore diFurnace;
public GUIWatzCore(InventoryPlayer invPlayer, TileEntityWatzCore tedf) {
super(new ContainerWatzCore(invPlayer, tedf));
diFurnace = tedf;
this.xSize = 176;
//this.ySize = 222;
this.ySize = 256;
}
@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")/* + String.valueOf(diFurnace.powerList)*/, 8, this.ySize - 96 + 2 - 34, 4210752);
this.fontRendererObj.drawString(String.valueOf(diFurnace.powerList + " HE/tick"), 8, this.ySize - 50 + 2 + 13, 4210752);
this.fontRendererObj.drawString(String.valueOf(diFurnace.heatList + " heat"), 8, this.ySize - 50 + 2 + 22, 4210752);
this.fontRendererObj.drawString(String.valueOf((diFurnace.decayMultiplier * diFurnace.heat)/100 + " waste/tick"), 8, this.ySize - 50 + 2 + 31, 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 j = diFurnace.getWaterScaled(88);
drawTexturedModalRect(guiLeft + 134, guiTop + 106 - j, 176, 88 - j, 16, j);
int l = diFurnace.getPowerScaled(88);
drawTexturedModalRect(guiLeft + 152, guiTop + 106 - l, 192, 88 - l, 16, l);
}
}

View File

@ -0,0 +1,47 @@
package com.hbm.handler;
import java.util.HashMap;
import java.util.Map;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.FillBucketEvent;
public class BucketHandler {
public static BucketHandler INSTANCE = new BucketHandler();
public Map<Block, Item> buckets = new HashMap<Block, Item>();
private BucketHandler() {
}
@SubscribeEvent
public void onBucketFill(FillBucketEvent event) {
ItemStack result = fillCustomBucket(event.world, event.target);
if (result == null)
return;
event.result = result;
event.setResult(Result.ALLOW);
}
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
Item bucket = buckets.get(block);
if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
return new ItemStack(bucket);
} else
return null;
}
}

View File

@ -18,22 +18,25 @@ public class ItemCapacitor extends Item {
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
if (this == ModItems.redcoil_capacitor) {
list.add("Right-click a block to negate positive charge.");
list.add("Does not work in creative mode!");
list.add("[Needed for Schrabidium Synthesis]");
}
if (this == ModItems.titanium_filter) {
list.add("[Needed for Watz Reaction]");
}
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
{
if(!player.isSneaking())
{
if(stack.getItemDamage() > 0)
{
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_,
float p_77648_8_, float p_77648_9_, float p_77648_10_) {
if (this == ModItems.redcoil_capacitor) {
if (!player.isSneaking()) {
if (stack.getItemDamage() > 0) {
stack.setItemDamage((stack.getItemDamage() - 1));
if(!world.isRemote)
{
if (!world.isRemote) {
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 2.5F, true);
}
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
@ -41,6 +44,7 @@ public class ItemCapacitor extends Item {
return true;
}
}
}
return false;
}

View File

@ -0,0 +1,12 @@
package com.hbm.items;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBucket;
public class ItemModBucket extends ItemBucket {
public ItemModBucket(Block p_i45331_1_) {
super(p_i45331_1_);
}
}

View File

@ -0,0 +1,56 @@
package com.hbm.items;
import java.util.List;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
public class ItemTankWaste extends Item {
@SideOnly(Side.CLIENT)
private IIcon[] field_150920_d;
public ItemTankWaste() {
this.hasSubtypes = true;
this.setMaxDamage(0);
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int p_77617_1_)
{
int j = MathHelper.clamp_int(p_77617_1_, 0, 8);
return this.field_150920_d[j];
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister p_94581_1_)
{
this.field_150920_d = new IIcon[9];
for (int i = 0; i < field_150920_d.length; ++i)
{
this.field_150920_d[i] = p_94581_1_.registerIcon(RefStrings.MODID + ":tank_waste_" + i);
}
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_)
{
for (int i = 0; i < 9; ++i)
{
p_150895_3_.add(new ItemStack(p_150895_1_, 1, i));
}
}
public String getUnlocalizedName(ItemStack p_77667_1_)
{
int i = MathHelper.clamp_int(p_77667_1_.getItemDamage(), 0, 9);
return super.getUnlocalizedName() + "_" + i;
}
}

View File

@ -1,14 +1,21 @@
package com.hbm.items;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BucketHandler;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemSoup;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
public class ModItems {
@ -55,6 +62,10 @@ public class ModItems {
public static Item nugget_schrabidium_fuel;
public static Item ingot_advanced_alloy;
public static Item lithium;
public static Item ingot_hes;
public static Item ingot_les;
public static Item nugget_hes;
public static Item nugget_les;
public static Item nugget_uranium;
public static Item nugget_u235;
@ -157,6 +168,15 @@ public class ModItems {
public static Item pellet_rtg;
public static Item tritium_deuterium_cake;
public static Item pellet_schrabidium;
public static Item pellet_hes;
public static Item pellet_mes;
public static Item pellet_les;
public static Item pellet_beryllium;
public static Item pellet_neptunium;
public static Item pellet_lead;
public static Item pellet_advanced;
public static Item cell_empty;
public static Item cell_uf6;
public static Item cell_puf6;
@ -379,6 +399,9 @@ public class ModItems {
public static Item energy_core;
public static Item fuse;
public static Item redcoil_capacitor;
public static Item titanium_filter;
public static Item tank_waste;
public static Item factory_core_titanium;
public static Item factory_core_advanced;
@ -484,6 +507,8 @@ public class ModItems {
public static Item igniter;
public static Item detonator;
public static Item bucket_mud;
public static Item smoke1;
public static Item smoke2;
public static Item smoke3;
@ -579,6 +604,10 @@ public class ModItems {
nugget_schrabidium = new ItemCustomLore().setUnlocalizedName("nugget_schrabidium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_schrabidium");
nugget_beryllium = new Item().setUnlocalizedName("nugget_beryllium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_beryllium");
hazmat_cloth = new Item().setUnlocalizedName("hazmat_cloth").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":hazmat_cloth");
ingot_hes = new Item().setUnlocalizedName("ingot_hes").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":ingot_hes");
ingot_les = new Item().setUnlocalizedName("ingot_les").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":ingot_les");
nugget_hes = new Item().setUnlocalizedName("nugget_hes").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_hes");
nugget_les = new Item().setUnlocalizedName("nugget_les").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_les");
powder_lead = new Item().setUnlocalizedName("powder_lead").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":powder_lead");
powder_neptunium = new Item().setUnlocalizedName("powder_neptunium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":powder_neptunium");
@ -671,6 +700,8 @@ public class ModItems {
canister_fuel = new ItemCustomLore().setUnlocalizedName("canister_fuel").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_fuel");
canister_napalm = new ItemCustomLore().setUnlocalizedName("canister_napalm").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_napalm");
tank_waste = new ItemTankWaste().setUnlocalizedName("tank_waste").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts);
syringe_empty = new Item().setUnlocalizedName("syringe_empty").setFull3D().setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":syringe_empty");
syringe_antidote = new ItemSyringe().setUnlocalizedName("syringe_antidote").setFull3D().setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":syringe_antidote");
syringe_poison = new ItemSyringe().setUnlocalizedName("syringe_poison").setFull3D().setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":syringe_poison");
@ -769,6 +800,15 @@ public class ModItems {
powder_poison = new ItemCustomLore().setUnlocalizedName("powder_poison").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":powder_poison");
pellet_gas = new ItemCustomLore().setUnlocalizedName("pellet_gas").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_gas");
pellet_schrabidium = new WatzFuel(50000, 140000, 0.975F, 200, 1.05F, 1.05F).setUnlocalizedName("pellet_schrabidium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_schrabidium").setMaxStackSize(1);
pellet_hes = new WatzFuel(108000, 65000, 1F, 85, 1, 1.025F).setUnlocalizedName("pellet_hes").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_hes").setMaxStackSize(1);
pellet_mes = new WatzFuel(216000, 23000, 1.025F, 50, 1, 1F).setUnlocalizedName("pellet_mes").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_mes").setMaxStackSize(1);
pellet_les = new WatzFuel(432000, 7000, 1.05F, 15, 1, 0.975F).setUnlocalizedName("pellet_les").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_les").setMaxStackSize(1);
pellet_beryllium = new WatzFuel(864000, 50, 0.995F, 0, 0.95F, 1.025F).setUnlocalizedName("pellet_beryllium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_beryllium").setMaxStackSize(1);
pellet_neptunium = new WatzFuel(216000, 3000, 1.075F, 25, 1.025F, 1.01F).setUnlocalizedName("pellet_neptunium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_neptunium").setMaxStackSize(1);
pellet_lead = new WatzFuel(1728000, 0, 0.975F, 0, 0.975F, 0.975F).setUnlocalizedName("pellet_lead").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_lead").setMaxStackSize(1);
pellet_advanced = new WatzFuel(216000, 1000, 1.1F, 0, 0.995F, 0.975F).setUnlocalizedName("pellet_advanced").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pellet_advanced").setMaxStackSize(1);
designator = new ItemDesingator().setUnlocalizedName("designator").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":designator");
missile_generic = new Item().setUnlocalizedName("missile_generic").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_generic");
missile_anti_ballistic = new Item().setUnlocalizedName("missile_anti_ballistic").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_anti_ballistic");
@ -864,11 +904,12 @@ public class ModItems {
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");
redcoil_capacitor = new ItemCapacitor(10).setUnlocalizedName("redcoil_capacitor").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":redcoil_capacitor");
titanium_filter = new ItemCapacitor(72000).setUnlocalizedName("titanium_filter").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":titanium_filter");
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");
wand = new ItemWand().setUnlocalizedName("wand_k").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setFull3D().setTextureName(RefStrings.MODID + ":wand");
wand_s = new ItemWandS().setUnlocalizedName("wand_s").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setFull3D().setTextureName(RefStrings.MODID + ":wand_s");
nuke_starter_kit = new ItemStarterKit().setUnlocalizedName("nuke_starter_kit").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":nuke_starter_kit");
@ -969,6 +1010,8 @@ public class ModItems {
euphemium_stopper = new ItemSyringe().setUnlocalizedName("euphemium_stopper").setMaxStackSize(1).setFull3D().setTextureName(RefStrings.MODID + ":euphemium_stopper");
matchstick = new ItemMatch().setUnlocalizedName("matchstick").setCreativeTab(CreativeTabs.tabTools).setFull3D().setTextureName(RefStrings.MODID + ":matchstick");
bucket_mud = new ItemModBucket(ModBlocks.mud_block).setUnlocalizedName("bucket_mud").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.tabBlock).setTextureName(RefStrings.MODID + ":bucket_mud");
smoke1 = new Item().setUnlocalizedName("smoke1").setTextureName(RefStrings.MODID + ":smoke1");
smoke2 = new Item().setUnlocalizedName("smoke2").setTextureName(RefStrings.MODID + ":smoke2");
smoke3 = new Item().setUnlocalizedName("smoke3").setTextureName(RefStrings.MODID + ":smoke3");
@ -985,6 +1028,10 @@ public class ModItems {
b_smoke6 = new Item().setUnlocalizedName("b_smoke6").setTextureName(RefStrings.MODID + ":b_smoke6");
b_smoke7 = new Item().setUnlocalizedName("b_smoke7").setTextureName(RefStrings.MODID + ":b_smoke7");
b_smoke8 = new Item().setUnlocalizedName("b_smoke8").setTextureName(RefStrings.MODID + ":b_smoke8");
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.mud_fluid, 1000), new ItemStack(ModItems.bucket_mud));
BucketHandler.INSTANCE.buckets.put(ModBlocks.mud_block, ModItems.bucket_mud);
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
}
private static void registerItem() {
@ -1032,6 +1079,8 @@ public class ModItems {
GameRegistry.registerItem(ingot_plutonium_fuel, ingot_plutonium_fuel.getUnlocalizedName());
GameRegistry.registerItem(ingot_mox_fuel, ingot_mox_fuel.getUnlocalizedName());
GameRegistry.registerItem(ingot_schrabidium_fuel, ingot_schrabidium_fuel.getUnlocalizedName());
GameRegistry.registerItem(ingot_hes, ingot_hes.getUnlocalizedName());
GameRegistry.registerItem(ingot_les, ingot_les.getUnlocalizedName());
//Dusts & Other
GameRegistry.registerItem(lithium, lithium.getUnlocalizedName());
@ -1062,6 +1111,8 @@ public class ModItems {
GameRegistry.registerItem(nugget_plutonium_fuel, nugget_plutonium_fuel.getUnlocalizedName());
GameRegistry.registerItem(nugget_mox_fuel, nugget_mox_fuel.getUnlocalizedName());
GameRegistry.registerItem(nugget_schrabidium_fuel, nugget_schrabidium_fuel.getUnlocalizedName());
GameRegistry.registerItem(nugget_hes, nugget_hes.getUnlocalizedName());
GameRegistry.registerItem(nugget_les, nugget_les.getUnlocalizedName());
//Plates
GameRegistry.registerItem(plate_titanium, plate_titanium.getUnlocalizedName());
@ -1159,6 +1210,16 @@ public class ModItems {
GameRegistry.registerItem(pellet_cluster, pellet_cluster.getUnlocalizedName());
GameRegistry.registerItem(pellet_gas, pellet_gas.getUnlocalizedName());
//Watz Pellets
GameRegistry.registerItem(pellet_schrabidium, pellet_schrabidium.getUnlocalizedName());
GameRegistry.registerItem(pellet_hes, pellet_hes.getUnlocalizedName());
GameRegistry.registerItem(pellet_mes, pellet_mes.getUnlocalizedName());
GameRegistry.registerItem(pellet_les, pellet_les.getUnlocalizedName());
GameRegistry.registerItem(pellet_beryllium, pellet_beryllium.getUnlocalizedName());
GameRegistry.registerItem(pellet_neptunium, pellet_neptunium.getUnlocalizedName());
GameRegistry.registerItem(pellet_lead, pellet_lead.getUnlocalizedName());
GameRegistry.registerItem(pellet_advanced, pellet_advanced.getUnlocalizedName());
//Cells
GameRegistry.registerItem(cell_empty, cell_empty.getUnlocalizedName());
GameRegistry.registerItem(cell_uf6, cell_uf6.getUnlocalizedName());
@ -1177,6 +1238,9 @@ public class ModItems {
GameRegistry.registerItem(inf_sulfur, inf_sulfur.getUnlocalizedName());
GameRegistry.registerItem(inf_diesel, inf_diesel.getUnlocalizedName());
//Large Tanks
GameRegistry.registerItem(tank_waste, tank_waste.getUnlocalizedName());
//Canisters
GameRegistry.registerItem(canister_empty, canister_empty.getUnlocalizedName());
GameRegistry.registerItem(canister_fuel, canister_fuel.getUnlocalizedName());
@ -1193,6 +1257,7 @@ public class ModItems {
GameRegistry.registerItem(factory_core_advanced, factory_core_advanced.getUnlocalizedName());
GameRegistry.registerItem(fuse, fuse.getUnlocalizedName());
GameRegistry.registerItem(redcoil_capacitor, redcoil_capacitor.getUnlocalizedName());
GameRegistry.registerItem(titanium_filter, titanium_filter.getUnlocalizedName());
//Fuelrods
GameRegistry.registerItem(rod_empty, rod_empty.getUnlocalizedName());
@ -1498,6 +1563,9 @@ public class ModItems {
GameRegistry.registerItem(t45_kit, t45_kit.getUnlocalizedName());
GameRegistry.registerItem(euphemium_kit, euphemium_kit.getUnlocalizedName());
//THIS is a bucket.
GameRegistry.registerItem(bucket_mud, bucket_mud.getUnlocalizedName());
//Technical Items
GameRegistry.registerItem(smoke1, smoke1.getUnlocalizedName());
GameRegistry.registerItem(smoke2, smoke2.getUnlocalizedName());

View File

@ -0,0 +1,46 @@
package com.hbm.items;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class WatzFuel extends Item {
public int power;
public float powerMultiplier;
public int heat;
public float heatMultiplier;
public float decayMultiplier;
/**
* Constructor for a new Watz fuel pellet
* @param lifeTime
* @param power
* @param powerMultiplier
* @param heat
* @param heatMultiplier
* @param decayMultiplier
*/
public WatzFuel(int lifeTime, int power, float powerMultiplier, int heat, float heatMultiplier, float decayMultiplier) {
this.setMaxDamage(lifeTime * 100);
this.power = power/10;
this.powerMultiplier = powerMultiplier;
this.heat = heat;
this.heatMultiplier = heatMultiplier;
this.decayMultiplier = decayMultiplier;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
list.add("Max age: " + (this.getMaxDamage()/100) + " ticks");
list.add("Power per tick: " + (power) + "HE");
list.add("Power multiplier: " + (powerMultiplier >= 1 ? "+" : "") + (Math.round(powerMultiplier * 1000) * .10 - 100) + "%");
list.add("Heat provided: " + heat + " heat");
list.add("Heat multiplier: " + (heatMultiplier >= 1 ? "+" : "") + (Math.round(heatMultiplier * 1000) * .10 - 100) + "%");
list.add("Decay Multiplier: " + (decayMultiplier >= 1 ? "+" : "") + (Math.round(decayMultiplier * 1000) * .10 - 100) + "%");
}
}

View File

@ -193,7 +193,8 @@ public class Library {
world.getBlock(x, y, z) == ModBlocks.fusion_center ||
world.getBlock(x, y, z) == ModBlocks.reactor_conductor ||
world.getBlock(x, y, z) == ModBlocks.factory_titanium_conductor ||
world.getBlock(x, y, z) == ModBlocks.factory_advanced_conductor)
world.getBlock(x, y, z) == ModBlocks.factory_advanced_conductor ||
world.getBlock(x, y, z) == ModBlocks.watz_conductor)
{
return true;
}

View File

@ -10,6 +10,7 @@ import net.minecraft.util.EntityDamageSourceIndirect;
public class ModDamageSource extends DamageSource {
public static DamageSource nuclearBlast = (new DamageSource("nuclearBlast")).setExplosion();
public static DamageSource mudPoisoning = (new DamageSource("mudPoisoning")).setDamageBypassesArmor();
public ModDamageSource(String p_i1566_1_) {
super(p_i1566_1_);

View File

@ -33,7 +33,7 @@ public class CraftingManager {
GameRegistry.addRecipe(new ItemStack(ModItems.plate_schrabidium, 16), new Object[] { "TT", "TT", 'T', ModItems.ingot_schrabidium});
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_gold, 16), new Object[] { "TT", "TT", 'T', "ingotGold" }));
GameRegistry.addRecipe(new ItemStack(ModItems.plate_advanced_alloy, 16), new Object[] { "TT", "TT", 'T', ModItems.ingot_advanced_alloy});
GameRegistry.addRecipe(new ItemStack(ModItems.wire_red_copper, 6), new Object[] { "CCC", 'S', Items.string, 'C', ModItems.ingot_red_copper });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_red_copper, 6), new Object[] { "CCC", 'S', Items.string, 'C', "ingotRedstoneAlloy" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_tungsten, 6), new Object[] { "CCC", 'S', Items.string, 'C', "ingotTungsten" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_aluminium, 6), new Object[] { "CCC", 'S', Items.string, 'C', "ingotAluminum" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wire_copper, 6), new Object[] { "CCC", 'S', Items.string, 'C', "ingotCopper" }));
@ -347,23 +347,23 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 1), new Object[] { "AHA", "TCT", "TPT", 'T', "plateTitanium", 'A', "plateAluminum", 'S', "plateSteel", 'C', "ingotCopper", 'P', Item.getItemFromBlock(Blocks.piston), 'H', Item.getItemFromBlock(Blocks.hopper) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_centrifuge), 1), new Object[] { " T ", "RDR", "RSR", 'S', "plateSteel", 'T', ModItems.centrifuge_tower, 'W', ModItems.coil_tungsten, 'R', ModItems.coil_copper, 'D', Item.getItemFromBlock(ModBlocks.machine_difurnace_off) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_uf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateTitanium", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', ModItems.ingot_red_copper }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_puf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateSteel", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', ModItems.ingot_red_copper }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_uf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateTitanium", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedstoneAlloy" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_puf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateSteel", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedstoneAlloy" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_reactor), 1), new Object[] { "LSL", "SCS", "LSL", 'S', "ingotSteel", 'L', "ingotLead", 'C', ModItems.reactor_core }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 1), new Object[] { "SSS", "SFS", "CCC", 'S', "plateSteel", 'C', "plateCopper", 'F', Item.getItemFromBlock(Blocks.furnace) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_rtg_furnace_off), 1), new Object[] { "NNN", "NFN", "UUU", 'N', "plateDenseLead", 'U', ModItems.rtg_unit, 'F', Item.getItemFromBlock(Blocks.furnace) }));
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 1), new Object[] { "BBB", "WFW", "RRR", 'B', ModItems.ingot_beryllium, 'R', ModItems.coil_tungsten, 'W', ModItems.wire_red_copper, 'F', Item.getItemFromBlock(Blocks.furnace) });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_generator), 1), new Object[] { "SLS", "LCL", "SLS", 'C', ModItems.circuit_red_copper, 'L', ModItems.rod_quad_lead, 'S', "ingotSteel" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_wire_coated), 16), new Object[] { "WRW", "RIR", "WRW", 'W', "ingotTungsten", 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_cable), 16), new Object[] { "WRW", "RIR", "WRW", 'W', "plateSteel", 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_wire_coated), 16), new Object[] { "WRW", "RIR", "WRW", 'W', "ingotTungsten", 'I', "ingotRedstoneAlloy", 'R', ModItems.wire_red_copper }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_cable), 16), new Object[] { "WRW", "RIR", "WRW", 'W', "plateSteel", 'I', "ingotRedstoneAlloy", 'R', ModItems.wire_red_copper }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_deuterium), 1), new Object[] { "TIT", "RFR", "CCC", 'T', ModItems.tank_steel, 'I', "ingotTitanium", 'R', ModItems.wire_red_copper, 'F', Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 'C', ModItems.coil_tungsten }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TST", "RIR", "TLT", 'T', "ingotTungsten", 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper, 'S', "blockSulfur", 'L', "blockLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TLT", "RIR", "TST", 'T', "ingotTungsten", 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper, 'S', "blockSulfur", 'L', "blockLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_coal_off), 1), new Object[] { "STS", "SCS", "SFS", 'S', "ingotSteel", 'T', ModItems.tank_steel, 'C', ModItems.ingot_red_copper, 'F', Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TST", "RIR", "TLT", 'T', "ingotTungsten", 'I', "ingotRedstoneAlloy", 'R', ModItems.wire_red_copper, 'S', "blockSulfur", 'L', "blockLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TLT", "RIR", "TST", 'T', "ingotTungsten", 'I', "ingotRedstoneAlloy", 'R', ModItems.wire_red_copper, 'S', "blockSulfur", 'L', "blockLead" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_coal_off), 1), new Object[] { "STS", "SCS", "SFS", 'S', "ingotSteel", 'T', ModItems.tank_steel, 'C', "ingotRedstoneAlloy", 'F', Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_converter_he_rf), 1), new Object[] { "SSS", "CRC", "SSS", 'S', "ingotSteel", 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus }));
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_converter_rf_he), 1), new Object[] { "SSS", "CRC", "SSS", 'S', ModItems.ingot_beryllium, 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_schrabidium_transmutator), 1), new Object[] { "TST", "ARA", "BBB", 'S', ModItems.nugget_schrabidium , 'T', "ingotTitanium", 'A', Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 'R', Item.getItemFromBlock(ModBlocks.machine_reactor), 'B', Item.getItemFromBlock(ModBlocks.machine_battery) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_diesel), 1), new Object[] { "HTH", "PRP", "SFS", 'S', "ingotSteel", 'T', ModItems.tank_steel, 'H', ModItems.hull_small_steel, 'P', Item.getItemFromBlock(Blocks.piston), 'R', ModItems.ingot_red_copper, 'F', Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_diesel), 1), new Object[] { "HTH", "PRP", "SFS", 'S', "ingotSteel", 'T', ModItems.tank_steel, 'H', ModItems.hull_small_steel, 'P', Item.getItemFromBlock(Blocks.piston), 'R', "ingotRedstoneAlloy", 'F', Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 1), new Object[] { "PIP", "I I", "PIP", 'P', "plateTitanium", 'I', "ingotTitanium" }));
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_furnace), 1), new Object[] { "HMH", "MFM", "HMH", 'H', Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 'M', ModItems.motor, 'F', Item.getItemFromBlock(Blocks.furnace) });
@ -406,7 +406,7 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.tape_recorder), 4), new Object[] { "TST", "SSS", 'T', "ingotTungsten", 'S', "ingotSteel" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_poles), 16), new Object[] { "S S", "SSS", "S S", 'S', "ingotSteel" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_top), 1), new Object[] { "T T", "TRT", "BBB", 'T', "ingotTungsten", 'B', ModItems.ingot_beryllium, 'R', ModItems.ingot_red_copper }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_top), 1), new Object[] { "T T", "TRT", "BBB", 'T', "ingotTungsten", 'B', ModItems.ingot_beryllium, 'R', "ingotRedstoneAlloy" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_satellite_receiver), 1), new Object[] { "SS ", "SCR", "SS ", 'S', "ingotSteel", 'C', ModItems.circuit_red_copper, 'R', ModItems.wire_red_copper }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_beam), 8), new Object[] { "S", "S", "S", 'S', "ingotSteel" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_wall), 4), new Object[] { "SSS", "SSS", 'S', "ingotSteel" }));
@ -616,7 +616,7 @@ public class CraftingManager {
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_aluminium), new ItemStack(ModItems.ingot_aluminium), 2.5F);
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_lead), new ItemStack(ModItems.ingot_lead), 3.0F);
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_beryllium), new ItemStack(ModItems.ingot_beryllium), 2.0F);
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_schrabidium), new ItemStack(ModItems.ingot_schrabidium), 120.0F);
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_schrabidium), new ItemStack(ModItems.ingot_schrabidium), 126.0F);
GameRegistry.addSmelting(ModItems.powder_lead, new ItemStack(ModItems.ingot_lead), 1.0F);
GameRegistry.addSmelting(ModItems.powder_neptunium, new ItemStack(ModItems.ingot_neptunium), 1.0F);
@ -624,5 +624,6 @@ public class CraftingManager {
GameRegistry.addSmelting(Items.bone, new ItemStack(Items.slime_ball, 3), 1.5F);
GameRegistry.addSmelting(new ItemStack(Items.dye, 1, 15), new ItemStack(Items.slime_ball, 1), 0.5F);
GameRegistry.addSmelting(ModItems.tank_waste, new ItemStack(ModItems.tank_waste), 0);
}
}

View File

@ -31,6 +31,7 @@ import com.hbm.blocks.TileEntityNukeTsar;
import com.hbm.blocks.TileEntityReactorMultiblock;
import com.hbm.blocks.TileEntityRtgFurnace;
import com.hbm.blocks.TileEntityTestNuke;
import com.hbm.blocks.TileEntityWatzCore;
import com.hbm.gui.ContainerBombMulti;
import com.hbm.gui.ContainerDiFurnace;
import com.hbm.gui.ContainerCentrifuge;
@ -61,6 +62,7 @@ import com.hbm.gui.ContainerReactorMultiblock;
import com.hbm.gui.ContainerRtgFurnace;
import com.hbm.gui.ContainerTestNuke;
import com.hbm.gui.ContainerUF6Tank;
import com.hbm.gui.ContainerWatzCore;
import com.hbm.gui.GUIBombMulti;
import com.hbm.gui.GUIConverterHeRf;
import com.hbm.gui.GUIConverterRfHe;
@ -91,6 +93,7 @@ import com.hbm.gui.GUIReactorMultiblock;
import com.hbm.gui.GUIRtgFurnace;
import com.hbm.gui.GUITestDiFurnace;
import com.hbm.gui.GUITestNuke;
import com.hbm.gui.GUIWatzCore;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
@ -345,6 +348,14 @@ public class GUIHandler implements IGuiHandler {
return new ContainerMachineDiesel(player.inventory, (TileEntityMachineDiesel) entity);
}
}
case ModBlocks.guiID_watz_multiblock:
{
if(entity instanceof TileEntityWatzCore)
{
return new ContainerWatzCore(player.inventory, (TileEntityWatzCore) entity);
}
}
}
return null;
}
@ -597,6 +608,14 @@ public class GUIHandler implements IGuiHandler {
return new GUIMachineDiesel(player.inventory, (TileEntityMachineDiesel) entity);
}
}
case ModBlocks.guiID_watz_multiblock:
{
if(entity instanceof TileEntityWatzCore)
{
return new GUIWatzCore(player.inventory, (TileEntityWatzCore) entity);
}
}
}
}
return null;

View File

@ -61,6 +61,7 @@ import com.hbm.blocks.TileEntityTestBombAdvanced;
import com.hbm.blocks.TileEntityTestContainer;
import com.hbm.blocks.TileEntityTestNuke;
import com.hbm.blocks.TileEntityTestRender;
import com.hbm.blocks.TileEntityWatzCore;
import com.hbm.blocks.TileEntityWireCoated;
import com.hbm.blocks.TileEntityYellowBarrel;
import com.hbm.creativetabs.BlockTab;
@ -265,6 +266,7 @@ public class MainRegistry
GameRegistry.registerTileEntity(TileEntityConverterRfHe.class, "tileentity_converter_rfhe");
GameRegistry.registerTileEntity(TileEntityMachineSchrabidiumTransmutator.class, "tileentity_schrabidium_transmutator");
GameRegistry.registerTileEntity(TileEntityMachineDiesel.class, "tileentity_diesel_generator");
GameRegistry.registerTileEntity(TileEntityWatzCore.class, "tileentity_watz_powerplant");
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
@ -340,6 +342,7 @@ public class MainRegistry
OreDictionary.registerOre("dustNeptunium", ModItems.powder_neptunium);
OreDictionary.registerOre("ingotCopper", ModItems.ingot_copper);
OreDictionary.registerOre("ingotRedAlloy", ModItems.ingot_red_copper);
OreDictionary.registerOre("ingotRedstoneAlloy", ModItems.ingot_red_copper);
OreDictionary.registerOre("ingotTungsten", ModItems.ingot_tungsten);
OreDictionary.registerOre("ingotAluminum", ModItems.ingot_aluminium);
OreDictionary.registerOre("ingotNeptunium", ModItems.ingot_neptunium);
@ -395,12 +398,6 @@ public class MainRegistry
OreDictionary.registerOre("blockFluorite", ModBlocks.block_fluorite);
OreDictionary.registerOre("blockSteel", ModBlocks.block_steel);
OreDictionary.registerOre("blockLead", ModBlocks.block_lead);
/*achievementGetTitanium = new Achievement("achievement.getTitanium", "getTitanium", 0, -8, ModItems.ingot_titanium, (Achievement)null).initIndependentStat().registerStat();
AchievementPage.registerAchievementPage(new AchievementPage("Nuclear Tech", new Achievement[] {
achievementGetTitanium
}));*/
}
@EventHandler