schraranium, laser miner recipe, battery API
@ -1,5 +1,5 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
public interface IEnergyConsumer {
|
||||
|
||||
/// WIP ///
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
public interface IEnergySource {
|
||||
|
||||
/// WIP ///
|
||||
}
|
||||
|
||||
@ -378,6 +378,7 @@ tile.struct_launcher.name=Startrampe-Komponentenblock
|
||||
tile.struct_scaffold.name=Startrampe-Gerüstblock
|
||||
tile.struct_launcher_core.name=Kompaktrampe-Kernkomponente
|
||||
tile.struct_launcher_core_large.name=Startrampe-Kernkomponente
|
||||
tile.struct_soyuz_launcher.name=Soyuz-Startrampe-Kernkomponente
|
||||
|
||||
tile.machine_difurnace_off.name=Hochofen
|
||||
tile.machine_difurnace_on.name=Hochofen
|
||||
@ -761,6 +762,7 @@ item.crystal_aluminium.name=Aluminiumkristalle
|
||||
item.crystal_fluorite.name=Fluoritkristalle
|
||||
item.crystal_beryllium.name=Berylliumkristalle
|
||||
item.crystal_lead.name=Bleikristalle
|
||||
item.crystal_schraranium.name=Schraraniumkristalle
|
||||
item.crystal_schrabidium.name=Schrabidiumkristalle
|
||||
item.crystal_rare.name=Seltenerdenkristalle
|
||||
item.crystal_phosphorus.name=Phosphorkristalle
|
||||
@ -2181,6 +2183,7 @@ item.cobalt_axe.name=Kobaltaxt
|
||||
item.cobalt_shovel.name=Kobaltschaufel
|
||||
item.cobalt_hoe.name=Kobaltfeldhacke
|
||||
item.centri_stick.name=Zentrifuge am Spieß
|
||||
item.smashing_hammer.name=Zerschmetterungshammer
|
||||
|
||||
tile.red_cable.name=Rotes Kupferkabel
|
||||
|
||||
|
||||
@ -378,6 +378,7 @@ tile.struct_launcher.name=Launch Pad Component Block
|
||||
tile.struct_scaffold.name=Launch Pad Scaffold Block
|
||||
tile.struct_launcher_core.name=Compact Launcher Core Component
|
||||
tile.struct_launcher_core_large.name=Launch Table Core Component
|
||||
tile.struct_soyuz_launcher.name=Soyuz Launcher Core Component
|
||||
|
||||
tile.machine_difurnace_off.name=Blast Furnace
|
||||
tile.machine_difurnace_on.name=Blast Furnace
|
||||
@ -507,6 +508,9 @@ tile.soyuz_capsule.name=Cargo Landing Capsule
|
||||
container.soyuzCapsule=Cargo Landing Capsule
|
||||
tile.machine_crystallizer.name=Ore Acidizer
|
||||
container.crystallizer=Ore Acidizer
|
||||
tile.machine_mining_laser.name=Mining Laser
|
||||
container.miningLaser=Mining Laser
|
||||
tile.barricade.name=Sand Bags
|
||||
|
||||
tile.barrel_plastic.name=Safe Barrel™
|
||||
tile.barrel_corroded.name=Corroded Barrel
|
||||
@ -761,6 +765,7 @@ item.crystal_aluminium.name=Aluminium Crystals
|
||||
item.crystal_fluorite.name=Fluorite Crystals
|
||||
item.crystal_beryllium.name=Beryllium Crystals
|
||||
item.crystal_lead.name=Lead Crystals
|
||||
item.crystal_schraranium.name=Schraranium Crystals
|
||||
item.crystal_schrabidium.name=Schrabidium Crystals
|
||||
item.crystal_rare.name=Rare Earth Crystals
|
||||
item.crystal_phosphorus.name=Phosphorus Crystals
|
||||
@ -2184,6 +2189,7 @@ item.cobalt_axe.name=Cobalt Axe
|
||||
item.cobalt_shovel.name=Cobalt Shovel
|
||||
item.cobalt_hoe.name=Cobalt Hoe
|
||||
item.centri_stick.name=Centrifuge on a Stick
|
||||
item.smashing_hammer.name=Smashing Hammer
|
||||
|
||||
tile.red_cable.name=Red Copper Cable
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Эй, Док! Спасибо за работу! Добро пожаловать в “команду”))
|
||||
Эй, Док! Спасибо за работу! Добро пожаловать в “команду”))
|
||||
|
||||
itemGroup.tabTest=Тестовая вкладка NTM
|
||||
itemGroup.tabParts=Ресурсы и детали NTM
|
||||
@ -72,8 +72,8 @@ potion.hbm_phosphorus=Фосфорные ожоги
|
||||
|
||||
tool.ability.recursion=Жилковый Майнер
|
||||
tool.ability.hammer=AoE
|
||||
tool.ability.silktouch=Точечный Майнер
|
||||
tool.ability.fortune=Экстрактор руд
|
||||
tool.ability.silktouch=Шёлковое касание
|
||||
tool.ability.fortune=Удача
|
||||
tool.ability.smelter=Авто-плавка
|
||||
tool.ability.shredder=Авто-измельчитель
|
||||
tool.ability.centrifuge=Авто-центрифуга
|
||||
@ -119,9 +119,49 @@ hbmfluid.cryogel=Криогель
|
||||
hbmfluid.hydrogen=Жидкий водород
|
||||
hbmfluid.oxygen=Жидкий кислород
|
||||
hbmfluid.xenon=Ксенон
|
||||
hbmfluid.balefire=BF ракетное топливо
|
||||
hbmfluid.balefire=Ракетное жар-топливо
|
||||
hbmfluid.mercury=Ртуть
|
||||
|
||||
//Special for 1.12.2 version//
|
||||
fluid.hbmsteam=Пар
|
||||
fluid.hbmhotsteam=Горячий пар
|
||||
fluid.hbmsuperhotsteam=Раскалённый пар
|
||||
fluid.hbmuf6=Гексафторид урана
|
||||
fluid.hbmpuf6=Гексафторид плутония
|
||||
fluid.hbmdeuterium=Дейтерий
|
||||
fluid.hbmtritium=Тритий
|
||||
fluid.hbmoil=Неочищенная нефть
|
||||
fluid.hbmhotoil=Горячая неочищенная нефть
|
||||
fluid.hbmsmear=Промышленное масло
|
||||
fluid.hbmreclaimed=Очищенное промышленное масло
|
||||
fluid.hbmpetroil=Бензин
|
||||
fluid.hbmlubricant=Машинная смазка
|
||||
fluid.hbmdiesel=Дизель
|
||||
fluid.hbmkerosene=Керосин
|
||||
fluid.hbmgas=Природный газ
|
||||
fluid.hbmcoolant=Хладагент
|
||||
fluid.hbmamat=Антиматерия
|
||||
fluid.hbmaschrab=Антишрабидий
|
||||
fluid.hbmheavyoil=Тяжелая нефть
|
||||
fluid.hbmbitumen=Битум
|
||||
fluid.hbmheatingoil=Мазут
|
||||
fluid.hbmnaphtha=Лигроин
|
||||
fluid.hbmlightoil=Лёгкая нефть
|
||||
fluid.hbmpetroleum=Петролеум
|
||||
fluid.hbmacid=Пероксид водорода
|
||||
fluid.hbmwatz=Токсичные отходы
|
||||
fluid.hbmbiogas=Биогаз
|
||||
fluid.hbmbiofuel=Биотопливо
|
||||
fluid.hbmsas3=Трисульфид шрабидия
|
||||
fluid.hbmnitan=100-октановое сверхтопливо NITAN©
|
||||
fluid.hbmcryogel=Криогель
|
||||
fluid.hbmhydrogen=Жидкий водород
|
||||
fluid.hbmoxygen=Жидкий кислород
|
||||
fluid.hbmxenon=Ксенон
|
||||
fluid.hbmbalefire=Ракетное жар-топливо
|
||||
fluid.hbmmercury=Ртуть
|
||||
//Special for 1.12.2 version//
|
||||
|
||||
chem.TEST=Тест
|
||||
chem.FP_HEAVYOIL=Переработка тяжелой нефти
|
||||
chem.FP_SMEAR=Переработка Промышленной нефти
|
||||
@ -1040,7 +1080,7 @@ item.powder_actinium_tiny.name=Кучка актиниевой пыли
|
||||
item.powder_euphemium.name=Эвфемиевый порошок
|
||||
item.powder_meteorite.name=Метеоритный порошок
|
||||
item.powder_meteorite_tiny.name=Кучка метеоритной пыли
|
||||
item.powder_yellowcake.name=Йеллоукейк
|
||||
item.powder_yellowcake.name=Йеллоукейк
|
||||
item.powder_magic.name=Измельченное зачарование
|
||||
item.redstone_depleted.name=Обесцвеченная красная пыль
|
||||
|
||||
@ -2525,4 +2565,4 @@ tile.cheater_virus_seed.name=Нестабильный блок шрабидат
|
||||
|
||||
item.mysteryshovel.name=Непрочная лопата
|
||||
tile.ntm_dirt.name=Грязь
|
||||
item.memory.name=item.null.name
|
||||
item.memory.name=item.null.name
|
||||
@ -61,7 +61,8 @@
|
||||
"music.transmission": {"category": "record", "sounds": [{"name": "music/recordGlass", "stream": true}]},
|
||||
|
||||
"weapon.tauShoot": {"category": "player", "sounds": [{"name": "weapon/tauShoot", "stream": false}]},
|
||||
"weapon.tauChargeLoop2": {"category": "player", "sounds": [{"name": "weapon/tauChargeLoop2", "stream": true}]},
|
||||
"weapon.tauChargeLoop": {"category": "player", "sounds": [{"name": "weapon/tauChargeLoop", "stream": true}]},
|
||||
"weapon.tauChargeLoop2": {"category": "player", "sounds": [{"name": "weapon/tauChargeLoop2", "stream": true}]},
|
||||
"weapon.revolverShoot": {"category": "player", "sounds": [{"name": "weapon/revolverShoot", "stream": false}]},
|
||||
"weapon.revolverShootAlt": {"category": "player", "sounds": [{"name": "weapon/revolverShootAlt", "stream": false}]},
|
||||
"weapon.heavyShoot": {"category": "player", "sounds": [{"name": "weapon/heavyShoot", "stream": false}]},
|
||||
|
||||
BIN
src/main/java/assets/hbm/textures/blocks/block_polonium.png
Normal file
|
After Width: | Height: | Size: 600 B |
|
After Width: | Height: | Size: 282 B |
BIN
src/main/java/assets/hbm/textures/blocks/soyuz_launcher.png
Normal file
|
After Width: | Height: | Size: 271 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
src/main/java/assets/hbm/textures/items/crystal_schraranium.png
Normal file
|
After Width: | Height: | Size: 552 B |
BIN
src/main/java/assets/hbm/textures/items/ingot_polonium.png
Normal file
|
After Width: | Height: | Size: 410 B |
BIN
src/main/java/assets/hbm/textures/items/nugget_polonium.png
Normal file
|
After Width: | Height: | Size: 287 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 306 B |
BIN
src/main/java/assets/hbm/textures/items/powder_polonium.png
Normal file
|
After Width: | Height: | Size: 398 B |
BIN
src/main/java/assets/hbm/textures/items/smashing_hammer.png
Normal file
|
After Width: | Height: | Size: 357 B |
@ -152,7 +152,6 @@ public abstract class BlockDummyable extends BlockContainer {
|
||||
}
|
||||
|
||||
if(!checkRequirement(world, x, y, z, dir, o)) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
if(!pl.capabilities.isCreativeMode) {
|
||||
ItemStack stack = pl.inventory.mainInventory[pl.inventory.currentItem];
|
||||
|
||||
@ -1797,7 +1797,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_flare, machine_flare.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_refinery, machine_refinery.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_drill, machine_drill.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_mining_laser, machine_mining_laser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_mining_laser, ItemBlockLore.class, machine_mining_laser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(barricade, barricade.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_turbofan, machine_turbofan.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
|
||||
|
||||
@ -7,7 +7,6 @@ import java.util.Random;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.effect.EntityCloudTom;
|
||||
import com.hbm.explosion.ExplosionNT;
|
||||
import com.hbm.explosion.ExplosionNT.ExAttrib;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
@ -1,10 +1,17 @@
|
||||
package com.hbm.creativetabs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ControlTab extends CreativeTabs {
|
||||
|
||||
@ -22,5 +29,44 @@ public class ControlTab extends CreativeTabs {
|
||||
|
||||
return Items.iron_pickaxe;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayAllReleventItems(List list) {
|
||||
super.displayAllReleventItems(list);
|
||||
|
||||
List<ItemStack> batteries = new ArrayList();
|
||||
|
||||
for(Object o : list) {
|
||||
|
||||
if(o instanceof ItemStack) {
|
||||
|
||||
ItemStack stack = (ItemStack) o;
|
||||
|
||||
if(stack.getItem() instanceof IBatteryItem) {
|
||||
batteries.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(ItemStack stack : batteries) {
|
||||
|
||||
if(!(stack.getItem() instanceof IBatteryItem)) //shouldn't happen but just to make sure
|
||||
continue;
|
||||
|
||||
IBatteryItem battery = (IBatteryItem) stack.getItem();
|
||||
|
||||
ItemStack empty = stack.copy();
|
||||
ItemStack full = stack.copy();
|
||||
|
||||
battery.setCharge(empty, 0);
|
||||
battery.setCharge(full, battery.getMaxCharge());
|
||||
|
||||
int index = list.indexOf(stack);
|
||||
|
||||
list.remove(index);
|
||||
list.add(index, full);
|
||||
list.add(index, empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.creativetabs;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
@ -21,5 +22,4 @@ public class MachineTab extends CreativeTabs {
|
||||
|
||||
return Items.iron_pickaxe;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.explosion;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
@ -11,6 +11,10 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -77,6 +81,13 @@ public class Gun556mmFactory {
|
||||
config.firingSound = "hbm:weapon.hksShoot";
|
||||
config.reloadSoundEnd = false;
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0.5, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
)
|
||||
);
|
||||
|
||||
config.name = "H&R SPIW";
|
||||
config.manufacturer = "Harrington & Richardson";
|
||||
|
||||
|
||||
@ -200,6 +200,8 @@ public class CentrifugeRecipes {
|
||||
|
||||
recipes.put(new ComparableStack(Items.blaze_rod), new ItemStack[] {new ItemStack(Items.blaze_powder, 1), new ItemStack(Items.blaze_powder, 1), new ItemStack(ModItems.powder_fire, 1), new ItemStack(ModItems.powder_fire, 1) });
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.ingot_schraranium), new ItemStack[] { new ItemStack(ModItems.nugget_schrabidium, 2), new ItemStack(ModItems.nugget_schrabidium, 1), new ItemStack(ModItems.nugget_uranium, 3), new ItemStack(ModItems.nugget_plutonium, 2) });
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_iron), new ItemStack[] { new ItemStack(ModItems.powder_iron, 2), new ItemStack(ModItems.powder_iron, 2), new ItemStack(ModItems.powder_titanium, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_gold), new ItemStack[] { new ItemStack(ModItems.powder_gold, 2), new ItemStack(ModItems.powder_gold, 2), new ItemStack(ModItems.nugget_mercury, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_redstone), new ItemStack[] { new ItemStack(Items.redstone, 3), new ItemStack(Items.redstone, 3), new ItemStack(Items.redstone, 3), new ItemStack(ModItems.nugget_mercury, 3) });
|
||||
@ -216,6 +218,7 @@ public class CentrifugeRecipes {
|
||||
recipes.put(new ComparableStack(ModItems.crystal_fluorite), new ItemStack[] { new ItemStack(ModItems.fluorite, 3), new ItemStack(ModItems.fluorite, 3), new ItemStack(ModItems.fluorite, 3), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_beryllium), new ItemStack[] { new ItemStack(ModItems.powder_beryllium, 2), new ItemStack(ModItems.powder_beryllium, 2), new ItemStack(ModItems.powder_quartz, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_lead), new ItemStack[] { new ItemStack(ModItems.powder_lead, 2), new ItemStack(ModItems.powder_lead, 2), new ItemStack(ModItems.powder_gold, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_schraranium), new ItemStack[] { new ItemStack(ModItems.nugget_schrabidium, 2), new ItemStack(ModItems.nugget_schrabidium, 2), new ItemStack(ModItems.nugget_uranium, 2), new ItemStack(ModItems.nugget_plutonium, 2) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_schrabidium), new ItemStack[] { new ItemStack(ModItems.powder_schrabidium, 2), new ItemStack(ModItems.powder_schrabidium, 2), new ItemStack(ModItems.powder_plutonium, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_rare), new ItemStack[] { new ItemStack(ModItems.powder_desh_mix, 1), new ItemStack(ModItems.powder_desh_mix, 1), new ItemStack(ModItems.powder_lanthanium_tiny, 3), new ItemStack(ModItems.powder_actinium_tiny, 3) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_phosphorus), new ItemStack[] { new ItemStack(ModItems.powder_fire, 3), new ItemStack(ModItems.powder_fire, 3), new ItemStack(ModItems.ingot_phosphorus, 2), new ItemStack(Items.blaze_powder, 2) });
|
||||
|
||||
@ -54,6 +54,7 @@ public class CrystallizerRecipes {
|
||||
recipes.put(new ComparableStack(ModItems.powder_diamond), new ItemStack(Items.diamond));
|
||||
recipes.put(new ComparableStack(ModItems.powder_emerald), new ItemStack(Items.emerald));
|
||||
recipes.put(new ComparableStack(ModItems.powder_lapis), new ItemStack(Items.dye, 1, 4));
|
||||
recipes.put(new ComparableStack(ModItems.ingot_schraranium), new ItemStack(ModItems.crystal_schraranium));
|
||||
}
|
||||
|
||||
public static ItemStack getOutput(ItemStack stack) {
|
||||
|
||||
@ -2733,6 +2733,18 @@ public class MachineRecipes {
|
||||
list.add(new ItemStack(ModItems.bolt_dura_steel, 2));
|
||||
list.add(new ItemStack(ModItems.drill_titanium, 1));
|
||||
break;
|
||||
case MININGLASER:
|
||||
list.add(new ItemStack(ModItems.tank_steel, 3));
|
||||
list.add(new ItemStack(ModItems.ingot_steel, 8));
|
||||
list.add(new ItemStack(ModItems.plate_steel, 12));
|
||||
list.add(new ItemStack(ModItems.crystal_redstone, 3));
|
||||
list.add(new ItemStack(Items.diamond, 5));
|
||||
list.add(new ItemStack(ModItems.ingot_polymer, 8));
|
||||
list.add(new ItemStack(ModItems.motor, 3));
|
||||
list.add(new ItemStack(ModItems.ingot_dura_steel, 4));
|
||||
list.add(new ItemStack(ModItems.bolt_dura_steel, 6));
|
||||
list.add(new ItemStack(ModBlocks.machine_lithium_battery, 3));
|
||||
break;
|
||||
case TURBOFAN:
|
||||
list.add(new ItemStack(ModItems.hull_big_steel, 1));
|
||||
list.add(new ItemStack(ModItems.hull_big_titanium, 3));
|
||||
@ -4006,6 +4018,9 @@ public class MachineRecipes {
|
||||
case MINER:
|
||||
output = new ItemStack(ModBlocks.machine_drill, 1);
|
||||
break;
|
||||
case MININGLASER:
|
||||
output = new ItemStack(ModBlocks.machine_mining_laser, 1);
|
||||
break;
|
||||
case TURBOFAN:
|
||||
output = new ItemStack(ModBlocks.machine_turbofan, 1);
|
||||
break;
|
||||
|
||||
@ -146,6 +146,7 @@ public class ShredderRecipes {
|
||||
ShredderRecipes.setRecipe(ModBlocks.ore_rare, new ItemStack(ModItems.powder_desh_mix, 1));
|
||||
ShredderRecipes.setRecipe(Blocks.diamond_ore, new ItemStack(ModBlocks.gravel_diamond, 2));
|
||||
|
||||
ShredderRecipes.setRecipe(ModItems.ingot_schraranium, new ItemStack(ModItems.nugget_schrabidium, 2));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_iron, new ItemStack(ModItems.powder_iron, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_gold, new ItemStack(ModItems.powder_gold, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_redstone, new ItemStack(Items.redstone, 8));
|
||||
@ -162,6 +163,7 @@ public class ShredderRecipes {
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_fluorite, new ItemStack(ModItems.fluorite, 8));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_beryllium, new ItemStack(ModItems.powder_beryllium, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_lead, new ItemStack(ModItems.powder_lead, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_schraranium, new ItemStack(ModItems.nugget_schrabidium, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_schrabidium, new ItemStack(ModItems.powder_schrabidium, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_rare, new ItemStack(ModItems.powder_desh_mix, 2));
|
||||
ShredderRecipes.setRecipe(ModItems.crystal_phosphorus, new ItemStack(ModItems.powder_fire, 8));
|
||||
|
||||
@ -6,17 +6,12 @@ import com.hbm.tileentity.machine.TileEntityMachineSchrabidiumTransmutator;
|
||||
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 ContainerMachineSchrabidiumTransmutator extends Container {
|
||||
|
||||
private TileEntityMachineSchrabidiumTransmutator nukeBoy;
|
||||
|
||||
private int water;
|
||||
private int sulfur;
|
||||
private int progress;
|
||||
|
||||
public ContainerMachineSchrabidiumTransmutator(InventoryPlayer invPlayer, TileEntityMachineSchrabidiumTransmutator tedf) {
|
||||
|
||||
@ -83,23 +78,6 @@ private TileEntityMachineSchrabidiumTransmutator nukeBoy;
|
||||
return nukeBoy.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.progress != this.nukeBoy.process)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 0, this.nukeBoy.process);
|
||||
}
|
||||
}
|
||||
|
||||
this.progress = this.nukeBoy.process;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 1)
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerMiningLaser;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
@ -44,6 +45,8 @@ public class GUIMiningLaser extends GuiInfoContainer {
|
||||
" -Crystallizer (exclusive)",
|
||||
" -Nullifier"};
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 87, guiTop + 31, 8, 8, guiLeft + 141, guiTop + 39 + 16, text);
|
||||
|
||||
laser.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 35, guiTop + 124 - 52, 7, 52);
|
||||
}
|
||||
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
@ -83,5 +86,8 @@ public class GUIMiningLaser extends GuiInfoContainer {
|
||||
drawTexturedModalRect(guiLeft + 66, guiTop + 36, 192, 0, 8, j);
|
||||
|
||||
this.drawInfoPanel(guiLeft + 87, guiTop + 31, 8, 8, 8);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(laser.tank.getSheet());
|
||||
laser.tank.renderTank(this, guiLeft + 35, guiTop + 124, laser.tank.getTankType().textureX() * FluidTank.x, laser.tank.getTankType().textureY() * FluidTank.y, 7, 52);
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,6 +245,7 @@ public class ModItems {
|
||||
public static Item crystal_fluorite;
|
||||
public static Item crystal_beryllium;
|
||||
public static Item crystal_lead;
|
||||
public static Item crystal_schraranium;
|
||||
public static Item crystal_schrabidium;
|
||||
public static Item crystal_rare;
|
||||
public static Item crystal_phosphorus;
|
||||
@ -1614,6 +1615,7 @@ public class ModItems {
|
||||
public static Item cobalt_axe;
|
||||
public static Item cobalt_shovel;
|
||||
public static Item cobalt_hoe;
|
||||
public static Item smashing_hammer;
|
||||
public static Item centri_stick;
|
||||
|
||||
public static Item matchstick;
|
||||
@ -2106,6 +2108,7 @@ public class ModItems {
|
||||
crystal_fluorite = new Item().setUnlocalizedName("crystal_fluorite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_fluorite");
|
||||
crystal_beryllium = new Item().setUnlocalizedName("crystal_beryllium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_beryllium");
|
||||
crystal_lead = new Item().setUnlocalizedName("crystal_lead").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_lead");
|
||||
crystal_schraranium = new ItemRadioactive(5F, false, true).setUnlocalizedName("crystal_schraranium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_schraranium");
|
||||
crystal_schrabidium = new ItemRadioactive(10F, false, true).setUnlocalizedName("crystal_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_schrabidium");
|
||||
crystal_rare = new Item().setUnlocalizedName("crystal_rare").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_rare");
|
||||
crystal_phosphorus = new ItemRadioactive(0.0F, true).setUnlocalizedName("crystal_phosphorus").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_phosphorus");
|
||||
@ -3658,6 +3661,8 @@ public class ModItems {
|
||||
|
||||
centri_stick = new ItemToolAbility(3F, 0, MainRegistry.tMatElec, EnumToolType.MINER)
|
||||
.addBreakAbility(new ToolAbility.CentrifugeAbility()).setMaxDamage(50).setUnlocalizedName("centri_stick").setTextureName(RefStrings.MODID + ":centri_stick");
|
||||
smashing_hammer = new ItemToolAbility(12F, -0.1, MainRegistry.tMatSteel, EnumToolType.MINER)
|
||||
.addBreakAbility(new ToolAbility.ShredderAbility()).setMaxDamage(2500).setUnlocalizedName("smashing_hammer").setTextureName(RefStrings.MODID + ":smashing_hammer");
|
||||
|
||||
mask_of_infamy = new MaskOfInfamy(ArmorMaterial.IRON, 8, 0).setUnlocalizedName("mask_of_infamy").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":mask_of_infamy");
|
||||
|
||||
@ -4050,6 +4055,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(crystal_fluorite, crystal_fluorite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_beryllium, crystal_beryllium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_lead, crystal_lead.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_schraranium, crystal_schraranium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_schrabidium, crystal_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_rare, crystal_rare.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crystal_phosphorus, crystal_phosphorus.getUnlocalizedName());
|
||||
@ -5314,6 +5320,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(elec_pickaxe, elec_pickaxe.getUnlocalizedName());
|
||||
GameRegistry.registerItem(elec_axe, elec_axe.getUnlocalizedName());
|
||||
GameRegistry.registerItem(elec_shovel, elec_shovel.getUnlocalizedName());
|
||||
GameRegistry.registerItem(smashing_hammer, smashing_hammer.getUnlocalizedName());
|
||||
GameRegistry.registerItem(centri_stick, centri_stick.getUnlocalizedName());
|
||||
GameRegistry.registerItem(matchstick, matchstick.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crowbar, crowbar.getUnlocalizedName());
|
||||
|
||||
@ -5,12 +5,12 @@ import java.util.List;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.handler.ArmorUtil;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.render.model.ModelT45Boots;
|
||||
import com.hbm.render.model.ModelT45Chest;
|
||||
import com.hbm.render.model.ModelT45Helmet;
|
||||
import com.hbm.render.model.ModelT45Legs;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
@ -164,7 +164,7 @@ public class ArmorT45 extends ItemArmor implements ISpecialArmor {
|
||||
boolean b = true;
|
||||
|
||||
if(player.inventory.hasItem(ModItems.fusion_core_infinite)) {
|
||||
armor.stackTagCompound.setInteger("charge", (int)ItemBattery.getCharge(ItemBattery.getFullBattery(ModItems.fusion_core)));
|
||||
armor.stackTagCompound.setInteger("charge", (int)((IBatteryItem)ModItems.fusion_core).getMaxCharge());
|
||||
}
|
||||
|
||||
if(b)
|
||||
@ -172,9 +172,9 @@ public class ArmorT45 extends ItemArmor implements ISpecialArmor {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if (stack != null && stack.getItem() == ModItems.fusion_core
|
||||
&& ItemBattery.getCharge(stack) != 0) {
|
||||
&& ((IBatteryItem)stack.getItem()).getCharge(stack) != 0) {
|
||||
if (armor.stackTagCompound.getInteger("charge") == 0) {
|
||||
int j = (int) ItemBattery.getCharge(stack);
|
||||
int j = (int) ((IBatteryItem)stack.getItem()).getCharge(stack);
|
||||
armor.stackTagCompound.setInteger("charge", j);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
player.addChatMessage(new ChatComponentText("[Power Armor recharged]"));
|
||||
|
||||
@ -62,9 +62,19 @@ public class ItemBlockLore extends ItemBlock {
|
||||
list.add("attention in chemistry class.");
|
||||
}
|
||||
|
||||
if(this.field_150939_a == ModBlocks.machine_mining_laser) {
|
||||
list.add("3x3x3 Multiblock");
|
||||
list.add("Only placeable on a ceiling.");
|
||||
}
|
||||
|
||||
if(this.field_150939_a == ModBlocks.gravel_diamond) {
|
||||
list.add("There is some kind of joke here,");
|
||||
list.add("but I can't quite tell what it is.");
|
||||
list.add("");
|
||||
list.add("Update, 2020-07-04:");
|
||||
list.add("We deny any implications of a joke on");
|
||||
list.add("the basis that it was so severly unfunny");
|
||||
list.add("that people started stabbing their eyes out.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -131,6 +131,36 @@ public class ItemAssemblyTemplate extends Item {
|
||||
UPGRADE_PINK_III,
|
||||
UPGRADE_RANGE,
|
||||
UPGRADE_HEALTH,
|
||||
|
||||
UPGRADE_OVERDRIVE_I(200, Arrays.asList(
|
||||
new ItemStack(ModItems.upgrade_speed_3, 4),
|
||||
new ItemStack(ModItems.upgrade_effect_3, 2),
|
||||
new ItemStack(ModItems.ingot_desh, 8),
|
||||
new ItemStack(ModItems.powder_power, 16),
|
||||
new ItemStack(ModItems.crystal_lithium, 4),
|
||||
new ItemStack(ModItems.circuit_schrabidium, 4)),
|
||||
new ItemStack(ModItems.upgrade_overdrive_1)),
|
||||
UPGRADE_OVERDRIVE_II(400, Arrays.asList(
|
||||
new ItemStack(ModItems.upgrade_overdrive_1, 1),
|
||||
new ItemStack(ModItems.upgrade_afterburn_1, 1),
|
||||
new ItemStack(ModItems.upgrade_speed_3, 2),
|
||||
new ItemStack(ModItems.upgrade_effect_3, 2),
|
||||
new ItemStack(ModItems.ingot_saturnite, 12),
|
||||
new ItemStack(ModItems.powder_nitan_mix, 16),
|
||||
new ItemStack(ModItems.crystal_starmetal, 6),
|
||||
new ItemStack(ModItems.circuit_schrabidium, 6)),
|
||||
new ItemStack(ModItems.upgrade_overdrive_2)),
|
||||
UPGRADE_OVERDRIVE_III(800, Arrays.asList(
|
||||
new ItemStack(ModItems.upgrade_overdrive_2, 1),
|
||||
new ItemStack(ModItems.upgrade_afterburn_1, 1),
|
||||
new ItemStack(ModItems.upgrade_speed_3, 2),
|
||||
new ItemStack(ModItems.upgrade_effect_3, 2),
|
||||
new ItemStack(ModItems.ingot_desh, 8),
|
||||
new ItemStack(ModItems.powder_power, 16),
|
||||
new ItemStack(ModItems.crystal_lithium, 4),
|
||||
new ItemStack(ModItems.circuit_schrabidium, 4)),
|
||||
new ItemStack(ModItems.upgrade_overdrive_3)),
|
||||
|
||||
FUSE,
|
||||
REDCOIL_CAPACITOR,
|
||||
TITANIUM_FILTER,
|
||||
@ -175,6 +205,7 @@ public class ItemAssemblyTemplate extends Item {
|
||||
CHEMPLANT,
|
||||
TANK,
|
||||
MINER,
|
||||
MININGLASER,
|
||||
TURBOFAN,
|
||||
TELEPORTER,
|
||||
SCHRABTRANS,
|
||||
@ -997,6 +1028,8 @@ public class ItemAssemblyTemplate extends Item {
|
||||
return 150;
|
||||
case MINER:
|
||||
return 200;
|
||||
case MININGLASER:
|
||||
return 400;
|
||||
case TURBOFAN:
|
||||
return 500;
|
||||
case TELEPORTER:
|
||||
|
||||
@ -5,13 +5,14 @@ import java.util.List;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ItemBattery extends Item {
|
||||
public class ItemBattery extends Item implements IBatteryItem {
|
||||
|
||||
private long maxCharge;
|
||||
private long chargeRate;
|
||||
@ -21,8 +22,6 @@ public class ItemBattery extends Item {
|
||||
this.maxCharge = dura;
|
||||
this.chargeRate = chargeRate;
|
||||
this.dischargeRate = dischargeRate;
|
||||
this.setMaxDamage(100);
|
||||
this.canRepair = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -30,7 +29,7 @@ public class ItemBattery extends Item {
|
||||
{
|
||||
long charge = maxCharge;
|
||||
if(itemstack.hasTagCompound())
|
||||
charge = ItemBattery.getCharge(itemstack);
|
||||
charge = getCharge(itemstack);
|
||||
|
||||
if(itemstack.getItem() != ModItems.fusion_core &&
|
||||
itemstack.getItem() != ModItems.factory_core_titanium &&
|
||||
@ -107,7 +106,7 @@ public class ItemBattery extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
public static long getCharge(ItemStack stack) {
|
||||
public long getCharge(ItemStack stack) {
|
||||
if(stack.getItem() instanceof ItemBattery) {
|
||||
if(stack.hasTagCompound()) {
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
@ -133,17 +132,12 @@ public class ItemBattery extends Item {
|
||||
return dischargeRate;
|
||||
}
|
||||
|
||||
public static long getMaxChargeStatic(ItemStack stack) {
|
||||
return ((ItemBattery)stack.getItem()).maxCharge;
|
||||
}
|
||||
|
||||
public static ItemStack getEmptyBattery(Item item) {
|
||||
|
||||
if(item instanceof ItemBattery) {
|
||||
ItemStack stack = new ItemStack(item);
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", 0);
|
||||
stack.setItemDamage(100);
|
||||
return stack.copy();
|
||||
}
|
||||
|
||||
@ -155,20 +149,19 @@ public class ItemBattery extends Item {
|
||||
if(item instanceof ItemBattery) {
|
||||
ItemStack stack = new ItemStack(item);
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", getMaxChargeStatic(stack));
|
||||
stack.stackTagCompound.setLong("charge", ((ItemBattery)item).getMaxCharge());
|
||||
return stack.copy();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void updateDamage(ItemStack stack) {
|
||||
|
||||
if(!stack.hasTagCompound()) {
|
||||
stack = getFullBattery(stack.getItem()).copy();
|
||||
}
|
||||
|
||||
stack.setItemDamage(100 - (int)((double)getCharge(stack) / (double)getMaxChargeStatic(stack) * 100D));
|
||||
}
|
||||
|
||||
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public double getDurabilityForDisplay(ItemStack stack)
|
||||
{
|
||||
return 1D - (double)getCharge(stack) / (double)getMaxCharge();
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,9 +19,9 @@ import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.items.tool.ItemToolAbilityPower;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.tileentity.TileEntityProxyInventory;
|
||||
import com.hbm.tileentity.conductor.TileEntityCable;
|
||||
import com.hbm.tileentity.conductor.TileEntityCableSwitch;
|
||||
import com.hbm.tileentity.conductor.TileEntityFluidDuct;
|
||||
@ -36,6 +36,7 @@ import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFluidTank;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTransformer;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@ -172,10 +173,13 @@ public class Library {
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_base ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_reactor_small ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_compact_launcher ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_launch_table)
|
||||
{
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_launch_table) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(world.getBlock(x, y, z) == ModBlocks.machine_mining_laser && tileentity instanceof TileEntityProxyInventory)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -366,26 +370,28 @@ public class Library {
|
||||
//not great either but certainly better
|
||||
public static long chargeItemsFromTE(ItemStack[] slots, int index, long power, long maxPower) {
|
||||
|
||||
if(slots[index] != null && slots[index].getItem() instanceof ItemBattery) {
|
||||
if(slots[index] != null && slots[index].getItem() instanceof IBatteryItem) {
|
||||
|
||||
IBatteryItem battery = (IBatteryItem) slots[index].getItem();
|
||||
|
||||
long batMax = ItemBattery.getMaxChargeStatic(slots[index]);
|
||||
long batCharge = ItemBattery.getCharge(slots[index]);
|
||||
long batRate = ((ItemBattery)slots[index].getItem()).getChargeRate();
|
||||
long batMax = battery.getMaxCharge();
|
||||
long batCharge = battery.getCharge(slots[index]);
|
||||
long batRate = battery.getChargeRate();
|
||||
|
||||
//in hHE
|
||||
long toCharge = Math.min(Math.min(power / 100, batRate), batMax - batCharge);
|
||||
|
||||
power -= toCharge * 100;
|
||||
|
||||
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], toCharge);
|
||||
battery.chargeBattery(slots[index], toCharge);
|
||||
|
||||
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_desh && ItemBattery.getCharge(slots[index]) >= ItemBattery.getMaxChargeStatic(slots[index]))
|
||||
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_desh && battery.getCharge(slots[index]) >= battery.getMaxCharge())
|
||||
slots[index] = new ItemStack(ModItems.dynosphere_desh_charged);
|
||||
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_schrabidium && ItemBattery.getCharge(slots[index]) >= ItemBattery.getMaxChargeStatic(slots[index]))
|
||||
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_schrabidium && battery.getCharge(slots[index]) >= battery.getMaxCharge())
|
||||
slots[index] = new ItemStack(ModItems.dynosphere_schrabidium_charged);
|
||||
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_euphemium && ItemBattery.getCharge(slots[index]) >= ItemBattery.getMaxChargeStatic(slots[index]))
|
||||
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_euphemium && battery.getCharge(slots[index]) >= battery.getMaxCharge())
|
||||
slots[index] = new ItemStack(ModItems.dynosphere_euphemium_charged);
|
||||
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_dineutronium && ItemBattery.getCharge(slots[index]) >= ItemBattery.getMaxChargeStatic(slots[index]))
|
||||
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_dineutronium && battery.getCharge(slots[index]) >= battery.getMaxCharge())
|
||||
slots[index] = new ItemStack(ModItems.dynosphere_dineutronium_charged);
|
||||
}
|
||||
|
||||
@ -404,10 +410,6 @@ public class Library {
|
||||
|
||||
}
|
||||
|
||||
if(slots[index] != null && slots[index].getItem() instanceof ItemBattery) {
|
||||
ItemBattery.updateDamage(slots[index]);
|
||||
}
|
||||
|
||||
return power;
|
||||
}
|
||||
|
||||
@ -423,18 +425,18 @@ public class Library {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
if(slots[index] != null && slots[index].getItem() instanceof ItemBattery) {
|
||||
if(slots[index] != null && slots[index].getItem() instanceof IBatteryItem) {
|
||||
|
||||
IBatteryItem battery = (IBatteryItem) slots[index].getItem();
|
||||
|
||||
long batCharge = ItemBattery.getCharge(slots[index]);
|
||||
long batRate = ((ItemBattery)slots[index].getItem()).getDischargeRate();
|
||||
long batCharge = battery.getCharge(slots[index]);
|
||||
long batRate = battery.getDischargeRate();
|
||||
|
||||
//in hHe
|
||||
long toDischarge = Math.min(Math.min((maxPower - power) / 100, batRate), batCharge);
|
||||
|
||||
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], toDischarge);
|
||||
battery.dischargeBattery(slots[index], toDischarge);
|
||||
power += toDischarge * 100;
|
||||
|
||||
ItemBattery.updateDamage(slots[index]);
|
||||
}
|
||||
|
||||
return power;
|
||||
|
||||
@ -879,6 +879,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_fuel_napalm, 1), new Object[] { " P ", "BDB", " P ", 'P', "plateSteel", 'B', ModItems.bolt_tungsten, 'D', ModItems.canister_napalm }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_fuel_phosphorus, 1), new Object[] { "CPC", "CDC", "CPC", 'C', "dustCoal", 'P', ModItems.ingot_phosphorus, 'D', ModItems.ammo_fuel }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ammo_fuel_gas, 1), new Object[] { "PDP", "BDB", "PDP", 'P', "plateSteel", 'B', ModItems.bolt_tungsten, 'D', ModItems.pellet_gas }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.ammo_fuel_vaporizer, 1), new Object[] { "PSP", "SNS", "PSP", 'P', ModItems.ingot_phosphorus, 'S', ModItems.crystal_sulfur, 'N', ModItems.ammo_fuel_napalm });
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_357, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_357 }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_44, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_44 }));
|
||||
@ -1147,6 +1148,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.elec_axe, 1), new Object[] { " DP", "RRM", " PB", 'P', ModItems.ingot_polymer, 'D', ModItems.ingot_dura_steel, 'R', ModItems.bolt_dura_steel, 'M', ModItems.motor, 'B', ModItems.battery_lithium });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.elec_shovel, 1), new Object[] { " P", "RRM", " B", 'P', ModItems.ingot_polymer, 'D', ModItems.ingot_dura_steel, 'R', ModItems.bolt_dura_steel, 'M', ModItems.motor, 'B', ModItems.battery_lithium });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.centri_stick, 1), new Object[] { ModItems.centrifuge_element, ModItems.energy_core, Items.stick });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.smashing_hammer, 1), new Object[] { "STS", "SPS", " P ", 'S', "blockSteel", 'T', "blockTungsten", 'P', "ingotPolymer" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.desh_sword, 1), new Object[] { "I", "I", "S", 'I', ModItems.ingot_desh, 'S', Items.stick });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.desh_pickaxe, 1), new Object[] { "III", " S ", " S ", 'I', ModItems.ingot_desh, 'S', Items.stick });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.desh_axe, 1), new Object[] { "II", "IS", " S", 'I', ModItems.ingot_desh, 'S', Items.stick });
|
||||
@ -1606,6 +1608,8 @@ public class CraftingManager {
|
||||
GameRegistry.addSmelting(new ItemStack(Blocks.gravel, 1), new ItemStack(Blocks.cobblestone, 1), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ModBlocks.gravel_obsidian), new ItemStack(Blocks.obsidian), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ModBlocks.gravel_diamond), new ItemStack(Items.diamond), 3.0F);
|
||||
|
||||
GameRegistry.addSmelting(ModItems.ingot_schraranium, new ItemStack(ModItems.nugget_schrabidium, 1), 2.0F);
|
||||
|
||||
GameRegistry.addSmelting(ModItems.crystal_iron, new ItemStack(Items.iron_ingot, 2), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_gold, new ItemStack(Items.gold_ingot, 2), 2.0F);
|
||||
@ -1623,6 +1627,7 @@ public class CraftingManager {
|
||||
GameRegistry.addSmelting(ModItems.crystal_fluorite, new ItemStack(ModItems.fluorite, 6), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_beryllium, new ItemStack(ModItems.ingot_beryllium, 2), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_lead, new ItemStack(ModItems.ingot_lead, 2), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_schraranium, new ItemStack(ModItems.nugget_schrabidium, 2), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_schrabidium, new ItemStack(ModItems.ingot_schrabidium, 2), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_rare, new ItemStack(ModItems.powder_desh_mix, 1), 2.0F);
|
||||
GameRegistry.addSmelting(ModItems.crystal_phosphorus, new ItemStack(ModItems.powder_fire, 6), 2.0F);
|
||||
|
||||
@ -4,6 +4,8 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -129,6 +131,9 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
GL11.glTranslatef(1.0F, -1.0F, -0.0F);
|
||||
GL11.glRotatef(170F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glScaled(0.25, 0.25, 0.25);
|
||||
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
|
||||
GL11.glTranslated(recoil[0], recoil[1], recoil[2]);
|
||||
|
||||
if(player.isSneaking()) {
|
||||
GL11.glRotatef(5F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.interfaces.IFactory;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -234,7 +235,7 @@ public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventor
|
||||
public void updateEntity() {
|
||||
if(this.slots[22] != null && this.slots[22].getItem() == ModItems.factory_core_advanced)
|
||||
{
|
||||
this.power = (int) ItemBattery.getCharge(slots[22]);
|
||||
this.power = (int) ((IBatteryItem)slots[22].getItem()).getCharge(slots[22]);
|
||||
} else {
|
||||
this.power = 0;
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.interfaces.IFactory;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -234,7 +235,7 @@ public class TileEntityCoreTitanium extends TileEntity implements ISidedInventor
|
||||
public void updateEntity() {
|
||||
if(this.slots[22] != null && this.slots[22].getItem() == ModItems.factory_core_titanium)
|
||||
{
|
||||
this.power = (int) ItemBattery.getCharge(slots[22]);
|
||||
this.power = (int) ((IBatteryItem)slots[22].getItem()).getCharge(slots[22]);
|
||||
} else {
|
||||
this.power = 0;
|
||||
}
|
||||
|
||||
@ -5,11 +5,11 @@ import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEFFPacket;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -120,7 +120,7 @@ public class TileEntityForceField extends TileEntity implements ISidedInventory,
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -4,12 +4,12 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.MachineArcFurnace;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -117,7 +117,7 @@ public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInv
|
||||
return false;
|
||||
|
||||
if(i == 5)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 2 || i == 3 || i == 4)
|
||||
@ -205,7 +205,7 @@ public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInv
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i == 5)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == 0)
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -8,13 +8,13 @@ import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemAssemblyTemplate;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.LoopedSoundPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEAssemblerPacket;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -120,7 +120,7 @@ public class TileEntityMachineAssembler extends TileEntity implements ISidedInve
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -6,10 +6,10 @@ import java.util.List;
|
||||
import com.hbm.blocks.machine.MachineBattery;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@ -71,11 +71,11 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
switch(i)
|
||||
{
|
||||
case 0:
|
||||
if(stack.getItem() instanceof ItemBattery)
|
||||
if(stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
break;
|
||||
case 1:
|
||||
if(stack.getItem() instanceof ItemBattery)
|
||||
if(stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
@ -142,11 +142,11 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
|
||||
if(itemStack.getItem() instanceof ItemBattery) {
|
||||
if(i == 0 && ItemBattery.getCharge(itemStack) == 0) {
|
||||
if(itemStack.getItem() instanceof IBatteryItem) {
|
||||
if(i == 0 && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0) {
|
||||
return true;
|
||||
}
|
||||
if(i == 1 && ItemBattery.getCharge(itemStack) == ItemBattery.getMaxChargeStatic(itemStack)) {
|
||||
if(i == 1 && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == ((IBatteryItem)itemStack.getItem()).getMaxCharge()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,12 +12,12 @@ import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -122,7 +122,7 @@ public class TileEntityMachineBoilerElectric extends TileEntity implements ISide
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
|
||||
if(i == 4)
|
||||
if(stack != null && stack.getItem() instanceof ItemBattery)
|
||||
if(stack != null && stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -9,11 +9,11 @@ import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
@ -115,7 +115,7 @@ public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInv
|
||||
switch(i)
|
||||
{
|
||||
case 0:
|
||||
if(stack.getItem() instanceof ItemBattery)
|
||||
if(stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
break;
|
||||
case 1:
|
||||
@ -215,7 +215,7 @@ public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInv
|
||||
if(i == 4)
|
||||
return true;
|
||||
if(i == 0)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == 0)
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0)
|
||||
return true;
|
||||
if(i == 2)
|
||||
if(itemStack.getItem() == Items.bucket || (itemStack.getItem() == ModItems.tank_waste && itemStack.getItemDamage() <= 0))
|
||||
|
||||
@ -2,13 +2,13 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.inventory.CentrifugeRecipes;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.LoopedSoundPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -115,10 +115,10 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
|
||||
}
|
||||
|
||||
if(i == 1) {
|
||||
return itemStack.getItem() instanceof ItemBattery;
|
||||
return itemStack.getItem() instanceof IBatteryItem;
|
||||
}
|
||||
|
||||
return !(itemStack.getItem() instanceof ItemBattery);
|
||||
return !(itemStack.getItem() instanceof IBatteryItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -13,7 +13,6 @@ import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.items.machine.ItemChemistryTemplate;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
@ -22,6 +21,7 @@ import com.hbm.packet.LoopedSoundPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEChemplantPacket;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -135,7 +135,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -21,12 +21,12 @@ import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidContainerRegistry;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
|
||||
public class TileEntityMachineCoal extends TileEntity implements ISidedInventory, ISource, IFluidContainer, IFluidAcceptor {
|
||||
@ -123,7 +123,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
if(FluidContainerRegistry.getFluidContent(stack, FluidType.WATER) > 0)
|
||||
return true;
|
||||
if(i == 2)
|
||||
if(stack.getItem() instanceof ItemBattery)
|
||||
if(stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
if(i == 1)
|
||||
if(TileEntityFurnace.getItemBurnTime(stack) > 0)
|
||||
@ -211,7 +211,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
if(itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty)
|
||||
return true;
|
||||
if(i == 2)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == ItemBattery.getMaxChargeStatic(itemStack))
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == ((IBatteryItem)itemStack.getItem()).getMaxCharge())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -8,10 +8,10 @@ import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.CrystallizerRecipes;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@ -195,7 +195,7 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
if(i == 0 && CrystallizerRecipes.getOutput(itemStack) != null)
|
||||
return true;
|
||||
|
||||
if(i == 1 && itemStack.getItem() instanceof ItemBattery)
|
||||
if(i == 1 && itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -104,10 +103,6 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
switch(i)
|
||||
{
|
||||
case 0:
|
||||
if(stack.getItem() instanceof ItemBattery)
|
||||
return true;
|
||||
break;
|
||||
case 1:
|
||||
if(stack.getItem() == ModItems.rod_water || stack.getItem() == ModItems.rod_dual_water || stack.getItem() == ModItems.rod_quad_water || stack.getItem() == Items.water_bucket)
|
||||
return true;
|
||||
@ -206,9 +201,6 @@ public class TileEntityMachineDeuterium extends TileEntity implements ISidedInve
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i == 4)
|
||||
return true;
|
||||
if(i == 0)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == 0)
|
||||
return true;
|
||||
if(i == 1)
|
||||
if(itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty)
|
||||
return true;
|
||||
|
||||
@ -11,12 +11,12 @@ import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidContainerRegistry;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -120,7 +120,7 @@ public class TileEntityMachineDiesel extends TileEntity implements ISidedInvento
|
||||
if (FluidContainerRegistry.getFluidContent(stack, tank.getTankType()) > 0)
|
||||
return true;
|
||||
if (i == 2)
|
||||
if (stack.getItem() instanceof ItemBattery)
|
||||
if (stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@ -199,7 +199,7 @@ public class TileEntityMachineDiesel extends TileEntity implements ISidedInvento
|
||||
if (itemStack.getItem() == ModItems.canister_empty || itemStack.getItem() == ModItems.tank_steel)
|
||||
return true;
|
||||
if (i == 2)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == ItemBattery.getMaxChargeStatic(itemStack))
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == ((IBatteryItem)itemStack.getItem()).getMaxCharge())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -2,12 +2,12 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.machine.MachineElectricFurnace;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -105,7 +105,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
@ -190,7 +190,7 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i == 0)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == 0)
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0)
|
||||
return true;
|
||||
if(i == 2)
|
||||
return true;
|
||||
|
||||
@ -12,11 +12,11 @@ import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -119,7 +119,7 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -13,12 +13,12 @@ import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.items.machine.ItemFuelRod;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -141,7 +141,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
if(itemStack.getItem() == ModItems.rod_coolant || itemStack.getItem() == ModItems.rod_dual_coolant || itemStack.getItem() == ModItems.rod_quad_coolant)
|
||||
return true;
|
||||
if(i == 11)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@ -251,7 +251,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
if(itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty)
|
||||
return true;
|
||||
if(i == 11)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == ItemBattery.getMaxChargeStatic(itemStack))
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == ((IBatteryItem)itemStack.getItem()).getMaxCharge())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.Random;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.LoopedSoundPacket;
|
||||
@ -13,6 +12,7 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEDrillPacket;
|
||||
import com.hbm.sound.SoundLoopMachine;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -126,7 +126,7 @@ public class TileEntityMachineMiningDrill extends TileEntity implements ISidedIn
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -1,13 +1,18 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.CentrifugeRecipes;
|
||||
import com.hbm.inventory.CrystallizerRecipes;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.ShredderRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
@ -30,11 +35,14 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMachineMiningLaser extends TileEntityMachineBase implements IConsumer {
|
||||
public class TileEntityMachineMiningLaser extends TileEntityMachineBase implements IConsumer, IFluidSource {
|
||||
|
||||
public long power;
|
||||
public int age = 0;
|
||||
public static final long maxPower = 100000000;
|
||||
public static final int consumption = 10000;
|
||||
public FluidTank tank;
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
|
||||
public boolean isOn;
|
||||
public int targetX;
|
||||
@ -53,6 +61,7 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
//slots 1 - 8: upgrades
|
||||
//slots 9 - 29: output
|
||||
super(30);
|
||||
tank = new FluidTank(FluidType.OIL, 64000, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -64,8 +73,17 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
age++;
|
||||
if (age >= 20) {
|
||||
age = 0;
|
||||
}
|
||||
|
||||
if (age == 9 || age == 19)
|
||||
fillFluidInit(tank.getTankType());
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
tank.updateTank(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId);
|
||||
|
||||
//reset progress if the position changes
|
||||
if(lastTargetX != targetX ||
|
||||
@ -297,6 +315,18 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
continue;
|
||||
}
|
||||
|
||||
if(item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.ore_oil)) {
|
||||
|
||||
tank.setTankType(FluidType.OIL); //just to be sure
|
||||
|
||||
tank.setFill(tank.getFill() + 500);
|
||||
if(tank.getFill() > tank.getMaxFill())
|
||||
tank.setFill(tank.getMaxFill());
|
||||
|
||||
item.setDead();
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemStack stack = InventoryUtil.tryAddItemToInventory(slots, 9, 29, item.getEntityItem().copy());
|
||||
|
||||
if(stack == null)
|
||||
@ -600,4 +630,81 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
if(type == FluidType.OIL)
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return new ArrayList() {{ add(tank); }};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type == FluidType.OIL)
|
||||
return tank.getFill();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
fillFluid(xCoord + 2, yCoord, zCoord, this.getTact(), type);
|
||||
fillFluid(xCoord - 2, yCoord, zCoord, this.getTact(), type);
|
||||
fillFluid(xCoord, yCoord, zCoord + 2, this.getTact(), type);
|
||||
fillFluid(xCoord, yCoord, zCoord - 2, this.getTact(), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
if (age >= 0 && age < 10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
list.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
tank.readFromNBT(nbt, "oil");
|
||||
isOn = nbt.getBoolean("isOn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
tank.writeToNBT(nbt, "oil");
|
||||
nbt.setBoolean("isOn", isOn);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,11 +14,11 @@ import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -130,7 +130,7 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -13,12 +13,12 @@ import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEPumpjackPacket;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -132,7 +132,7 @@ public class TileEntityMachinePumpjack extends TileEntity implements ISidedInven
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -11,7 +11,6 @@ import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.items.machine.ItemFuelRod;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
@ -19,6 +18,7 @@ import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.saveddata.RadiationSavedData;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -145,7 +145,7 @@ public class TileEntityMachineReactorSmallOld extends TileEntity
|
||||
|| itemStack.getItem() == ModItems.rod_quad_coolant)
|
||||
return true;
|
||||
if (i == 16)
|
||||
if (itemStack.getItem() instanceof ItemBattery)
|
||||
if (itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@ -245,8 +245,7 @@ public class TileEntityMachineReactorSmallOld extends TileEntity
|
||||
|| itemStack.getItem() == ModItems.fluid_barrel_empty)
|
||||
return true;
|
||||
if (i == 16)
|
||||
if (itemStack.getItem() instanceof ItemBattery
|
||||
&& ItemBattery.getCharge(itemStack) == ItemBattery.getMaxChargeStatic(itemStack))
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == ((IBatteryItem)itemStack.getItem()).getMaxCharge())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -11,11 +11,11 @@ import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidContainerRegistry;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -126,7 +126,7 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
|
||||
if(i == 0 && stack.getItem() instanceof ItemBattery)
|
||||
if(i == 0 && stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
if(i == 1 && FluidContainerRegistry.getFluidContent(stack, FluidType.HOTOIL) > 0)
|
||||
return true;
|
||||
@ -230,7 +230,7 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i == 0)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == 0)
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0)
|
||||
return true;
|
||||
if(i == 2)
|
||||
return true;
|
||||
|
||||
@ -1,33 +1,25 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityMachineSchrabidiumTransmutator extends TileEntity implements ISidedInventory, IConsumer {
|
||||
|
||||
private ItemStack slots[];
|
||||
public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineBase implements IConsumer {
|
||||
|
||||
public long power = 0;
|
||||
public int process = 0;
|
||||
public int soundCycle = 0;
|
||||
public static final long maxPower = 5000000;
|
||||
public static final int processSpeed = 60;
|
||||
Random rand = new Random();
|
||||
public static final int processSpeed = 600;
|
||||
|
||||
private AudioWrapper audio;
|
||||
|
||||
private static final int[] slots_top = new int[] { 0 };
|
||||
private static final int[] slots_bottom = new int[] { 1, 2 };
|
||||
@ -36,36 +28,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineSchrabidiumTransmutator() {
|
||||
slots = new ItemStack[4];
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
super(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -82,28 +45,16 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
this.customName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
} else {
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
switch (i) {
|
||||
@ -116,66 +67,26 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
return true;
|
||||
break;
|
||||
case 3:
|
||||
if (stack.getItem() instanceof ItemBattery)
|
||||
if (stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@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 void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
power = nbt.getLong("power");
|
||||
process = nbt.getShort("process");
|
||||
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);
|
||||
}
|
||||
}
|
||||
process = nbt.getInteger("process");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
nbt.setShort("process", (short) process);
|
||||
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);
|
||||
nbt.setInteger("process", process);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -183,11 +94,6 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack stack, int j) {
|
||||
if (i == 2 && stack.getItem() != null && stack.getItem() == ModItems.redcoil_capacitor
|
||||
@ -200,7 +106,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
}
|
||||
|
||||
if (i == 3) {
|
||||
if (stack.getItem() instanceof ItemBattery && ItemBattery.getCharge(stack) == 0)
|
||||
if (stack.getItem() instanceof IBatteryItem && ((IBatteryItem)stack.getItem()).getCharge(stack) == 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -219,7 +125,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
if (power >= 4990000 && slots[0] != null && MachineRecipes.mODE(slots[0], "ingotUranium") && slots[2] != null
|
||||
&& slots[2].getItem() == ModItems.redcoil_capacitor
|
||||
&& slots[2].getItemDamage() < slots[2].getMaxDamage()
|
||||
&& (slots[1] == null || (slots[1] != null && slots[1].getItem() == ModItems.ingot_schrabidium
|
||||
&& (slots[1] == null || (slots[1] != null && slots[1].getItem() == ModItems.ingot_schraranium
|
||||
&& slots[1].stackSize < slots[1].getMaxStackSize()))) {
|
||||
return true;
|
||||
}
|
||||
@ -233,15 +139,6 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
public void process() {
|
||||
process++;
|
||||
|
||||
if (isProcessing()) {
|
||||
if (soundCycle == 0)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 1.0F);
|
||||
soundCycle++;
|
||||
|
||||
if (soundCycle >= 38)
|
||||
soundCycle = 0;
|
||||
}
|
||||
|
||||
if (process >= processSpeed) {
|
||||
|
||||
power = 0;
|
||||
@ -253,7 +150,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
}
|
||||
|
||||
if (slots[1] == null) {
|
||||
slots[1] = new ItemStack(ModItems.ingot_schrabidium);
|
||||
slots[1] = new ItemStack(ModItems.ingot_schraranium);
|
||||
} else {
|
||||
slots[1].stackSize++;
|
||||
}
|
||||
@ -262,7 +159,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
}
|
||||
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "ambient.weather.thunder", 10000.0F,
|
||||
0.8F + this.rand.nextFloat() * 0.2F);
|
||||
0.8F + this.worldObj.rand.nextFloat() * 0.2F);
|
||||
}
|
||||
}
|
||||
|
||||
@ -273,29 +170,68 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntity impleme
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 3, power, maxPower);
|
||||
|
||||
if (canProcess()) {
|
||||
|
||||
//if (!worldObj.isRemote) {
|
||||
if(canProcess()) {
|
||||
process();
|
||||
//}
|
||||
} else {
|
||||
process = 0;
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setInteger("progress", process);
|
||||
this.networkPack(data, 50);
|
||||
|
||||
} else {
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
if(process > 0) {
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:weapon.tauChargeLoop", xCoord, yCoord, zCoord, 1.0F, 1.0F);
|
||||
audio.startSound();
|
||||
}
|
||||
} else {
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onChunkUnload() {
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
|
||||
super.invalidate();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
|
||||
this.power = data.getLong("power");
|
||||
this.process = data.getInteger("progress");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -11,12 +11,12 @@ import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidContainerRegistry;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -121,7 +121,7 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
|
||||
if (FluidContainerRegistry.getFluidContent(stack, tank.getTankType()) > 0)
|
||||
return true;
|
||||
if (i == 13)
|
||||
if (stack.getItem() instanceof ItemBattery)
|
||||
if (stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@ -200,7 +200,7 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
|
||||
if (itemStack.getItem() == ModItems.canister_empty || itemStack.getItem() == ModItems.tank_steel)
|
||||
return true;
|
||||
if (i == 2)
|
||||
if (itemStack.getItem() instanceof ItemBattery && ItemBattery.getCharge(itemStack) == ItemBattery.getMaxChargeStatic(itemStack))
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == ((IBatteryItem)itemStack.getItem()).getMaxCharge())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -2,12 +2,12 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.inventory.ShredderRecipes;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.items.machine.ItemBlades;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -107,7 +107,7 @@ public class TileEntityMachineShredder extends TileEntity implements ISidedInven
|
||||
if(i == 0)
|
||||
return true;
|
||||
if(i == 2)
|
||||
if(stack.getItem() instanceof ItemBattery || stack.getItem() instanceof ItemBlades)
|
||||
if(stack.getItem() instanceof IBatteryItem || stack.getItem() instanceof ItemBlades)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -3,10 +3,10 @@ package com.hbm.tileentity.machine;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -104,7 +104,7 @@ public class TileEntityMachineShredderLarge extends TileEntity implements ISided
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
|
||||
@ -11,11 +11,11 @@ import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -118,7 +118,7 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
|
||||
if(i == 4)
|
||||
if(stack != null && stack.getItem() instanceof ItemBattery)
|
||||
if(stack != null && stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@ -2,8 +2,8 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -104,7 +104,7 @@ public class TileEntityReiXMainframe extends TileEntity implements ISidedInvento
|
||||
switch(i)
|
||||
{
|
||||
case 0:
|
||||
if(stack.getItem() instanceof ItemBattery)
|
||||
if(stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
break;
|
||||
case 1:
|
||||
@ -203,9 +203,6 @@ public class TileEntityReiXMainframe extends TileEntity implements ISidedInvento
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i == 4)
|
||||
return true;
|
||||
if(i == 0 && itemStack.getItem() instanceof ItemBattery)
|
||||
if(itemStack.getItemDamage() == itemStack.getMaxDamage())
|
||||
return true;
|
||||
if(i == 2)
|
||||
if(itemStack.getItem() == Items.bucket || (itemStack.getItem() == ModItems.tank_waste && itemStack.getItemDamage() <= 0))
|
||||
return true;
|
||||
|
||||