From 11e113df5daeecefba50dfae147588d3adb883e8 Mon Sep 17 00:00:00 2001 From: Bob Date: Mon, 28 Jun 2021 19:22:29 +0200 Subject: [PATCH] fixed all the function mess --- .../hbm/entity/effect/EntityFalloutRain.java | 5 ++-- src/main/java/com/hbm/items/ModItems.java | 14 ++++----- .../com/hbm/items/machine/ItemRBMKRod.java | 30 +++++++++---------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java index e269688fd..ef7f89280 100644 --- a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java +++ b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java @@ -93,14 +93,15 @@ public class EntityFalloutRain extends Entity { int depth = 0; for(int y = 255; y >= 0; y--) { - + Block b = worldObj.getBlock(x, y, z); + Block ab = worldObj.getBlock(x, y + 1, z); int meta = worldObj.getBlockMetadata(x, y, z); if(b.getMaterial() == Material.air) continue; - if(b != ModBlocks.fallout && (worldObj.getBlock(x, y + 1, z) == Blocks.air || worldObj.getBlock(x, y + 1, z).isReplaceable(worldObj, x, y + 1, z))) { + if(b != ModBlocks.fallout && (ab == Blocks.air || (ab.isReplaceable(worldObj, x, y + 1, z) && !ab.getMaterial().isLiquid()))) { double d = (double) radProgress / (double) getScale() * 0.5; diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 1163546d1..32e2b2d47 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -3465,10 +3465,10 @@ public class ModItems { .setMeltingPoint(5211).setUnlocalizedName("rbmk_fuel_heaus").setTextureName(RefStrings.MODID + ":rbmk_fuel_heaus"); rbmk_fuel_po210be = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_po210be) .setYield(100000000D) - .setStats(70, 50) + .setStats(20, 40) .setFunction(EnumBurnFunc.SQUARE_ROOT) - .setHeat(0.5D) - .setDiffusion(0.2D) + .setHeat(0.1D) + .setDiffusion(0.05D) .setMeltingPoint(1287) .addRadiation(ItemHazard.pobe * ItemHazard.rod_rbmk).toItem() .setUnlocalizedName("rbmk_fuel_po210be").setTextureName(RefStrings.MODID + ":rbmk_fuel_po210be"); @@ -3483,10 +3483,10 @@ public class ModItems { .setUnlocalizedName("rbmk_fuel_ra226be").setTextureName(RefStrings.MODID + ":rbmk_fuel_ra226be"); rbmk_fuel_pu238be = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_pu238be) .setYield(100000000D) - .setStats(60, 35) - .setFunction(EnumBurnFunc.PLATEU) - .setHeat(0.5D) - .setDiffusion(0.2D) + .setStats(40, 35) + .setFunction(EnumBurnFunc.SQUARE_ROOT) + .setHeat(0.1D) + .setDiffusion(0.05D) .setMeltingPoint(1287) .addRadiation(ItemHazard.pube * ItemHazard.rod_rbmk).toItem() .setUnlocalizedName("rbmk_fuel_pu238be").setTextureName(RefStrings.MODID + ":rbmk_fuel_pu238be"); diff --git a/src/main/java/com/hbm/items/machine/ItemRBMKRod.java b/src/main/java/com/hbm/items/machine/ItemRBMKRod.java index 25673f222..f4dd83ba0 100644 --- a/src/main/java/com/hbm/items/machine/ItemRBMKRod.java +++ b/src/main/java/com/hbm/items/machine/ItemRBMKRod.java @@ -234,13 +234,13 @@ public class ItemRBMKRod extends Item implements IItemHazard { switch(this.function) { case PASSIVE: return selfRate * enrichment; - case LOG_TEN: return Math.log10(flux + 1) * 0.1D * reactivity; - case PLATEU: return (1 - Math.pow(Math.E, -flux / 25D)) * 100D * reactivity; - case ARCH: return flux - (flux * flux / 1000D) * reactivity; - case SIGMOID: return 100D / (1 + Math.pow(Math.E, -(flux - 50D) / 10D)) * reactivity; - case SQUARE_ROOT: return Math.sqrt(flux) * reactivity; + case LOG_TEN: return Math.log10(flux + 1) * 0.5D * reactivity; + case PLATEU: return (1 - Math.pow(Math.E, -flux / 25D)) * reactivity; + case ARCH: return Math.max(flux - (flux * flux / 100000D) * reactivity, 0D); + case SIGMOID: return reactivity / (1 + Math.pow(Math.E, -(flux - 50D) / 10D)); + case SQUARE_ROOT: return Math.sqrt(flux) * reactivity / 10D; case LINEAR: return flux / 100D * reactivity; - case QUADRATIC: return flux * flux / 100D * reactivity; + case QUADRATIC: return flux * flux / 10000D * reactivity; } return 0; @@ -255,13 +255,13 @@ public class ItemRBMKRod extends Item implements IItemHazard { switch(this.function) { case PASSIVE: return EnumChatFormatting.RED + "" + selfRate; - case LOG_TEN: return "log10(x + 1" + (selfRate > 0 ? (EnumChatFormatting.RED + " + " + selfRate) : "") + EnumChatFormatting.WHITE + ") * " + reactivity; - case PLATEU: return "(1 - e^-" + x + " / 25)) * 100 * " + reactivity; - case ARCH: return "(" + x + " - " + x + "² / 1000) * " + reactivity; - case SIGMOID: return "100 / (1 + e^(-(" + x + " - 50) / 10) * " + reactivity; - case SQUARE_ROOT: return "sqrt(" + x + ") * " + reactivity; + case LOG_TEN: return "log10(x + 1" + (selfRate > 0 ? (EnumChatFormatting.RED + " + " + selfRate) : "") + EnumChatFormatting.WHITE + ") * 0.5 * " + reactivity; + case PLATEU: return "(1 - e^-" + x + " / 25)) * " + reactivity; + case ARCH: return "(" + x + " - " + x + "² / 100000) * " + reactivity + " [0;∞]"; + case SIGMOID: return reactivity + " / (1 + e^(-(" + x + " - 50) / 10)"; + case SQUARE_ROOT: return "sqrt(" + x + ") * " + reactivity + " / 10"; case LINEAR: return x + " / 100 * " + reactivity; - case QUADRATIC: return x + "² / 100 * " + reactivity; + case QUADRATIC: return x + "² / 10000 * " + reactivity; } return "ERROR"; @@ -308,7 +308,7 @@ public class ItemRBMKRod extends Item implements IItemHazard { if(this == ModItems.rbmk_fuel_drx) { - if(selfRate > 0) { + if(selfRate > 0 || this.function == EnumBurnFunc.SIGMOID) { list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmx.source")); } @@ -327,8 +327,8 @@ public class ItemRBMKRod extends Item implements IItemHazard { list.add(EnumChatFormatting.DARK_RED + I18nUtil.resolveKey("trait.rbmx.melt", meltingPoint + "m")); } else { - - if(selfRate > 0) { + + if(selfRate > 0 || this.function == EnumBurnFunc.SIGMOID) { list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmk.source")); }