mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
added baby config, fixed cyclotron connectors
This commit is contained in:
parent
62931c71d6
commit
1b54dd566a
@ -27,6 +27,7 @@ public class GeneralConfig {
|
||||
public static boolean enableGuns = true;
|
||||
public static boolean enableVirus = true;
|
||||
public static boolean enableCrosshairs = true;
|
||||
public static boolean enableBabyMode = false;
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
@ -54,5 +55,6 @@ public class GeneralConfig {
|
||||
enableGuns = config.get(CATEGORY_GENERAL, "1.20_enableGuns", true).getBoolean(true);
|
||||
enableVirus = config.get(CATEGORY_GENERAL, "1.21_enableVirus", false).getBoolean(false);
|
||||
enableCrosshairs = config.get(CATEGORY_GENERAL, "1.22_enableCrosshairs", true).getBoolean(true);
|
||||
enableBabyMode = config.get(CATEGORY_GENERAL, "1.23_enableBabyMode", false).getBoolean(false);
|
||||
}
|
||||
}
|
||||
|
||||
25
src/main/java/com/hbm/config/VersatileConfig.java
Normal file
25
src/main/java/com/hbm/config/VersatileConfig.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.hbm.config;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class VersatileConfig {
|
||||
|
||||
public static Item getTransmutatorItem() {
|
||||
|
||||
if(GeneralConfig.enableBabyMode)
|
||||
return ModItems.ingot_schrabidium;
|
||||
|
||||
return ModItems.ingot_schraranium;
|
||||
}
|
||||
|
||||
public static int getSchrabOreChance() {
|
||||
|
||||
if(GeneralConfig.enableBabyMode)
|
||||
return 20;
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
}
|
||||
@ -17,7 +17,7 @@ public class WorldConfig {
|
||||
public static int leadSpawn = 6;
|
||||
public static int berylliumSpawn = 6;
|
||||
public static int ligniteSpawn = 2;
|
||||
public static int asbestosSpawn = 2;
|
||||
public static int asbestosSpawn = 4;
|
||||
|
||||
public static int radioStructure = 500;
|
||||
public static int antennaStructure = 250;
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.entity.effect;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.saveddata.AuxSavedData;
|
||||
|
||||
@ -176,7 +177,7 @@ public class EntityFalloutRain extends Entity {
|
||||
}
|
||||
|
||||
else if (b == ModBlocks.ore_uranium) {
|
||||
if (rand.nextInt(MainRegistry.schrabFromUraniumChance) == 0)
|
||||
if (rand.nextInt(VersatileConfig.getSchrabOreChance()) == 0)
|
||||
worldObj.setBlock(x, y, z, ModBlocks.ore_schrabidium);
|
||||
else
|
||||
worldObj.setBlock(x, y, z, ModBlocks.ore_uranium_scorched);
|
||||
@ -184,7 +185,7 @@ public class EntityFalloutRain extends Entity {
|
||||
}
|
||||
|
||||
else if (b == ModBlocks.ore_nether_uranium) {
|
||||
if (rand.nextInt(MainRegistry.schrabFromUraniumChance) == 0)
|
||||
if (rand.nextInt(VersatileConfig.getSchrabOreChance()) == 0)
|
||||
worldObj.setBlock(x, y, z, ModBlocks.ore_nether_schrabidium);
|
||||
else
|
||||
worldObj.setBlock(x, y, z, ModBlocks.ore_nether_uranium_scorched);
|
||||
|
||||
@ -22,6 +22,7 @@ import net.minecraft.world.WorldSettings.GameType;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.entity.effect.EntityBlackHole;
|
||||
import com.hbm.entity.effect.EntityNukeCloudSmall;
|
||||
import com.hbm.entity.grenade.EntityGrenadeASchrab;
|
||||
@ -467,7 +468,7 @@ public class ExplosionNukeGeneric {
|
||||
}
|
||||
|
||||
else if (b == ModBlocks.ore_uranium) {
|
||||
rand = random.nextInt(MainRegistry.schrabFromUraniumChance);
|
||||
rand = random.nextInt(VersatileConfig.getSchrabOreChance());
|
||||
if (rand == 1) {
|
||||
world.setBlock(x, y, z, ModBlocks.ore_schrabidium);
|
||||
} else {
|
||||
@ -476,7 +477,7 @@ public class ExplosionNukeGeneric {
|
||||
}
|
||||
|
||||
else if (b == ModBlocks.ore_nether_uranium) {
|
||||
rand = random.nextInt(MainRegistry.schrabFromUraniumChance);
|
||||
rand = random.nextInt(VersatileConfig.getSchrabOreChance());
|
||||
if (rand == 1) {
|
||||
world.setBlock(x, y, z, ModBlocks.ore_nether_schrabidium);
|
||||
} else {
|
||||
|
||||
@ -109,6 +109,13 @@ public class MachineRecipes {
|
||||
return new ItemStack(ModItems.ingot_starmetal, 2);
|
||||
}
|
||||
|
||||
if(GeneralConfig.enableBabyMode) {
|
||||
if(mODE(item, new String[] { "gemCoal", "dustCoal" }) && item2.getItem() == ModItems.canister_empty
|
||||
|| item.getItem() == ModItems.canister_empty && mODE(item2, new String[] { "gemCoal", "dustCoal" })) {
|
||||
return new ItemStack(ModItems.canister_oil );
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -754,6 +761,12 @@ public class MachineRecipes {
|
||||
getFurnaceOutput(new ItemStack(ModItems.ingot_steel), new ItemStack(ModItems.ingot_cobalt)).copy());
|
||||
recipes.put(new ItemStack[] { new ItemStack(ModItems.ingot_saturnite), new ItemStack(ModItems.powder_meteorite) },
|
||||
getFurnaceOutput(new ItemStack(ModItems.ingot_saturnite), new ItemStack(ModItems.powder_meteorite)).copy());
|
||||
|
||||
if(GeneralConfig.enableBabyMode) {
|
||||
recipes.put(new ItemStack[] { new ItemStack(ModItems.canister_empty), new ItemStack(Items.coal) },
|
||||
getFurnaceOutput(new ItemStack(ModItems.canister_empty), new ItemStack(Items.coal)).copy());
|
||||
}
|
||||
|
||||
} catch (Exception x) {
|
||||
MainRegistry.logger.error("Unable to register alloy recipes for NEI!");
|
||||
}
|
||||
@ -1787,8 +1800,12 @@ public class MachineRecipes {
|
||||
input[0] = new FluidStack(1800, FluidType.COOLANT);
|
||||
break;
|
||||
case DESH:
|
||||
input[0] = new FluidStack(200, FluidType.MERCURY);
|
||||
input[1] = new FluidStack(200, FluidType.LIGHTOIL);
|
||||
if(GeneralConfig.enableBabyMode) {
|
||||
input[0] = new FluidStack(200, FluidType.LIGHTOIL);
|
||||
} else {
|
||||
input[0] = new FluidStack(200, FluidType.MERCURY);
|
||||
input[1] = new FluidStack(200, FluidType.LIGHTOIL);
|
||||
}
|
||||
break;
|
||||
case PEROXIDE:
|
||||
input[0] = new FluidStack(1000, FluidType.WATER);
|
||||
|
||||
@ -229,19 +229,9 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
int randPosY = rand.nextInt(16) + 16;
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(ModBlocks.ore_asbestos, 3)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
(new WorldGenMinable(ModBlocks.ore_asbestos, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
|
||||
/*if (MainRegistry.enableBarrels && rand.nextInt(5) == 0) {
|
||||
for (int k = 0; k < 1; k++) {
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(25);
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(ModBlocks.yellow_barrel, 10)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
}*/
|
||||
|
||||
if (GeneralConfig.enableDungeons) {
|
||||
|
||||
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, j);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.main;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
@ -1626,6 +1627,24 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wood_gavel, 1), new Object[] { "SWS", " R ", " R ", 'S', "slabWood", 'W', "logWood", 'R', "stickWood" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.lead_gavel, 1), new Object[] { "PIP", "IGI", "PIP", 'P', ModItems.pellet_buckshot, 'I', "ingotLead", 'G', ModItems.wood_gavel }));
|
||||
|
||||
if(GeneralConfig.enableBabyMode) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.cordite, 3), new Object[] { ModItems.ballistite, Items.gunpowder, new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.ingot_semtex, 3), new Object[] { Items.slime_ball, Blocks.tnt, ModItems.niter });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.canister_fuel, 1), new Object[] { ModItems.canister_oil, Items.redstone });
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_iron, 4), new Object[] { "##", "##", '#', "ingotIron" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_gold, 4), new Object[] { "##", "##", '#', "ingotGold" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_aluminium, 4), new Object[] { "##", "##", '#', "ingotAluminum" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_titanium, 4), new Object[] { "##", "##", '#', "ingotTitanium" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_copper, 4), new Object[] { "##", "##", '#', "ingotCopper" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_lead, 4), new Object[] { "##", "##", '#', "ingotLead" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_steel, 4), new Object[] { "##", "##", '#', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_schrabidium, 4), new Object[] { "##", "##", '#', "ingotSchrabidium" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_advanced_alloy, 4), new Object[] { "##", "##", '#', ModItems.ingot_advanced_alloy });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_saturnite, 4), new Object[] { "##", "##", '#', ModItems.ingot_saturnite });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plate_combine_steel, 4), new Object[] { "##", "##", '#', ModItems.ingot_combine_steel });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.neutron_reflector, 4), new Object[] { "##", "##", '#', "ingotTungsten" }));
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddSmeltingRec()
|
||||
|
||||
@ -180,8 +180,6 @@ public class MainRegistry {
|
||||
public static Achievement horizonsEnd;
|
||||
public static Achievement horizonsBonus;
|
||||
|
||||
public static final int schrabFromUraniumChance = 100;
|
||||
|
||||
public static int generalOverride = 0;
|
||||
public static int polaroidID = 1;
|
||||
|
||||
@ -209,7 +207,6 @@ public class MainRegistry {
|
||||
|
||||
ModBlocks.mainRegistry();
|
||||
ModItems.mainRegistry();
|
||||
CraftingManager.mainRegistry();
|
||||
proxy.registerRenderInfo();
|
||||
HbmWorld.mainRegistry();
|
||||
GameRegistry.registerFuelHandler(new FuelHandler());
|
||||
@ -218,6 +215,8 @@ public class MainRegistry {
|
||||
CellularDungeonFactory.init();
|
||||
Satellite.register();
|
||||
VersionChecker.checkVersion();
|
||||
loadConfig(PreEvent);
|
||||
CraftingManager.mainRegistry();
|
||||
AssemblerRecipes.preInit(PreEvent.getModConfigurationDirectory());
|
||||
|
||||
Library.superuser.add("192af5d7-ed0f-48d8-bd89-9d41af8524f8");
|
||||
@ -1135,6 +1134,9 @@ public class MainRegistry {
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(new ModEventHandler());
|
||||
MinecraftForge.ORE_GEN_BUS.register(new ModEventHandler());
|
||||
PacketDispatcher.registerPackets();
|
||||
}
|
||||
|
||||
private void loadConfig(FMLPreInitializationEvent event) {
|
||||
|
||||
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
|
||||
config.load();
|
||||
|
||||
@ -13,6 +13,7 @@ import com.hbm.explosion.ExplosionParticle;
|
||||
import com.hbm.explosion.ExplosionParticleB;
|
||||
import com.hbm.explosion.ExplosionThermo;
|
||||
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.CyclotronRecipes;
|
||||
@ -28,7 +29,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMachineCyclotron extends TileEntityMachineBase implements IFluidSource, IFluidAcceptor {
|
||||
public class TileEntityMachineCyclotron extends TileEntityMachineBase implements IFluidSource, IFluidAcceptor, IConsumer {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000;
|
||||
@ -441,4 +442,19 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
||||
if(stack != null && i >= 14 && i <= 15 && stack.getItem() instanceof ItemMachineUpgrade)
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, "hbm:item.upgradePlug", 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
this.power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return this.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return this.maxPower;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.machine.MachineReactor;
|
||||
import com.hbm.inventory.BreederRecipes;
|
||||
import com.hbm.inventory.BreederRecipes.BreederRecipe;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -125,7 +126,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
|
||||
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_schraranium
|
||||
&& (slots[1] == null || (slots[1] != null && slots[1].getItem() == VersatileConfig.getTransmutatorItem()
|
||||
&& slots[1].stackSize < slots[1].getMaxStackSize()))) {
|
||||
return true;
|
||||
}
|
||||
@ -150,7 +151,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
|
||||
}
|
||||
|
||||
if (slots[1] == null) {
|
||||
slots[1] = new ItemStack(ModItems.ingot_schraranium);
|
||||
slots[1] = new ItemStack(VersatileConfig.getTransmutatorItem());
|
||||
} else {
|
||||
slots[1].stackSize++;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user