combination recipe adjustments, added back older coke recipes, fixes

This commit is contained in:
Bob 2022-12-10 16:25:32 +01:00
parent a218206f80
commit 8ab33835d2
13 changed files with 102 additions and 20 deletions

View File

@ -31,6 +31,7 @@ public class WorldConfig {
public static int cobaltSpawn = 2;
public static int oilSpawn = 100;
public static int bedrockOilSpawn = 200;
public static int meteoriteSpawn = 500;
public static int ironClusterSpawn = 4;
public static int titaniumClusterSpawn = 2;
@ -121,6 +122,7 @@ public class WorldConfig {
alexandriteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.20_alexandriteSpawnRate", "Spawns an alexandrite vein every nTH chunk", 100);
oilSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.21_oilSpawnRate", "Spawns an oil bubble every nTH chunk", 100);
bedrockOilSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.22_bedrockOilSpawnRate", "Spawns a bedrock oil node every nTH chunk", 200);
meteoriteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.23_meteoriteSpawnRate", "Spawns a fallen meteorite every nTH chunk", 200);
ironClusterSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.C00_ironClusterSpawn", "Amount of iron cluster veins per chunk", 4);
titaniumClusterSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.C01_titaniumClusterSpawn", "Amount of titanium cluster veins per chunk", 2);

View File

@ -59,6 +59,15 @@ public class SmeltingRecipes {
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_australium), new ItemStack(ModItems.nugget_australium), 2.5F);
GameRegistry.addSmelting(ModItems.powder_australium, new ItemStack(ModItems.ingot_australium), 5.0F);
/* in-furnace coking didn't need to be removed since combination coking is already better in every way */
//GameRegistry.addSmelting(ModItems.powder_coal, DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), 1.0F);
GameRegistry.addSmelting(ModItems.coal_infernal, DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), 0.5F);
GameRegistry.addSmelting(ModItems.briquette_lignite, DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), 1.0F);
GameRegistry.addSmelting(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE), DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), 1.0F);
GameRegistry.addSmelting(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK), DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), 1.0F);
GameRegistry.addSmelting(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.COAL), DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), 1.0F);
GameRegistry.addSmelting(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WOOD), DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), 1.0F);
GameRegistry.addSmelting(ModItems.powder_lead, new ItemStack(ModItems.ingot_lead), 1.0F);
GameRegistry.addSmelting(ModItems.powder_neptunium, new ItemStack(ModItems.ingot_neptunium), 1.0F);
GameRegistry.addSmelting(ModItems.powder_polonium, new ItemStack(ModItems.ingot_polonium), 1.0F);

View File

@ -12,6 +12,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class EntityMeteor extends Entity {
public boolean safe = false;
public EntityMeteor(World p_i1582_1_) {
super(p_i1582_1_);
@ -40,7 +42,7 @@ public class EntityMeteor extends Entity {
if(!this.worldObj.isRemote && this.onGround && this.posY < 260) {
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), true);
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), !safe);
if(WorldConfig.enableMeteorTails) {
ExplosionLarge.spawnParticles(worldObj, posX, posY + 5, posZ, 75);
ExplosionLarge.spawnParticles(worldObj, posX + 5, posY, posZ, 75);
@ -49,7 +51,7 @@ public class EntityMeteor extends Entity {
ExplosionLarge.spawnParticles(worldObj, posX, posY, posZ - 5, 75);
}
(new Meteorite()).generate(worldObj, rand, (int) Math.round(this.posX - 0.5D), (int) Math.round(this.posY - 0.5D), (int) Math.round(this.posZ - 0.5D));
(new Meteorite()).generate(worldObj, rand, (int) Math.round(this.posX - 0.5D), (int) Math.round(this.posY - 0.5D), (int) Math.round(this.posZ - 0.5D), safe, true);
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "hbm:entity.oldExplosion", 10000.0F, 0.5F + this.rand.nextFloat() * 0.1F);
this.setDead();
}
@ -90,8 +92,12 @@ public class EntityMeteor extends Entity {
protected void entityInit() { }
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { }
protected void readEntityFromNBT(NBTTagCompound nbt) {
this.safe = nbt.getBoolean("safe");
}
@Override
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { }
protected void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setBoolean("safe", safe);
}
}

View File

@ -180,8 +180,7 @@ public class BossSpawnHandler {
repell = true;
}
if(mod.getItem() == ModItems.meteor_charm) {
repell = true;
strike = meteorRand.nextInt(4) == 0;
strike = false;
}
}
}
@ -216,6 +215,7 @@ public class BossSpawnHandler {
vec = Vec3.createVectorHelper(meteor.posX - player.posX, 0, meteor.posZ - player.posZ).normalize();
vec.xCoord = vec.xCoord * meteorRand.nextDouble() - 0.5D;
vec.zCoord = vec.zCoord * meteorRand.nextDouble() - 0.5D;
meteor.safe = true;
} else {
vec = Vec3.createVectorHelper(meteorRand.nextDouble() - 0.5D, 0, 0);
vec.rotateAroundY((float) (Math.PI * meteorRand.nextDouble()));

View File

@ -32,13 +32,16 @@ public class CombinationRecipes {
recipes.put(new ComparableStack(ModItems.briquette_lignite), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), new FluidStack(Fluids.COALCREOSOTE, 100)));
recipes.put(CINNABAR.crystal(), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.MERCURY, 100)));
recipes.put(KEY_LOG, new Pair(new ItemStack(Items.coal, 1 ,1), new FluidStack(Fluids.WOODOIL, 250)));
recipes.put(KEY_LOG, new Pair(new ItemStack(Items.coal, 1 ,1), new FluidStack(Fluids.WOODOIL, 250)));
recipes.put(KEY_SAPLING, new Pair(null, new FluidStack(Fluids.WOODOIL, 50)));
recipes.put(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), null));
recipes.put(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), null));
recipes.put(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.COAL), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), null));
recipes.put(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WOOD), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), null));
recipes.put(new ComparableStack(Items.reeds), new Pair(new ItemStack(Items.sugar, 2), new FluidStack(Fluids.ETHANOL, 50)));
}
public static Pair<ItemStack, FluidStack> getOutput(ItemStack stack) {

View File

@ -283,6 +283,15 @@ public class AnvilRecipes {
new ComparableStack(ModBlocks.steel_grate, 16)
}, new AnvilOutput(new ItemStack(ModBlocks.furnace_steel))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {
new ComparableStack(Blocks.stonebrick, 8),
new OreDictStack(KEY_LOG, 16),
new OreDictStack(CU.ingot(), 8),
new OreDictStack(KEY_BRICK, 16),
new ComparableStack(Items.blaze_powder, 4)
}, new AnvilOutput(new ItemStack(ModBlocks.furnace_combination))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {
new OreDictStack(KEY_PLANKS, 16),

View File

@ -21,13 +21,14 @@ public class ItemModCharm extends ItemArmorMod {
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add(EnumChatFormatting.AQUA + "You feel blessed.");
list.add(EnumChatFormatting.AQUA + "Diverts meteors away from the player.");
if(this == ModItems.protection_charm) {
list.add(EnumChatFormatting.AQUA + "Diverts meteors away from the player.");
list.add(EnumChatFormatting.AQUA + "Meteors no longer destroy blocks.");
list.add(EnumChatFormatting.AQUA + "Halves broadcaster damage");
}
if(this == ModItems.meteor_charm) {
list.add(EnumChatFormatting.AQUA + "Reduces meteor spawning by 75%.");
list.add(EnumChatFormatting.AQUA + "Disables meteorite spawning.");
list.add(EnumChatFormatting.AQUA + "Negates broadcaster damage");
}

View File

@ -32,6 +32,7 @@ import com.hbm.world.feature.DepthDeposit;
import com.hbm.world.feature.Dud;
import com.hbm.world.feature.Geyser;
import com.hbm.world.feature.GeyserLarge;
import com.hbm.world.feature.Meteorite;
import com.hbm.world.feature.OilBubble;
import com.hbm.world.feature.OilSandBubble;
import com.hbm.world.feature.OilSpot;
@ -607,6 +608,13 @@ public class HbmWorldGen implements IWorldGenerator {
OilSpot.generateOilSpot(world, randPosX, randPosZ, 5, 50);
}
if(WorldConfig.meteoriteSpawn > 0 && rand.nextInt(WorldConfig.meteoriteSpawn) == 0) {
int x = i + rand.nextInt(16);
int z = j + rand.nextInt(16);
int y = world.getHeightValue(x, z) - rand.nextInt(10);
(new Meteorite()).generate(world, rand, x, y, z, false, true);
}
if (GeneralConfig.enableNITAN) {
if (i <= 10000 && i + 16 >= 10000 && j <= 10000 && j + 16 >= 10000) {

View File

@ -210,6 +210,18 @@ public class TileEntityFurnaceCombination extends TileEntityMachineBase implemen
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
return i == 1;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.tank.readFromNBT(nbt, "tank");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
this.tank.writeToNBT(nbt, "tank");
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {

View File

@ -60,7 +60,7 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
int power = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
this.processTime = processTimeBase - (processTimeBase / 4) * speed;
this.usage = usageBase - (usageBase / 4) * speed / (power + 1);
this.usage = (usageBase + (usageBase * speed)) / (power + 1);
if(this.canProcess())
this.process();

View File

@ -57,7 +57,7 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
int power = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
this.processTime = processTimeBase - (processTimeBase / 4) * speed;
this.usage = usageBase - (usageBase / 4) * speed;
this.usage = (usageBase + (usageBase * speed)) / (power + 1);
if(this.canProcess())
this.process();

View File

@ -1,6 +1,7 @@
package com.hbm.world.feature;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
@ -14,14 +15,20 @@ import com.hbm.lib.ModDamageSource;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class Meteorite {
public static boolean safeMode = false;
public void generate(World world, Random rand, int x, int y, int z) {
public void generate(World world, Random rand, int x, int y, int z, boolean safe, boolean allowSpecials) {
safeMode = safe;
if(replacables.isEmpty()) {
generateReplacables();
}
List<Entity> list = (List<Entity>) world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(x - 7.5, y - 7.5, z - 7.5, x + 7.5, y + 7.5, z + 7.5));
@ -29,7 +36,7 @@ public class Meteorite {
e.attackEntityFrom(ModDamageSource.meteorite, 1000);
}
if(WorldConfig.enableSpecialMeteors)
if(WorldConfig.enableSpecialMeteors && allowSpecials)
switch(rand.nextInt(300)) {
case 0:
// Meteor-only tiny meteorite
@ -43,7 +50,7 @@ public class Meteorite {
list1.addAll(this.getRandomOre(rand));
int i = list1.size();
for(int j = 0; j < i; j++)
list1.add(new ItemStack(Blocks.stone));
list1.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere7x7(world, rand, x, y, z, list1);
return;
case 2:
@ -52,7 +59,7 @@ public class Meteorite {
list2.addAll(this.getRandomOre(rand));
int k = list2.size() / 2;
for(int j = 0; j < k; j++)
list2.add(new ItemStack(Blocks.stone));
list2.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere5x5(world, rand, x, y, z, list2);
return;
case 3:
@ -63,7 +70,7 @@ public class Meteorite {
return;
case 4:
// Bamboozle
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 15F, true);
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 15F, !safe);
ExplosionLarge.spawnRubble(world, x, y, z, 25);
return;
case 5:
@ -113,11 +120,11 @@ public class Meteorite {
case 11:
// Atomic meteorite
ExplosionNukeSmall.explode(world, x + 0.5, y + 0.5, z + 0.5, ExplosionNukeSmall.medium);
ExplosionNukeSmall.explode(world, x + 0.5, y + 0.5, z + 0.5, safe ? ExplosionNukeSmall.safe : ExplosionNukeSmall.medium);
return;
case 12:
// Star Blaster
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 10F, true);
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 10F, !safe);
ItemStack stack = new ItemStack(ModItems.gun_b92);
stack.setStackDisplayName("§9Star Blaster§r");
EntityItem blaster = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack);
@ -711,8 +718,33 @@ public class Meteorite {
private void setBlock(World world, int x, int y, int z, Block b, int meta, int flag) {
Block target = world.getBlock(x, y, z);
if(safeMode) {
if(!target.isReplaceable(world, x, y, z) && !replacables.contains(target)) return;
}
float hardness = target.getBlockHardness(world, x, y, z);
if(hardness != -1 && hardness < 10_000)
world.setBlock(x, y, z, b, meta, flag);
}
public static HashSet<Block> replacables = new HashSet();
public static void generateReplacables() {
replacables.add(ModBlocks.block_meteor);
replacables.add(ModBlocks.block_meteor_broken);
replacables.add(ModBlocks.block_meteor_cobble);
replacables.add(ModBlocks.block_meteor_molten);
replacables.add(ModBlocks.block_meteor_treasure);
replacables.add(ModBlocks.ore_meteor_uranium);
replacables.add(ModBlocks.ore_meteor_thorium);
replacables.add(ModBlocks.ore_meteor_titanium);
replacables.add(ModBlocks.ore_meteor_sulfur);
replacables.add(ModBlocks.ore_meteor_copper);
replacables.add(ModBlocks.ore_meteor_tungsten);
replacables.add(ModBlocks.ore_meteor_aluminium);
replacables.add(ModBlocks.ore_meteor_lead);
replacables.add(ModBlocks.ore_meteor_lithium);
replacables.add(ModBlocks.ore_meteor_starmetal);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB