use of micdoodle8.mods.galacticraft.planets.asteroids.items.ItemCanisterLiquidOxygen in project Galacticraft by micdoodle8.
the class AsteroidsItems method initItems.
public static void initItems() {
AsteroidsItems.grapple = new ItemGrappleHook("grapple");
AsteroidsItems.tier3Rocket = new ItemTier3Rocket("rocket_t3");
AsteroidsItems.astroMiner = new ItemAstroMiner("astro_miner");
AsteroidsItems.thermalPadding = new ItemThermalPadding("thermal_padding");
AsteroidsItems.basicItem = new ItemBasicAsteroids("item_basic_asteroids");
AsteroidsItems.methaneCanister = new ItemCanisterMethane("methane_canister_partial");
AsteroidsItems.canisterLOX = new ItemCanisterLiquidOxygen("canister_partial_lox");
AsteroidsItems.canisterLN2 = new ItemCanisterLiquidNitrogen("canister_partial_ln2");
// AsteroidsItems.canisterLAr = new ItemCanisterLiquidArgon("canisterPartialLAr");
AsteroidsItems.atmosphericValve = new ItemAtmosphericValve("atmospheric_valve");
AsteroidsItems.heavyNoseCone = new ItemHeavyNoseCone("heavy_nose_cone");
AsteroidsItems.orionDrive = new ItemOrionDrive("orion_drive");
AsteroidsItems.titaniumHelmet = new ItemArmorAsteroids(0, "helmet");
AsteroidsItems.titaniumChestplate = new ItemArmorAsteroids(1, "chestplate");
AsteroidsItems.titaniumLeggings = new ItemArmorAsteroids(2, "leggings");
AsteroidsItems.titaniumBoots = new ItemArmorAsteroids(3, "boots");
AsteroidsItems.titaniumAxe = new ItemAxeAsteroids("titanium_axe");
AsteroidsItems.titaniumPickaxe = new ItemPickaxeAsteroids("titanium_pickaxe");
AsteroidsItems.titaniumSpade = new ItemSpadeAsteroids("titanium_shovel");
AsteroidsItems.titaniumHoe = new ItemHoeAsteroids("titanium_hoe");
AsteroidsItems.titaniumSword = new ItemSwordAsteroids("titanium_sword");
AsteroidsItems.strangeSeed = new ItemStrangeSeed("strange_seed");
AsteroidsItems.registerItems();
OreDictionary.registerOre("compressedTitanium", new ItemStack(AsteroidsItems.basicItem, 1, 6));
OreDictionary.registerOre("ingotTitanium", new ItemStack(AsteroidsItems.basicItem, 1, 0));
OreDictionary.registerOre("shardTitanium", new ItemStack(AsteroidsItems.basicItem, 1, 4));
OreDictionary.registerOre("shardIron", new ItemStack(AsteroidsItems.basicItem, 1, 3));
OreDictionary.registerOre("dustTitanium", new ItemStack(AsteroidsItems.basicItem, 1, 9));
AsteroidsItems.registerHarvestLevels();
GalacticraftCore.proxy.registerCanister(new PartialCanister(AsteroidsItems.methaneCanister, Constants.MOD_ID_PLANETS, "methane_canister_partial", 7));
GalacticraftCore.proxy.registerCanister(new PartialCanister(AsteroidsItems.canisterLOX, Constants.MOD_ID_PLANETS, "canister_partial_lox", 7));
GalacticraftCore.proxy.registerCanister(new PartialCanister(AsteroidsItems.canisterLN2, Constants.MOD_ID_PLANETS, "canister_partial_ln2", 7));
}
use of micdoodle8.mods.galacticraft.planets.asteroids.items.ItemCanisterLiquidOxygen in project Galacticraft by micdoodle8.
the class CanisterRecipes method getCraftingResult.
/**
* Returns an Item that is the result of this recipe
*/
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
ItemStack itemTank = null;
ItemStack itemCanister = null;
for (int i = 0; i < inv.getSizeInventory(); ++i) {
ItemStack itemstack1 = inv.getStackInSlot(i);
if (itemstack1 != null) {
Item testItem = itemstack1.getItem();
if (testItem instanceof ItemCanisterLiquidOxygen || testItem == GCItems.oxygenCanisterInfinite) {
if (itemCanister != null) {
// Two canisters
return null;
}
itemCanister = itemstack1;
} else {
if (!(testItem instanceof ItemOxygenTank) || itemTank != null) {
// Something other than an oxygen tank
return null;
}
itemTank = itemstack1;
}
}
}
// Need one canister + one tank
if (itemCanister == null || itemTank == null) {
return null;
}
// Empty canister
if (itemCanister.getItemDamage() >= itemCanister.getMaxDamage()) {
return null;
}
// Full tank
if (itemTank.getItemDamage() <= 0) {
return null;
}
int oxygenAvail = itemCanister.getMaxDamage() - itemCanister.getItemDamage();
int oxygenToFill = itemTank.getItemDamage() * 5 / 54;
if (oxygenAvail >= oxygenToFill) {
ItemStack result = itemTank.copy();
result.setItemDamage(0);
if (itemCanister.getItem() instanceof ItemCanisterLiquidOxygen) {
ItemCanisterLiquidOxygen.saveDamage(itemCanister, itemCanister.getItemDamage() + oxygenToFill);
}
return result;
}
int tankDamageNew = (oxygenToFill - oxygenAvail) * 54 / 5;
ItemStack result = itemTank.copy();
result.setItemDamage(tankDamageNew);
if (itemCanister.getItem() instanceof ItemCanisterLiquidOxygen) {
ItemCanisterLiquidOxygen.saveDamage(itemCanister, itemCanister.getMaxDamage());
}
return result;
}
use of micdoodle8.mods.galacticraft.planets.asteroids.items.ItemCanisterLiquidOxygen in project Galacticraft by micdoodle8.
the class CanisterRecipes method matches.
/**
* Used to check if a recipe matches current crafting inventory
*/
@Override
public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) {
ItemStack itemCanister = null;
ItemStack itemTank = null;
for (int i = 0; i < p_77569_1_.getSizeInventory(); ++i) {
ItemStack itemstack1 = p_77569_1_.getStackInSlot(i);
if (itemstack1 != null) {
Item testItem = itemstack1.getItem();
if (testItem instanceof ItemCanisterLiquidOxygen || testItem == GCItems.oxygenCanisterInfinite) {
if (itemCanister != null) {
// Two canisters
return false;
}
itemCanister = itemstack1;
} else {
if (!(testItem instanceof ItemOxygenTank) || itemTank != null) {
// Something other than an oxygen tank
return false;
}
itemTank = itemstack1;
}
}
}
// Need one canister + one tank
if (itemCanister == null || itemTank == null) {
return false;
}
// Empty canister
if (itemCanister.getItemDamage() >= itemCanister.getMaxDamage()) {
return false;
}
// Full tank
if (itemTank.getItemDamage() <= 0) {
return false;
}
return true;
}
Aggregations