finished new sat system, schrab and euph clusters, gerald recipe
@ -1607,6 +1607,9 @@ item.clip_defabricator.name=Gürtel mit Defabrikator-Energiezellen
|
||||
item.ammo_container.name=Munitionsbehälter
|
||||
|
||||
tile.block_schrabidium.name=Schrabidiumblock
|
||||
tile.block_euphemium.name=Euphemiumblock
|
||||
tile.block_schrabidium_cluster.name=Schrabidium-Cluster
|
||||
tile.block_euphemium_cluster.name=Euphemiumgeätzter Schrabidium-Cluster
|
||||
item.plate_gold.name=Goldplatte
|
||||
|
||||
item.syringe_empty.name=Leere Spritze
|
||||
|
||||
@ -1607,6 +1607,9 @@ item.clip_defabricator.name=Belt with Defabricator Energy Cells
|
||||
item.ammo_container.name=Ammo Container
|
||||
|
||||
tile.block_schrabidium.name=Block of Schrabidium
|
||||
tile.block_euphemium.name=Block of Euphemium
|
||||
tile.block_schrabidium_cluster.name=Schrabidium Cluster
|
||||
tile.block_euphemium_cluster.name=Euphemium-Etched Schrabidium Cluster
|
||||
item.plate_gold.name=Gold Plate
|
||||
|
||||
item.syringe_empty.name=Empty Syringe
|
||||
|
||||
@ -169,5 +169,6 @@
|
||||
"alarm.airRaid": {"category": "record", "sounds": [{"name": "alarm/airRaid", "stream": true}]},
|
||||
"alarm.classic": {"category": "record", "sounds": [{"name": "alarm/classicSiren", "stream": false}]},
|
||||
"alarm.gambit": {"category": "record", "sounds": [{"name": "alarm/gambit", "stream": true}]},
|
||||
"alarm.soyuzed": {"category": "record", "sounds": [{"name": "alarm/soyuzed", "stream": false}]}
|
||||
"alarm.soyuzed": {"category": "record", "sounds": [{"name": "alarm/soyuzed", "stream": false}]},
|
||||
"alarm.chime": {"category": "record", "sounds": [{"name": "alarm/chime", "stream": false}]}
|
||||
}
|
||||
|
||||
BIN
assets/hbm/sounds/alarm/chime.ogg
Normal file
BIN
assets/hbm/textures/blocks/block_euphemium.png
Normal file
|
After Width: | Height: | Size: 297 B |
BIN
assets/hbm/textures/blocks/block_euphemium_cluster_side.png
Normal file
|
After Width: | Height: | Size: 290 B |
BIN
assets/hbm/textures/blocks/block_euphemium_cluster_top.png
Normal file
|
After Width: | Height: | Size: 857 B |
BIN
assets/hbm/textures/blocks/block_schrabidium_cluster_side.png
Normal file
|
After Width: | Height: | Size: 290 B |
BIN
assets/hbm/textures/blocks/block_schrabidium_cluster_top.png
Normal file
|
After Width: | Height: | Size: 299 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
assets/hbm/textures/items/new/scrap_advanced.png
Normal file
|
After Width: | Height: | Size: 424 B |
BIN
assets/hbm/textures/items/new/scrap_aluminium.png
Normal file
|
After Width: | Height: | Size: 462 B |
BIN
assets/hbm/textures/items/new/scrap_beryllium.png
Normal file
|
After Width: | Height: | Size: 454 B |
BIN
assets/hbm/textures/items/new/scrap_cmb.png
Normal file
|
After Width: | Height: | Size: 442 B |
BIN
assets/hbm/textures/items/new/scrap_copper.png
Normal file
|
After Width: | Height: | Size: 428 B |
BIN
assets/hbm/textures/items/new/scrap_desh.png
Normal file
|
After Width: | Height: | Size: 366 B |
BIN
assets/hbm/textures/items/new/scrap_dineutronium.png
Normal file
|
After Width: | Height: | Size: 488 B |
BIN
assets/hbm/textures/items/new/scrap_dura_steel.png
Normal file
|
After Width: | Height: | Size: 420 B |
BIN
assets/hbm/textures/items/new/scrap_iron.png
Normal file
|
After Width: | Height: | Size: 457 B |
BIN
assets/hbm/textures/items/new/scrap_lead.png
Normal file
|
After Width: | Height: | Size: 447 B |
BIN
assets/hbm/textures/items/new/scrap_magnetized_tungsten.png
Normal file
|
After Width: | Height: | Size: 507 B |
BIN
assets/hbm/textures/items/new/scrap_neptunium.png
Normal file
|
After Width: | Height: | Size: 453 B |
BIN
assets/hbm/textures/items/new/scrap_plutonium.png
Normal file
|
After Width: | Height: | Size: 459 B |
BIN
assets/hbm/textures/items/new/scrap_red_copper.png
Normal file
|
After Width: | Height: | Size: 457 B |
BIN
assets/hbm/textures/items/new/scrap_saturnite.png
Normal file
|
After Width: | Height: | Size: 454 B |
BIN
assets/hbm/textures/items/new/scrap_schrabidium.png
Normal file
|
After Width: | Height: | Size: 443 B |
BIN
assets/hbm/textures/items/new/scrap_steel.png
Normal file
|
After Width: | Height: | Size: 429 B |
BIN
assets/hbm/textures/items/new/scrap_titanium.png
Normal file
|
After Width: | Height: | Size: 423 B |
BIN
assets/hbm/textures/items/new/scrap_tungsten.png
Normal file
|
After Width: | Height: | Size: 397 B |
BIN
assets/hbm/textures/items/new/scrap_uranium.png
Normal file
|
After Width: | Height: | Size: 475 B |
@ -5,12 +5,10 @@ import com.hbm.blocks.bomb.*;
|
||||
import com.hbm.blocks.fluid.*;
|
||||
import com.hbm.blocks.machine.*;
|
||||
import com.hbm.blocks.test.*;
|
||||
import com.hbm.items.block.ItemBlockLore;
|
||||
import com.hbm.items.block.ItemTaintBlock;
|
||||
import com.hbm.items.bomb.ItemPrototypeBlock;
|
||||
import com.hbm.items.special.ItemBlockLore;
|
||||
import com.hbm.items.special.ItemOreBlock;
|
||||
import com.hbm.items.special.ItemPlasmaBlock;
|
||||
import com.hbm.items.special.ItemSchrabidiumBlock;
|
||||
import com.hbm.items.special.ItemTaintBlock;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
@ -111,6 +109,9 @@ public class ModBlocks {
|
||||
public static Block block_electrical_scrap;
|
||||
public static Block block_beryllium;
|
||||
public static Block block_schrabidium;
|
||||
public static Block block_euphemium;
|
||||
public static Block block_schrabidium_cluster;
|
||||
public static Block block_euphemium_cluster;
|
||||
public static Block block_advanced_alloy;
|
||||
public static Block block_magnetized_tungsten;
|
||||
public static Block block_combine_steel;
|
||||
@ -827,6 +828,9 @@ public class ModBlocks {
|
||||
block_electrical_scrap = new BlockFalling(Material.iron).setBlockName("block_electrical_scrap").setCreativeTab(MainRegistry.blockTab).setHardness(2.5F).setResistance(5.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName(RefStrings.MODID + ":electrical_scrap_alt2");
|
||||
block_beryllium = new BlockGeneric(Material.iron).setBlockName("block_beryllium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_beryllium");
|
||||
block_schrabidium = new BlockGeneric(Material.iron).setBlockName("block_schrabidium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(600.0F).setBlockTextureName(RefStrings.MODID + ":block_schrabidium");
|
||||
block_euphemium = new BlockGeneric(Material.iron).setBlockName("block_euphemium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(60000.0F).setBlockTextureName(RefStrings.MODID + ":block_euphemium");
|
||||
block_schrabidium_cluster = new BlockGenericPillar(Material.rock).setBlockName("block_schrabidium_cluster").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(60000.0F);
|
||||
block_euphemium_cluster = new BlockGenericPillar(Material.rock).setBlockName("block_euphemium_cluster").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(60000.0F);
|
||||
block_advanced_alloy = new BlockGeneric(Material.iron).setBlockName("block_advanced_alloy").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_advanced_alloy");
|
||||
block_magnetized_tungsten = new BlockGeneric(Material.iron).setBlockName("block_magnetized_tungsten").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(35.0F).setBlockTextureName(RefStrings.MODID + ":block_magnetized_tungsten");
|
||||
block_combine_steel = new BlockGeneric(Material.iron).setBlockName("block_combine_steel").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(600.0F).setBlockTextureName(RefStrings.MODID + ":block_combine_steel");
|
||||
@ -1357,7 +1361,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(ore_oil_sand, ore_oil_sand.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_lignite, ore_lignite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_asbestos, ore_asbestos.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_schrabidium, ItemSchrabidiumBlock.class, ore_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_schrabidium, ItemBlockLore.class, ore_schrabidium.getUnlocalizedName());
|
||||
|
||||
//Rare Minerals
|
||||
GameRegistry.registerBlock(ore_australium, ItemOreBlock.class, ore_australium.getUnlocalizedName());
|
||||
@ -1374,7 +1378,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(ore_nether_tungsten, ore_nether_tungsten.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_nether_sulfur, ore_nether_sulfur.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_nether_fire, ore_nether_fire.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_nether_schrabidium, ItemSchrabidiumBlock.class, ore_nether_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_nether_schrabidium, ItemBlockLore.class, ore_nether_schrabidium.getUnlocalizedName());
|
||||
|
||||
//Meteor Ores
|
||||
GameRegistry.registerBlock(ore_meteor_uranium, ore_meteor_uranium.getUnlocalizedName());
|
||||
@ -1413,7 +1417,10 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(block_asbestos, block_asbestos.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_trinitite, block_trinitite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_waste, block_waste.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_schrabidium, ItemSchrabidiumBlock.class, block_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_schrabidium, ItemBlockLore.class, block_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_euphemium, ItemBlockLore.class, block_euphemium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_schrabidium_cluster, ItemBlockLore.class, block_schrabidium_cluster.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_euphemium_cluster, ItemBlockLore.class, block_euphemium_cluster.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_magnetized_tungsten, block_magnetized_tungsten.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_combine_steel, block_combine_steel.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_desh, block_desh.getUnlocalizedName());
|
||||
@ -1763,7 +1770,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, ItemPlasmaBlock.class, plasma.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(plasma, ItemBlockLore.class, plasma.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(watz_element, watz_element.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_control, watz_control.getUnlocalizedName());
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -21,8 +22,18 @@ public class BlockGenericPillar extends BlockRotatedPillar {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg)
|
||||
{
|
||||
this.field_150164_N = reg.registerIcon(RefStrings.MODID + ":meteor_pillar_top");
|
||||
this.iconSide = reg.registerIcon(RefStrings.MODID + ":meteor_pillar");
|
||||
if(this == ModBlocks.meteor_pillar) {
|
||||
this.field_150164_N = reg.registerIcon(RefStrings.MODID + ":meteor_pillar_top");
|
||||
this.iconSide = reg.registerIcon(RefStrings.MODID + ":meteor_pillar");
|
||||
}
|
||||
if(this == ModBlocks.block_schrabidium_cluster) {
|
||||
this.field_150164_N = reg.registerIcon(RefStrings.MODID + ":block_schrabidium_cluster_top");
|
||||
this.iconSide = reg.registerIcon(RefStrings.MODID + ":block_schrabidium_cluster_side");
|
||||
}
|
||||
if(this == ModBlocks.block_euphemium_cluster) {
|
||||
this.field_150164_N = reg.registerIcon(RefStrings.MODID + ":block_euphemium_cluster_top");
|
||||
this.iconSide = reg.registerIcon(RefStrings.MODID + ":block_euphemium_cluster_side");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -12,7 +14,9 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class WasteLog extends Block {
|
||||
|
||||
@ -37,7 +41,7 @@ public class WasteLog extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
public Item getItemDropped(int i, Random rand, int j)
|
||||
{
|
||||
if(this == ModBlocks.waste_log)
|
||||
{
|
||||
@ -50,6 +54,17 @@ public class WasteLog extends Block {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
|
||||
if(this == ModBlocks.waste_log && world.rand.nextInt(1000) == 0) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(new ItemStack(ModItems.burnt_bark));
|
||||
return ret;
|
||||
}
|
||||
|
||||
return super.getDrops(world, x, y, z, metadata, fortune);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random p_149745_1_)
|
||||
|
||||
@ -24,13 +24,9 @@ public class EntityTom extends EntityThrowable {
|
||||
this.lastTickPosZ = this.prevPosZ = posZ;
|
||||
this.setPosition(posX + this.motionX, posY + this.motionY, posZ + this.motionZ);
|
||||
|
||||
/*this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;*/
|
||||
if(this.ticksExisted % 100 == 0) {
|
||||
worldObj.playSoundEffect(posX, posY, posZ, "hbm:alarm.chime", 10000, 1.0F);
|
||||
}
|
||||
|
||||
motionY = -0.5;
|
||||
|
||||
|
||||
@ -93,8 +93,12 @@ public class ExplosionBalefire
|
||||
while(y > 0) {
|
||||
|
||||
if(strength <= 10) {
|
||||
if(worldObj.rand.nextInt(10) == 0)
|
||||
if(worldObj.rand.nextInt(10) == 0) {
|
||||
worldObj.setBlock(pX, y + 1, pZ, ModBlocks.balefire);
|
||||
|
||||
if(worldObj.getBlock(pX, y, pZ) == ModBlocks.block_schrabidium_cluster)
|
||||
worldObj.setBlock(pX, y, pZ, ModBlocks.block_euphemium_cluster, worldObj.getBlockMetadata(pX, y, pZ), 3);
|
||||
}
|
||||
|
||||
if(worldObj.getBlock(pX, y, pZ) == Blocks.stone)
|
||||
worldObj.setBlock(pX, y, pZ, ModBlocks.sellafield_slaked);
|
||||
|
||||
@ -215,6 +215,10 @@ public class MachineRecipes {
|
||||
ItemStack[] starmetal = new ItemStack[] { new ItemStack(ModItems.powder_dura_steel, 3),
|
||||
new ItemStack(ModItems.powder_astatine, 1), new ItemStack(ModItems.powder_cobalt, 2),
|
||||
new ItemStack(Blocks.gravel, 1) };
|
||||
|
||||
ItemStack[] euphCluster = new ItemStack[] { new ItemStack(ModItems.nugget_euphemium, 7),
|
||||
new ItemStack(ModItems.powder_schrabidium, 4), new ItemStack(ModItems.ingot_starmetal, 2),
|
||||
new ItemStack(ModItems.nugget_solinium, 2) };
|
||||
|
||||
if (MainRegistry.enableDebugMode) {
|
||||
if (item.getItem() == Item.getItemFromBlock(ModBlocks.test_render)) {
|
||||
@ -366,6 +370,10 @@ public class MachineRecipes {
|
||||
return starmetal;
|
||||
}
|
||||
|
||||
if (item.getItem() == Item.getItemFromBlock(ModBlocks.block_euphemium_cluster)) {
|
||||
return euphCluster;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1316,6 +1324,8 @@ public class MachineRecipes {
|
||||
getCentrifugeOutput(new ItemStack(ModBlocks.ore_lignite)));
|
||||
recipes.put(new ItemStack(ModBlocks.ore_meteor_starmetal),
|
||||
getCentrifugeOutput(new ItemStack(ModBlocks.ore_meteor_starmetal)));
|
||||
recipes.put(new ItemStack(ModBlocks.block_euphemium_cluster),
|
||||
getCentrifugeOutput(new ItemStack(ModBlocks.block_euphemium_cluster)));
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@ -5031,6 +5041,7 @@ public class MachineRecipes {
|
||||
list.add(new ItemStack(ModItems.dynosphere_schrabidium_charged, 1));
|
||||
list.add(new ItemStack(ModItems.ingot_plutonium, 1));
|
||||
list.add(new ItemStack(ModItems.catalyst_clay, 16));
|
||||
list.add(new ItemStack(ModItems.ingot_euphemium, 1));
|
||||
break;
|
||||
case DYN_DNT:
|
||||
list.add(new ItemStack(ModItems.dynosphere_euphemium_charged, 2));
|
||||
@ -5352,7 +5363,7 @@ public class MachineRecipes {
|
||||
output[0] = new ItemStack(ModItems.ingot_schrabidium, 1);
|
||||
break;
|
||||
case DYN_EUPH:
|
||||
output[0] = new ItemStack(ModItems.ingot_euphemium, 1);
|
||||
output[0] = new ItemStack(ModItems.nugget_euphemium, 12);
|
||||
break;
|
||||
case DYN_DNT:
|
||||
output[0] = new ItemStack(ModItems.ingot_dineutronium, 1);
|
||||
|
||||
@ -1,17 +1,14 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.gui.GUIRadioRec.RadioButton;
|
||||
import com.hbm.items.tool.ItemSatInterface;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.SatLaserPacket;
|
||||
import com.hbm.packet.SatCoordPacket;
|
||||
import com.hbm.saveddata.satellites.Satellite.CoordActions;
|
||||
import com.hbm.saveddata.satellites.Satellite.InterfaceActions;
|
||||
import com.hbm.saveddata.satellites.Satellite.Interfaces;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -29,8 +26,6 @@ public class GUIScreenSatCoord extends GuiScreen {
|
||||
protected int guiLeft;
|
||||
protected int guiTop;
|
||||
private final EntityPlayer player;
|
||||
int x;
|
||||
int z;
|
||||
|
||||
private GuiTextField xField;
|
||||
private GuiTextField yField;
|
||||
@ -68,20 +63,51 @@ public class GUIScreenSatCoord extends GuiScreen {
|
||||
protected void mouseClicked(int i, int j, int k)
|
||||
{
|
||||
super.mouseClicked(i, j, k);
|
||||
|
||||
if(ItemSatInterface.currentSat == null)
|
||||
return;
|
||||
|
||||
this.xField.mouseClicked(i, j, k);
|
||||
if(ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y)) this.yField.mouseClicked(i, j, k);
|
||||
this.zField.mouseClicked(i, j, k);
|
||||
|
||||
if(i >= this.guiLeft + 133 && i < this.guiLeft + 133 + 18 && j >= this.guiTop + 52 && j < this.guiTop + 52 + 18 && player != null) {
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:item.techBleep"), 1.0F));
|
||||
|
||||
PacketDispatcher.wrapper.sendToServer(new SatLaserPacket(x, z, ItemSatInterface.getFreq(player.getHeldItem())));
|
||||
if(NumberUtils.isNumber(xField.getText()) && NumberUtils.isNumber(zField.getText())) {
|
||||
|
||||
if(ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y)) {
|
||||
|
||||
if(NumberUtils.isNumber(yField.getText())) {
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:item.techBleep"), 1.0F));
|
||||
PacketDispatcher.wrapper.sendToServer(
|
||||
new SatCoordPacket(
|
||||
(int)Double.parseDouble(xField.getText()),
|
||||
(int)Double.parseDouble(yField.getText()),
|
||||
(int)Double.parseDouble(zField.getText()),
|
||||
ItemSatInterface.getFreq(player.getHeldItem())));
|
||||
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:item.techBleep"), 1.0F));
|
||||
PacketDispatcher.wrapper.sendToServer(
|
||||
new SatCoordPacket(
|
||||
(int)Double.parseDouble(xField.getText()),
|
||||
0,
|
||||
(int)Double.parseDouble(zField.getText()),
|
||||
ItemSatInterface.getFreq(player.getHeldItem())));
|
||||
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void drawScreen(int mouseX, int mouseY, float f)
|
||||
{
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
|
||||
this.drawDefaultBackground();
|
||||
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
@ -98,7 +124,7 @@ public class GUIScreenSatCoord extends GuiScreen {
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
|
||||
this.xField.drawTextBox();
|
||||
if(ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y)) this.yField.drawTextBox();
|
||||
if(ItemSatInterface.currentSat != null && ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y)) this.yField.drawTextBox();
|
||||
this.zField.drawTextBox();
|
||||
}
|
||||
|
||||
@ -106,9 +132,21 @@ public class GUIScreenSatCoord extends GuiScreen {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(xField.isFocused())
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 16, 0, 126, 54, 18);
|
||||
|
||||
if(yField.isFocused())
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 52, 0, 126, 54, 18);
|
||||
|
||||
if(zField.isFocused())
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 88, 0, 126, 54, 18);
|
||||
|
||||
if(ItemSatInterface.currentSat != null) {
|
||||
|
||||
if(!ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y))
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 52, 0, 144, 54, 18);
|
||||
|
||||
drawTexturedModalRect(guiLeft + 120, guiTop + 17, 194, 0, 7, 7);
|
||||
|
||||
if(ItemSatInterface.currentSat.satIface == Interfaces.SAT_COORD) {
|
||||
@ -122,7 +160,7 @@ public class GUIScreenSatCoord extends GuiScreen {
|
||||
|
||||
|
||||
if (this.xField.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
|
||||
} else if (ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y) && this.yField.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
|
||||
} else if (ItemSatInterface.currentSat != null && ItemSatInterface.currentSat.coordAcs.contains(CoordActions.HAS_Y) && this.yField.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
|
||||
} else if (this.zField.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
|
||||
} else {
|
||||
|
||||
|
||||
@ -2416,7 +2416,7 @@ public class ModItems {
|
||||
recycled_misc = new Item().setUnlocalizedName("recycled_misc").setCreativeTab(null).setTextureName(RefStrings.MODID + ":recycled_misc");
|
||||
|
||||
rod_empty = new Item().setUnlocalizedName("rod_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_empty");
|
||||
rod_th232 = new ItemRadioactive().setUnlocalizedName("rod_th232").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_th232");
|
||||
rod_th232 = new ItemCustomLore().setUnlocalizedName("rod_th232").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_th232");
|
||||
rod_uranium = new ItemRadioactive().setUnlocalizedName("rod_uranium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_uranium");
|
||||
rod_u233 = new ItemRadioactive().setUnlocalizedName("rod_u233").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_u233");
|
||||
rod_u235 = new ItemRadioactive().setUnlocalizedName("rod_u235").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_u235");
|
||||
@ -2438,7 +2438,7 @@ public class ModItems {
|
||||
rod_verticium = new ItemCustomLore().setUnlocalizedName("rod_verticium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_verticium");
|
||||
|
||||
rod_dual_empty = new Item().setUnlocalizedName("rod_dual_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_dual_empty");
|
||||
rod_dual_th232 = new ItemRadioactive().setUnlocalizedName("rod_dual_th232").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_th232");
|
||||
rod_dual_th232 = new ItemCustomLore().setUnlocalizedName("rod_dual_th232").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_th232");
|
||||
rod_dual_uranium = new ItemRadioactive().setUnlocalizedName("rod_dual_uranium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_uranium");
|
||||
rod_dual_u233 = new ItemRadioactive().setUnlocalizedName("rod_dual_u233").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_u233");
|
||||
rod_dual_u235 = new ItemRadioactive().setUnlocalizedName("rod_dual_u235").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_u235");
|
||||
@ -2453,7 +2453,7 @@ public class ModItems {
|
||||
rod_dual_solinium = new ItemRadioactive().setUnlocalizedName("rod_dual_solinium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_dual_empty).setTextureName(RefStrings.MODID + ":rod_dual_solinium");
|
||||
|
||||
rod_quad_empty = new Item().setUnlocalizedName("rod_quad_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_quad_empty");
|
||||
rod_quad_th232 = new ItemRadioactive().setUnlocalizedName("rod_quad_th232").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_th232");
|
||||
rod_quad_th232 = new ItemCustomLore().setUnlocalizedName("rod_quad_th232").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_th232");
|
||||
rod_quad_uranium = new ItemRadioactive().setUnlocalizedName("rod_quad_uranium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_uranium");
|
||||
rod_quad_u233 = new ItemRadioactive().setUnlocalizedName("rod_quad_u233").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_u233");
|
||||
rod_quad_u235 = new ItemRadioactive().setUnlocalizedName("rod_quad_u235").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_quad_empty).setTextureName(RefStrings.MODID + ":rod_quad_u235");
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.items.special;
|
||||
package com.hbm.items.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.blocks.generic.RedBarrel;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -52,4 +53,18 @@ public class ItemBlockLore extends ItemBlock {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack) {
|
||||
|
||||
if(this.field_150939_a == ModBlocks.ore_schrabidium || this.field_150939_a == ModBlocks.ore_nether_schrabidium ||
|
||||
this.field_150939_a == ModBlocks.block_schrabidium || this.field_150939_a == ModBlocks.block_schrabidium_cluster)
|
||||
return EnumRarity.rare;
|
||||
|
||||
if(this.field_150939_a == ModBlocks.block_euphemium || this.field_150939_a == ModBlocks.block_euphemium_cluster ||
|
||||
this.field_150939_a == ModBlocks.plasma || this.field_150939_a == ModBlocks.fwatz_plasma)
|
||||
return EnumRarity.epic;
|
||||
|
||||
return EnumRarity.common;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.items.special;
|
||||
package com.hbm.items.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -30,9 +30,9 @@ public class ItemAppleEuphemium extends ItemFood {
|
||||
{
|
||||
if (!p_77849_2_.isRemote)
|
||||
{
|
||||
p_77849_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 2147483647, 127));
|
||||
p_77849_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 2147483647, 120));
|
||||
p_77849_3_.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2147483647, 0));
|
||||
p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 2147483647, 127));
|
||||
p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 2147483647, 120));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,23 +1,20 @@
|
||||
package com.hbm.items.gear;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
public class ArmorEuphemium extends ItemArmor implements ISpecialArmor {
|
||||
public class ArmorEuphemium extends ItemArmor {
|
||||
|
||||
private String [] armourTypes = new String [] {"euphemium_helmet", "euphemium_chest", "euphemium_legs", "euphemium_boots"};
|
||||
|
||||
public ArmorEuphemium(ArmorMaterial armorMaterial, int renderIndex, int armorType) {
|
||||
@ -37,42 +34,6 @@ public class ArmorEuphemium extends ItemArmor implements ISpecialArmor {
|
||||
else return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if(player instanceof EntityPlayer && Library.checkArmor((EntityPlayer)player, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots))
|
||||
{
|
||||
return new ArmorProperties(1, 1, MathHelper.floor_double(999999999));
|
||||
}
|
||||
return new ArmorProperties(0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if(slot == 0)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
if(slot == 1)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
if(slot == 2)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
if(slot == 3)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
stack.damageItem(damage * 0, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {
|
||||
if(player instanceof EntityPlayer && Library.checkArmor(player, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots))
|
||||
@ -96,5 +57,9 @@ public class ArmorEuphemium extends ItemArmor implements ISpecialArmor {
|
||||
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
//do literally nothing lole
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) { }
|
||||
|
||||
}
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemPlasmaBlock extends ItemBlock {
|
||||
|
||||
public ItemPlasmaBlock(Block p_i45328_1_) {
|
||||
super(p_i45328_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack p_77613_1_)
|
||||
{
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemSchrabidiumBlock extends ItemBlock {
|
||||
|
||||
public ItemSchrabidiumBlock(Block p_i45328_1_) {
|
||||
super(p_i45328_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack p_77613_1_) {
|
||||
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
}
|
||||
@ -602,7 +602,23 @@ public class ItemAssemblyTemplate extends Item {
|
||||
new ItemStack(Blocks.redstone_block, 12),
|
||||
new ItemStack(ModItems.powder_magnetized_tungsten, 6),
|
||||
new ItemStack(ModItems.circuit_targeting_tier4, 1)),
|
||||
new ItemStack(ModItems.mp_warhead_15_n2));
|
||||
new ItemStack(ModItems.mp_warhead_15_n2)),
|
||||
|
||||
GERALD(1200, Arrays.asList(
|
||||
new ItemStack(ModItems.cap_star, 1),
|
||||
new ItemStack(ModItems.chlorine_pinwheel, 1),
|
||||
new ItemStack(ModItems.burnt_bark, 1),
|
||||
new ItemStack(ModItems.combine_scrap, 1),
|
||||
new ItemStack(ModBlocks.block_euphemium_cluster, 1),
|
||||
new ItemStack(ModItems.crystal_horn, 1),
|
||||
new ItemStack(ModItems.crystal_charred, 1),
|
||||
new ItemStack(ModBlocks.pink_log, 1),
|
||||
new ItemStack(ModItems.mp_warhead_15_balefire, 1),
|
||||
new ItemStack(ModBlocks.crate_red, 1),
|
||||
new ItemStack(ModBlocks.det_nuke, 16),
|
||||
new ItemStack(ModItems.ingot_starmetal, 32)),
|
||||
|
||||
new ItemStack(ModItems.sat_gerald));
|
||||
|
||||
private EnumAssemblyTemplate() { }
|
||||
|
||||
|
||||
@ -19,8 +19,11 @@ public class ItemSatChip extends Item {
|
||||
if(this == ModItems.sat_foeq)
|
||||
list.add("Gives you an achievement. That's it.");
|
||||
|
||||
if(this == ModItems.sat_gerald)
|
||||
list.add("Unused (for now)");
|
||||
if(this == ModItems.sat_gerald) {
|
||||
list.add("Single use.");
|
||||
list.add("Requires orbital module.");
|
||||
list.add("Melter of CPUs, bane of every server owner.");
|
||||
}
|
||||
|
||||
if(this == ModItems.sat_laser)
|
||||
list.add("Allows to summon lasers with a 15 second cooldown.");
|
||||
@ -35,7 +38,7 @@ public class ItemSatChip extends Item {
|
||||
list.add("Shows a map of active entities.");
|
||||
|
||||
if(this == ModItems.sat_resonator)
|
||||
list.add("Unused");
|
||||
list.add("Allows for teleportation with no cooldown.");
|
||||
|
||||
if(this == ModItems.sat_scanner)
|
||||
list.add("Creates a topdown map of underground ores.");
|
||||
|
||||
@ -120,6 +120,8 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_scrap), 1), new Object[] { "###", "###", "###", '#', ModItems.dust });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_beryllium), 1), new Object[] { "###", "###", "###", '#', ModItems.ingot_beryllium });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_schrabidium), 1), new Object[] { "###", "###", "###", '#', ModItems.ingot_schrabidium });
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.block_schrabidium_cluster, 1), new Object[] { "#S#", "S#S", "#S#", '#', ModItems.ingot_schrabidium, 'S', ModItems.ingot_starmetal });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_euphemium), 1), new Object[] { "###", "###", "###", '#', ModItems.ingot_euphemium });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_advanced_alloy), 1), new Object[] { "###", "###", "###", '#', ModItems.ingot_advanced_alloy });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_magnetized_tungsten), 1), new Object[] { "###", "###", "###", '#', ModItems.ingot_magnetized_tungsten });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_combine_steel), 1), new Object[] { "###", "###", "###", '#', ModItems.ingot_combine_steel });
|
||||
@ -167,6 +169,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.nuclear_waste, 9), new Object[] { "#", '#', Item.getItemFromBlock(ModBlocks.block_waste) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ingot_beryllium, 9), new Object[] { "#", '#', Item.getItemFromBlock(ModBlocks.block_beryllium) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ingot_schrabidium, 9), new Object[] { "#", '#', Item.getItemFromBlock(ModBlocks.block_schrabidium) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ingot_euphemium, 9), new Object[] { "#", '#', Item.getItemFromBlock(ModBlocks.block_euphemium) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ingot_advanced_alloy, 9), new Object[] { "#", '#', Item.getItemFromBlock(ModBlocks.block_advanced_alloy) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ingot_magnetized_tungsten, 9), new Object[] { "#", '#', Item.getItemFromBlock(ModBlocks.block_magnetized_tungsten) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ingot_combine_steel, 9), new Object[] { "#", '#', Item.getItemFromBlock(ModBlocks.block_combine_steel) });
|
||||
@ -447,7 +450,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.deco_titanium), new Object[] { "ingotTitanium", ModBlocks.steel_scaffold }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.deco_tungsten), new Object[] { "ingotTungsten", ModBlocks.steel_scaffold }));
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_euphemium, 1), new Object[] { ModItems.rod_quad_euphemium });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.nugget_euphemium, 1), new Object[] { "###", "###", "###", '#', ModItems.rod_quad_euphemium });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ingot_euphemium, 1), new Object[] { "###", "###", "###", '#', ModItems.nugget_euphemium });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.nugget_euphemium, 9), new Object[] { "#", '#', ModItems.ingot_euphemium });
|
||||
|
||||
|
||||
@ -43,10 +43,12 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.tileentity.TileEntitySign;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.event.entity.EntityEvent.EnteringChunk;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
@ -347,6 +349,18 @@ public class ModEventHandler
|
||||
//////////////////////
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityHurt(LivingAttackEvent event) {
|
||||
|
||||
EntityLivingBase e = event.entityLiving;
|
||||
DamageSource dmg = event.source;
|
||||
|
||||
if(e instanceof EntityPlayer && Library.checkArmor((EntityPlayer)e, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots)) {
|
||||
e.worldObj.playSoundAtEntity(e, "random.break", 5F, 1.0F + e.getRNG().nextFloat() * 0.5F);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ public class SatCoordPacket implements IMessage {
|
||||
Satellite sat = SatelliteSavedData.getData(p.worldObj).getSatFromFreq(m.freq);
|
||||
|
||||
if(sat != null)
|
||||
sat.onCoordAction(p.worldObj, m.x, m.y, m.z);
|
||||
sat.onCoordAction(p.worldObj, p, m.x, m.y, m.z);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ public class RenderTom extends Render {
|
||||
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
GL11.glTranslated(x, y - 50, z);
|
||||
|
||||
TomPronter.prontTom();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@ -48,8 +48,6 @@ public class SatelliteSavedData extends WorldSavedData {
|
||||
int freq = nbt.getInteger("sat_freq_" + i);
|
||||
|
||||
sats.put(freq, sat);
|
||||
|
||||
System.out.println("Loaded sat" + i + " " + sat.getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,8 +66,6 @@ public class SatelliteSavedData extends WorldSavedData {
|
||||
nbt.setTag("sat_data_" + i, data);
|
||||
nbt.setInteger("sat_freq_" + i, struct.getKey());
|
||||
i++;
|
||||
|
||||
System.out.println("Saved sat" + i + " " + struct.getValue().getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.List;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.saveddata.SatelliteSavedData;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
@ -119,5 +120,5 @@ public abstract class Satellite {
|
||||
* @param y ditto
|
||||
* @param z ditto
|
||||
*/
|
||||
public void onCoordAction(World world, int x, int y, int z) { }
|
||||
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) { }
|
||||
}
|
||||
|
||||
@ -1,12 +1,20 @@
|
||||
package com.hbm.saveddata.satellites;
|
||||
|
||||
import com.hbm.entity.projectile.EntityTom;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.saveddata.SatelliteSavedData;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SatelliteHorizons extends Satellite {
|
||||
|
||||
boolean used = false;
|
||||
|
||||
public SatelliteHorizons() {
|
||||
this.satIface = Interfaces.SAT_COORD;
|
||||
}
|
||||
@ -16,4 +24,34 @@ public class SatelliteHorizons extends Satellite {
|
||||
for(Object p : world.playerEntities)
|
||||
((EntityPlayer)p).triggerAchievement(MainRegistry.horizonsStart);
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setBoolean("used", used);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
used = nbt.getBoolean("used");
|
||||
}
|
||||
|
||||
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) {
|
||||
|
||||
if(used)
|
||||
return;
|
||||
|
||||
used = true;
|
||||
SatelliteSavedData.getData(world).markDirty();
|
||||
|
||||
EntityTom tom = new EntityTom(world);
|
||||
tom.setPosition(x + 0.5, 600, z + 0.5);
|
||||
world.spawnEntityInWorld(tom);
|
||||
|
||||
for(Object p : world.playerEntities)
|
||||
((EntityPlayer)p).triggerAchievement(MainRegistry.horizonsEnd);
|
||||
|
||||
//not necessary but JUST to make sure
|
||||
if(!world.isRemote) {
|
||||
|
||||
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(EnumChatFormatting.RED + "Horizons has been activated."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,23 @@
|
||||
package com.hbm.saveddata.satellites;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SatelliteResonator extends Satellite {
|
||||
|
||||
public SatelliteResonator() {
|
||||
this.coordAcs.add(CoordActions.HAS_Y);
|
||||
this.satIface = Interfaces.SAT_COORD;
|
||||
}
|
||||
|
||||
public void onCoordAction(World world, EntityPlayer player, int x, int y, int z) {
|
||||
|
||||
if(!(player instanceof EntityPlayerMP))
|
||||
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.endermen.portal", 1.0F, 1.0F);
|
||||
player.mountEntity(null);
|
||||
((EntityPlayerMP)player).playerNetServerHandler.setPlayerLocation(x + 0.5D, y, z + 0.5D, player.rotationYaw, player.rotationPitch);
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.endermen.portal", 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,90 +288,88 @@ public class TileEntityMachineAssembler extends TileEntity implements ISidedInve
|
||||
progress = 0;
|
||||
|
||||
int meta = worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
TileEntity te = null;
|
||||
|
||||
TileEntity te1 = null;
|
||||
TileEntity te2 = null;
|
||||
|
||||
if(meta == 2) {
|
||||
te = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord);
|
||||
te1 = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord);
|
||||
te2 = worldObj.getTileEntity(xCoord + 3, yCoord, zCoord - 1);
|
||||
}
|
||||
if(meta == 3) {
|
||||
te = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord);
|
||||
te1 = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord);
|
||||
te2 = worldObj.getTileEntity(xCoord - 3, yCoord, zCoord + 1);
|
||||
}
|
||||
if(meta == 4) {
|
||||
te = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2);
|
||||
te1 = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2);
|
||||
te2 = worldObj.getTileEntity(xCoord - 1, yCoord, zCoord - 3);
|
||||
}
|
||||
if(meta == 5) {
|
||||
te = worldObj.getTileEntity(xCoord, yCoord, zCoord - 2);
|
||||
te1 = worldObj.getTileEntity(xCoord, yCoord, zCoord - 2);
|
||||
te2 = worldObj.getTileEntity(xCoord + 1, yCoord, zCoord + 3);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityChest) {
|
||||
TileEntityChest chest = (TileEntityChest)te;
|
||||
tryExchangeTemplates(te1, te2);
|
||||
|
||||
//OUTPUT
|
||||
if(te1 instanceof TileEntityChest) {
|
||||
TileEntityChest chest = (TileEntityChest)te1;
|
||||
|
||||
tryFillContainer(chest, 5);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityHopper) {
|
||||
TileEntityHopper hopper = (TileEntityHopper)te;
|
||||
if(te1 instanceof TileEntityHopper) {
|
||||
TileEntityHopper hopper = (TileEntityHopper)te1;
|
||||
|
||||
tryFillContainer(hopper, 5);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateIron) {
|
||||
TileEntityCrateIron hopper = (TileEntityCrateIron)te;
|
||||
if(te1 instanceof TileEntityCrateIron) {
|
||||
TileEntityCrateIron hopper = (TileEntityCrateIron)te1;
|
||||
|
||||
tryFillContainer(hopper, 5);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateSteel) {
|
||||
TileEntityCrateSteel hopper = (TileEntityCrateSteel)te;
|
||||
if(te1 instanceof TileEntityCrateSteel) {
|
||||
TileEntityCrateSteel hopper = (TileEntityCrateSteel)te1;
|
||||
|
||||
tryFillContainer(hopper, 5);
|
||||
}
|
||||
|
||||
te = null;
|
||||
if(meta == 2) {
|
||||
te = worldObj.getTileEntity(xCoord + 3, yCoord, zCoord - 1);
|
||||
}
|
||||
if(meta == 3) {
|
||||
te = worldObj.getTileEntity(xCoord - 3, yCoord, zCoord + 1);
|
||||
}
|
||||
if(meta == 4) {
|
||||
te = worldObj.getTileEntity(xCoord - 1, yCoord, zCoord - 3);
|
||||
}
|
||||
if(meta == 5) {
|
||||
te = worldObj.getTileEntity(xCoord + 1, yCoord, zCoord + 3);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityChest) {
|
||||
TileEntityChest chest = (TileEntityChest)te;
|
||||
//INPUT
|
||||
if(te2 instanceof TileEntityChest) {
|
||||
TileEntityChest chest = (TileEntityChest)te2;
|
||||
|
||||
for(int i = 0; i < chest.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(chest, i))
|
||||
break;
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityHopper) {
|
||||
TileEntityHopper hopper = (TileEntityHopper)te;
|
||||
if(te2 instanceof TileEntityHopper) {
|
||||
TileEntityHopper hopper = (TileEntityHopper)te2;
|
||||
|
||||
for(int i = 0; i < hopper.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(hopper, i))
|
||||
break;
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateIron) {
|
||||
TileEntityCrateIron hopper = (TileEntityCrateIron)te;
|
||||
if(te2 instanceof TileEntityCrateIron) {
|
||||
TileEntityCrateIron hopper = (TileEntityCrateIron)te2;
|
||||
|
||||
for(int i = 0; i < hopper.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(hopper, i))
|
||||
break;
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateSteel) {
|
||||
TileEntityCrateSteel hopper = (TileEntityCrateSteel)te;
|
||||
if(te2 instanceof TileEntityCrateSteel) {
|
||||
TileEntityCrateSteel hopper = (TileEntityCrateSteel)te2;
|
||||
|
||||
for(int i = 0; i < hopper.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(hopper, i))
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEAssemblerPacket(xCoord, yCoord, zCoord, isProgressing), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new LoopedSoundPacket(xCoord, yCoord, zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
@ -379,6 +377,70 @@ public class TileEntityMachineAssembler extends TileEntity implements ISidedInve
|
||||
|
||||
}
|
||||
|
||||
public boolean tryExchangeTemplates(TileEntity te1, TileEntity te2) {
|
||||
//validateTe sees if it's a valid inventory tile entity
|
||||
boolean te1Valid = validateTe(te1);
|
||||
boolean te2Valid = validateTe(te2);
|
||||
|
||||
if(te1Valid && te2Valid){
|
||||
IInventory iTe1 = (IInventory)te1;
|
||||
IInventory iTe2 = (IInventory)te2;
|
||||
boolean openSlot = false;
|
||||
boolean existingTemplate = false;
|
||||
boolean filledContainer = false;
|
||||
//Check if there's an existing template and an open slot
|
||||
for(int i = 0; i < iTe1.getSizeInventory(); i++){
|
||||
if(iTe1.getStackInSlot(i) == null){
|
||||
openSlot = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if(this.slots[4] != null){
|
||||
existingTemplate = true;
|
||||
}
|
||||
//Check if there's a template in input
|
||||
for(int i = 0; i < iTe2.getSizeInventory(); i++){
|
||||
if(iTe2.getStackInSlot(i) != null && iTe2.getStackInSlot(i).getItem() instanceof ItemAssemblyTemplate){
|
||||
if(openSlot && existingTemplate){
|
||||
filledContainer = tryFillContainer(iTe1, 4);
|
||||
|
||||
}
|
||||
if(filledContainer){
|
||||
ItemStack copy = iTe2.getStackInSlot(i).copy();
|
||||
iTe2.setInventorySlotContents(i, null);
|
||||
this.slots[4] = copy;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
private boolean validateTe(TileEntity te) {
|
||||
if(te instanceof TileEntityChest) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityHopper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityCrateIron) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityCrateSteel) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//I can't believe that worked.
|
||||
public ItemStack[] cloneItemStackProper(ItemStack[] array) {
|
||||
ItemStack[] stack = new ItemStack[array.length];
|
||||
@ -467,7 +529,7 @@ public class TileEntityMachineAssembler extends TileEntity implements ISidedInve
|
||||
boolean flag = false;
|
||||
|
||||
for(int i = 0; i < list.size(); i++)
|
||||
if(ItemStack.areItemStacksEqual(stack, list.get(i)) && ItemStack.areItemStackTagsEqual(stack, list.get(i)))
|
||||
if(isItemAcceptible(stack, list.get(i)))
|
||||
flag = true;
|
||||
|
||||
if(!flag)
|
||||
@ -485,7 +547,7 @@ public class TileEntityMachineAssembler extends TileEntity implements ISidedInve
|
||||
sta1.stackSize = 1;
|
||||
sta2.stackSize = 1;
|
||||
|
||||
if(ItemStack.areItemStacksEqual(sta1, sta2) && ItemStack.areItemStackTagsEqual(sta1, sta2) && slots[i].stackSize < slots[i].getMaxStackSize()) {
|
||||
if(isItemAcceptible(sta1, sta2) && slots[i].stackSize < slots[i].getMaxStackSize()) {
|
||||
ItemStack sta3 = inventory.getStackInSlot(slot).copy();
|
||||
sta3.stackSize--;
|
||||
if(sta3.stackSize <= 0)
|
||||
|
||||
@ -280,9 +280,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
if(consumption < 10)
|
||||
consumption = 10;
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
int meta = worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
isProgressing = false;
|
||||
|
||||
@ -340,88 +338,82 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
} else
|
||||
progress = 0;
|
||||
|
||||
TileEntity te = null;
|
||||
int meta = worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
TileEntity te1 = null;
|
||||
TileEntity te2 = null;
|
||||
|
||||
|
||||
if(meta == 2) {
|
||||
te = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord);
|
||||
te1 = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord);
|
||||
te2 = worldObj.getTileEntity(xCoord + 3, yCoord, zCoord - 1);
|
||||
}
|
||||
if(meta == 3) {
|
||||
te = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord);
|
||||
te1 = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord);
|
||||
te2 = worldObj.getTileEntity(xCoord - 3, yCoord, zCoord + 1);
|
||||
}
|
||||
if(meta == 4) {
|
||||
te = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2);
|
||||
te1 = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2);
|
||||
te2 = worldObj.getTileEntity(xCoord - 1, yCoord, zCoord - 3);
|
||||
}
|
||||
if(meta == 5) {
|
||||
te = worldObj.getTileEntity(xCoord, yCoord, zCoord - 2);
|
||||
te1 = worldObj.getTileEntity(xCoord, yCoord, zCoord - 2);
|
||||
te2 = worldObj.getTileEntity(xCoord + 1, yCoord, zCoord + 3);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityChest) {
|
||||
TileEntityChest chest = (TileEntityChest)te;
|
||||
tryExchangeTemplates(te1, te2);
|
||||
|
||||
//OUTPUT
|
||||
if(te1 instanceof TileEntityChest) {
|
||||
TileEntityChest chest = (TileEntityChest)te1;
|
||||
|
||||
for(int i = 5; i < 9; i++)
|
||||
tryFillContainer(chest, i);
|
||||
tryFillContainer(chest, 5);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityHopper) {
|
||||
TileEntityHopper hopper = (TileEntityHopper)te;
|
||||
if(te1 instanceof TileEntityHopper) {
|
||||
TileEntityHopper hopper = (TileEntityHopper)te1;
|
||||
|
||||
for(int i = 5; i < 9; i++)
|
||||
tryFillContainer(hopper, i);
|
||||
tryFillContainer(hopper, 5);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateIron) {
|
||||
TileEntityCrateIron hopper = (TileEntityCrateIron)te;
|
||||
if(te1 instanceof TileEntityCrateIron) {
|
||||
TileEntityCrateIron hopper = (TileEntityCrateIron)te1;
|
||||
|
||||
for(int i = 5; i < 9; i++)
|
||||
tryFillContainer(hopper, i);
|
||||
tryFillContainer(hopper, 5);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateSteel) {
|
||||
TileEntityCrateSteel hopper = (TileEntityCrateSteel)te;
|
||||
if(te1 instanceof TileEntityCrateSteel) {
|
||||
TileEntityCrateSteel hopper = (TileEntityCrateSteel)te1;
|
||||
|
||||
for(int i = 5; i < 9; i++)
|
||||
tryFillContainer(hopper, i);
|
||||
tryFillContainer(hopper, 5);
|
||||
}
|
||||
|
||||
te = null;
|
||||
if(meta == 2) {
|
||||
te = worldObj.getTileEntity(xCoord + 3, yCoord, zCoord - 1);
|
||||
}
|
||||
if(meta == 3) {
|
||||
te = worldObj.getTileEntity(xCoord - 3, yCoord, zCoord + 1);
|
||||
}
|
||||
if(meta == 4) {
|
||||
te = worldObj.getTileEntity(xCoord - 1, yCoord, zCoord - 3);
|
||||
}
|
||||
if(meta == 5) {
|
||||
te = worldObj.getTileEntity(xCoord + 1, yCoord, zCoord + 3);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityChest) {
|
||||
TileEntityChest chest = (TileEntityChest)te;
|
||||
//INPUT
|
||||
if(te2 instanceof TileEntityChest) {
|
||||
TileEntityChest chest = (TileEntityChest)te2;
|
||||
|
||||
for(int i = 0; i < chest.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(chest, i))
|
||||
break;
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityHopper) {
|
||||
TileEntityHopper hopper = (TileEntityHopper)te;
|
||||
if(te2 instanceof TileEntityHopper) {
|
||||
TileEntityHopper hopper = (TileEntityHopper)te2;
|
||||
|
||||
for(int i = 0; i < hopper.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(hopper, i))
|
||||
break;
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateIron) {
|
||||
TileEntityCrateIron chest = (TileEntityCrateIron)te;
|
||||
|
||||
for(int i = 0; i < chest.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(chest, i))
|
||||
if(te2 instanceof TileEntityCrateIron) {
|
||||
TileEntityCrateIron hopper = (TileEntityCrateIron)te2;
|
||||
|
||||
for(int i = 0; i < hopper.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(hopper, i))
|
||||
break;
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateSteel) {
|
||||
TileEntityCrateSteel hopper = (TileEntityCrateSteel)te;
|
||||
if(te2 instanceof TileEntityCrateSteel) {
|
||||
TileEntityCrateSteel hopper = (TileEntityCrateSteel)te2;
|
||||
|
||||
for(int i = 0; i < hopper.getSizeInventory(); i++)
|
||||
if(tryFillAssembler(hopper, i))
|
||||
@ -453,6 +445,70 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean tryExchangeTemplates(TileEntity te1, TileEntity te2) {
|
||||
//validateTe sees if it's a valid inventory tile entity
|
||||
boolean te1Valid = validateTe(te1);
|
||||
boolean te2Valid = validateTe(te2);
|
||||
|
||||
if(te1Valid && te2Valid){
|
||||
IInventory iTe1 = (IInventory)te1;
|
||||
IInventory iTe2 = (IInventory)te2;
|
||||
boolean openSlot = false;
|
||||
boolean existingTemplate = false;
|
||||
boolean filledContainer = false;
|
||||
//Check if there's an existing template and an open slot
|
||||
for(int i = 0; i < iTe1.getSizeInventory(); i++){
|
||||
if(iTe1.getStackInSlot(i) == null){
|
||||
openSlot = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if(this.slots[4] != null){
|
||||
existingTemplate = true;
|
||||
}
|
||||
//Check if there's a template in input
|
||||
for(int i = 0; i < iTe2.getSizeInventory(); i++){
|
||||
if(iTe2.getStackInSlot(i) != null && iTe2.getStackInSlot(i).getItem() instanceof ItemChemistryTemplate){
|
||||
if(openSlot && existingTemplate){
|
||||
filledContainer = tryFillContainer(iTe1, 4);
|
||||
|
||||
}
|
||||
if(filledContainer){
|
||||
ItemStack copy = iTe2.getStackInSlot(i).copy();
|
||||
iTe2.setInventorySlotContents(i, null);
|
||||
this.slots[4] = copy;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
private boolean validateTe(TileEntity te) {
|
||||
if(te != null && te instanceof TileEntityChest) {
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityHopper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateIron) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(te != null && te instanceof TileEntityCrateSteel) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void setContainers() {
|
||||
|
||||
@ -531,10 +587,10 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
if(sta7 != null)
|
||||
sta7.stackSize = 1;
|
||||
|
||||
if((slots[5] == null || stacks[0] == null || (stacks[0] != null && ItemStack.areItemStacksEqual(sta0, sta1) && ItemStack.areItemStackTagsEqual(sta0, sta1) && slots[5].stackSize + stacks[0].stackSize <= slots[5].getMaxStackSize())) &&
|
||||
(slots[6] == null || stacks[1] == null || (stacks[1] != null && ItemStack.areItemStacksEqual(sta2, sta3) && ItemStack.areItemStackTagsEqual(sta2, sta3) && slots[6].stackSize + stacks[1].stackSize <= slots[6].getMaxStackSize())) &&
|
||||
(slots[7] == null || stacks[2] == null || (stacks[2] != null && ItemStack.areItemStacksEqual(sta4, sta5) && ItemStack.areItemStackTagsEqual(sta4, sta5) && slots[7].stackSize + stacks[2].stackSize <= slots[7].getMaxStackSize())) &&
|
||||
(slots[8] == null || stacks[3] == null || (stacks[3] != null && ItemStack.areItemStacksEqual(sta6, sta7) && ItemStack.areItemStackTagsEqual(sta6, sta7) && slots[8].stackSize + stacks[3].stackSize <= slots[8].getMaxStackSize())))
|
||||
if((slots[5] == null || stacks[0] == null || (stacks[0] != null && isItemAcceptible(sta0, sta1) && slots[5].stackSize + stacks[0].stackSize <= slots[5].getMaxStackSize())) &&
|
||||
(slots[6] == null || stacks[1] == null || (stacks[1] != null && isItemAcceptible(sta2, sta3) && slots[6].stackSize + stacks[1].stackSize <= slots[6].getMaxStackSize())) &&
|
||||
(slots[7] == null || stacks[2] == null || (stacks[2] != null && isItemAcceptible(sta4, sta5) && slots[7].stackSize + stacks[2].stackSize <= slots[7].getMaxStackSize())) &&
|
||||
(slots[8] == null || stacks[3] == null || (stacks[3] != null && isItemAcceptible(sta6, sta7) && slots[8].stackSize + stacks[3].stackSize <= slots[8].getMaxStackSize())))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@ -681,7 +737,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
sta1.stackSize = 1;
|
||||
sta2.stackSize = 1;
|
||||
|
||||
if(ItemStack.areItemStacksEqual(sta1, sta2) && ItemStack.areItemStackTagsEqual(sta1, sta2) && slots[i].stackSize < slots[i].getMaxStackSize()) {
|
||||
if(isItemAcceptible(sta1, sta2) && slots[i].stackSize < slots[i].getMaxStackSize()) {
|
||||
ItemStack sta3 = inventory.getStackInSlot(slot).copy();
|
||||
sta3.stackSize--;
|
||||
if(sta3.stackSize <= 0)
|
||||
|
||||