mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
energy converters now feature state-of-the-art recursion brakes!
This commit is contained in:
parent
f127621093
commit
949ca4010e
@ -1,6 +1,6 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityConverterHeRf;
|
||||
import com.hbm.tileentity.network.TileEntityConverterHeRf;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityConverterRfHe;
|
||||
import com.hbm.tileentity.network.TileEntityConverterRfHe;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
@ -18,7 +18,7 @@ public class PowderRecipes {
|
||||
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_power, 5), new Object[] { REDSTONE.dust(), "dustGlowstone", DIAMOND.dust(), NP237.dust(), MAGTUNG.dust() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ballistite, 3), new Object[] { Items.gunpowder, KNO.dust(), Items.sugar });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ball_dynamite, 2), new Object[] { KNO.dust(), Items.sugar, Blocks.sand });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ball_dynamite, 2), new Object[] { KNO.dust(), Items.sugar, Blocks.sand, KEY_TOOL_CHEMISTRYSET });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ingot_steel_dusted, 1), new Object[] { STEEL.ingot(), COAL.dust() });
|
||||
|
||||
//Gunpowder
|
||||
@ -42,8 +42,8 @@ public class PowderRecipes {
|
||||
|
||||
//Metal powders
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { REDSTONE.dust(), IRON.dust(), COAL.dust(), CU.dust() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 3), new Object[] { IRON.dust(), COAL.dust(), MINGRADE.dust() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 3), new Object[] { REDSTONE.dust(), STEEL.dust(), CU.dust() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { IRON.dust(), COAL.dust(), MINGRADE.dust(), MINGRADE.dust() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { REDSTONE.dust(), CU.dust(), STEEL.dust(), STEEL.dust() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 2), new Object[] { MINGRADE.dust(), STEEL.dust() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_magnetized_tungsten, 1), new Object[] { W.dust(), SA326.nugget() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_tcalloy, 1), new Object[] { STEEL.dust(), TC99.nugget() });
|
||||
|
||||
@ -131,7 +131,13 @@ public class ToolRecipes {
|
||||
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.mirror_tool), new Object[] { " A ", " IA", "I ", 'A', AL.ingot(), 'I', IRON.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rbmk_tool), new Object[] { " A ", " IA", "I ", 'A', PB.ingot(), 'I', IRON.ingot() });
|
||||
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.screwdriver, 1), new Object[] { " I", " I ", "S ", 'S', STEEL.ingot(), 'I', IRON.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.screwdriver_desh, 1), new Object[] { " I", " I ", "S ", 'S', DESH.ingot(), 'I', ANY_PLASTIC.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.hand_drill), new Object[] { " D", "S ", " S", 'D', DURA.ingot(), 'S', KEY_STICK });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.hand_drill_desh), new Object[] { " D", "S ", " S", 'D', DESH.ingot(), 'S', ANY_PLASTIC.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.chemistry_set), new Object[] { "GIG", "GCG", 'G', KEY_ANYGLASS, 'I', IRON.ingot(), 'C', CU.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.chemistry_set_boron), new Object[] { "GIG", "GCG", 'G', ModBlocks.glass_boron, 'I', STEEL.ingot(), 'C', CO.ingot() });
|
||||
|
||||
//Bobmazon
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.bobmazon_materials), new Object[] { Items.book, Items.gold_nugget, Items.string });
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
package com.hbm.explosion.vanillant;
|
||||
|
||||
public class ExplosionVNT {
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package com.hbm.explosion.vanillant;
|
||||
|
||||
public interface IBlockAllocator {
|
||||
|
||||
}
|
||||
@ -62,6 +62,10 @@ public class OreDictManager {
|
||||
public static final String KEY_OIL_TAR = "oiltar";
|
||||
public static final String KEY_CRACK_TAR = "cracktar";
|
||||
public static final String KEY_COAL_TAR = "coaltar";
|
||||
|
||||
public static final String KEY_TOOL_SCREWDRIVER = "ntmscrewdriver";
|
||||
public static final String KEY_TOOL_HANDDRILL = "ntmhanddrill";
|
||||
public static final String KEY_TOOL_CHEMISTRYSET = "ntmchemistryset";
|
||||
|
||||
/*
|
||||
* PREFIXES
|
||||
@ -376,6 +380,13 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre(KEY_OIL_TAR, fromOne(oil_tar, EnumTarType.CRUDE));
|
||||
OreDictionary.registerOre(KEY_CRACK_TAR, fromOne(oil_tar, EnumTarType.CRACK));
|
||||
OreDictionary.registerOre(KEY_COAL_TAR, fromOne(oil_tar, EnumTarType.COAL));
|
||||
|
||||
OreDictionary.registerOre(KEY_TOOL_SCREWDRIVER, screwdriver);
|
||||
OreDictionary.registerOre(KEY_TOOL_SCREWDRIVER, screwdriver_desh);
|
||||
OreDictionary.registerOre(KEY_TOOL_HANDDRILL, hand_drill);
|
||||
OreDictionary.registerOre(KEY_TOOL_HANDDRILL, hand_drill_desh);
|
||||
OreDictionary.registerOre(KEY_TOOL_CHEMISTRYSET, chemistry_set);
|
||||
OreDictionary.registerOre(KEY_TOOL_CHEMISTRYSET, chemistry_set_boron);
|
||||
|
||||
OreDictionary.registerOre(getReflector(), neutron_reflector);
|
||||
OreDictionary.registerOre("oreRareEarth", ore_rare);
|
||||
|
||||
@ -1862,6 +1862,8 @@ public class ModItems {
|
||||
public static Item fuse;
|
||||
public static Item redcoil_capacitor;
|
||||
public static Item titanium_filter;
|
||||
//by using these in crafting table recipes, i'm running the risk of making my recipes too greg-ian (which i don't like)
|
||||
//in the event that i forget about the meaning of the word "sparingly", please throw a brick at my head
|
||||
public static Item screwdriver;
|
||||
public static Item screwdriver_desh;
|
||||
public static Item hand_drill;
|
||||
@ -7899,6 +7901,8 @@ public class ModItems {
|
||||
GameRegistry.registerItem(hazmat_grey_kit, hazmat_grey_kit.getUnlocalizedName());
|
||||
GameRegistry.registerItem(kit_custom, kit_custom.getUnlocalizedName());
|
||||
GameRegistry.registerItem(euphemium_kit, euphemium_kit.getUnlocalizedName());
|
||||
GameRegistry.registerItem(kit_toolbox_empty, kit_toolbox_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(kit_toolbox, kit_toolbox.getUnlocalizedName());
|
||||
GameRegistry.registerItem(letter, letter.getUnlocalizedName());
|
||||
|
||||
//Misile Loot Boxes
|
||||
|
||||
@ -294,7 +294,6 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModItems.black_hole, 1), new Object[] { "SSS", "SCS", "SSS", 'C', ModItems.singularity, 'S', ModItems.crystal_xen });
|
||||
addRecipeAuto(new ItemStack(ModItems.crystal_xen, 1), new Object[] { "EEE", "EIE", "EEE", 'E', ModItems.powder_power, 'I', EUPH.ingot() });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.screwdriver, 1), new Object[] { " I", " I ", "S ", 'S', STEEL.ingot(), 'I', IRON.ingot() });
|
||||
addShapelessAuto(new ItemStack(ModItems.overfuse, 1), new Object[] { ModItems.bolt_tungsten, NP237.dust(), I.dust(), TH232.dust(), AT.dust(), ND.dust(), ModItems.board_copper, ModItems.black_hole, CS.dust() });
|
||||
addShapelessAuto(new ItemStack(ModItems.overfuse, 1), new Object[] { ModItems.bolt_tungsten, ST.dust(), BR.dust(), CO.dust(), TS.dust(), NB.dust(), ModItems.board_copper, ModItems.black_hole, CE.dust() });
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.network;
|
||||
|
||||
import com.hbm.calc.Location;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
@ -60,9 +60,16 @@ public class TileEntityConverterHeRf extends TileEntity implements IEnergyConnec
|
||||
return 0;
|
||||
}
|
||||
|
||||
private boolean recursionBrake = false;
|
||||
|
||||
@Override
|
||||
public long transferPower(long power) {
|
||||
|
||||
if(recursionBrake)
|
||||
return power;
|
||||
|
||||
recursionBrake = true;
|
||||
|
||||
// we have to limit the transfer amount because otherwise FEnSUs would overflow the RF output, twice
|
||||
long out = Math.min(power, Long.MAX_VALUE / 4);
|
||||
int toRF = (int) Math.min(Integer.MAX_VALUE, out * 4);
|
||||
@ -81,6 +88,8 @@ public class TileEntityConverterHeRf extends TileEntity implements IEnergyConnec
|
||||
toRF -= energyTransferred; //to prevent energy duping
|
||||
}
|
||||
}
|
||||
|
||||
recursionBrake = false;
|
||||
|
||||
return power - (energyTransferred / 4);
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.network;
|
||||
|
||||
import com.hbm.interfaces.Untested;
|
||||
|
||||
@ -30,14 +30,20 @@ public class TileEntityConverterRfHe extends TileEntity implements IEnergyGenera
|
||||
}
|
||||
|
||||
private long subBuffer;
|
||||
private boolean recursionBrake = false;;
|
||||
|
||||
@Untested
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
|
||||
if(recursionBrake)
|
||||
return 0;
|
||||
|
||||
if(simulate)
|
||||
return 0;
|
||||
|
||||
recursionBrake = true;
|
||||
|
||||
long capacity = maxReceive / 4L;
|
||||
subBuffer = capacity;
|
||||
|
||||
@ -45,6 +51,8 @@ public class TileEntityConverterRfHe extends TileEntity implements IEnergyGenera
|
||||
this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||
}
|
||||
|
||||
recursionBrake = false;
|
||||
|
||||
return (int) ((capacity - subBuffer) * 4L);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user