From 6ff8496399f92f20dc29298438fdb87d86e11d68 Mon Sep 17 00:00:00 2001 From: Gregorius Techneticies Date: Mon, 26 Jun 2023 08:08:03 +0200 Subject: [PATCH] Automatic Commit Message for when Greg does not type before hitting Enter. --- .../MultiTileEntityAdvancedCraftingTable.java | 4 ++-- .../java/gregapi/worldgen/WorldgenBlob.java | 21 ++++++++++--------- .../MultiTileEntityReactorCore2x2.java | 19 ++++++++--------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/java/gregapi/tileentity/tools/MultiTileEntityAdvancedCraftingTable.java b/src/main/java/gregapi/tileentity/tools/MultiTileEntityAdvancedCraftingTable.java index d3bf2502b..b5ab37d0f 100644 --- a/src/main/java/gregapi/tileentity/tools/MultiTileEntityAdvancedCraftingTable.java +++ b/src/main/java/gregapi/tileentity/tools/MultiTileEntityAdvancedCraftingTable.java @@ -232,7 +232,7 @@ public ItemStack getCraftingOutput(boolean aAllowCache) { if (!slotHas(SLOTS_CRAFTING[0])) slot(SLOTS_CRAFTING[0], ST.amount(0, slot(tDestination))); break; case 8: - // Because of the original Furnace Recipe. + // Because of the original Furnace and Chest Recipes. if (!slotHas(SLOTS_CRAFTING[8])) slot(SLOTS_CRAFTING[8], ST.amount(0, slot(tDestination))); if (!slotHas(SLOTS_CRAFTING[7])) slot(SLOTS_CRAFTING[7], ST.amount(0, slot(tDestination))); if (!slotHas(SLOTS_CRAFTING[6])) slot(SLOTS_CRAFTING[6], ST.amount(0, slot(tDestination))); @@ -251,7 +251,7 @@ public ItemStack getCraftingOutput(boolean aAllowCache) { if (!slotHas(SLOTS_CRAFTING[0])) slot(SLOTS_CRAFTING[0], ST.amount(0, slot(tDestination))); break; case 6: - // 3x2 because of the original Wall and Trapdoor Recipes. + // 3x2 because of the original Wall and Trapdoor Recipes. if (!slotHas(SLOTS_CRAFTING[5])) slot(SLOTS_CRAFTING[5], ST.amount(0, slot(tDestination))); if (!slotHas(SLOTS_CRAFTING[4])) slot(SLOTS_CRAFTING[4], ST.amount(0, slot(tDestination))); if (!slotHas(SLOTS_CRAFTING[2])) slot(SLOTS_CRAFTING[2], ST.amount(0, slot(tDestination))); diff --git a/src/main/java/gregapi/worldgen/WorldgenBlob.java b/src/main/java/gregapi/worldgen/WorldgenBlob.java index 5b77b00ce..b6e16f1d0 100644 --- a/src/main/java/gregapi/worldgen/WorldgenBlob.java +++ b/src/main/java/gregapi/worldgen/WorldgenBlob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 GregTech-6 Team + * Copyright (c) 2023 GregTech-6 Team * * This file is part of GregTech. * @@ -19,13 +19,6 @@ package gregapi.worldgen; -import static gregapi.data.CS.*; - -import java.util.Collection; -import java.util.List; -import java.util.Random; -import java.util.Set; - import gregapi.util.UT; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -34,6 +27,14 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; +import java.util.Collection; +import java.util.List; +import java.util.Random; +import java.util.Set; + +import static gregapi.data.CS.F; +import static gregapi.data.CS.T; + /** * @author Gregorius Techneticies */ @@ -48,7 +49,7 @@ public WorldgenBlob(String aName, boolean aDefault, Block aBlock, int aBlockMeta super(aName, aDefault, aLists); mBlock = aBlock==null?Blocks.cobblestone:aBlock; mBlockMeta = UT.Code.bind4(aBlockMeta); - mProbability = getConfigFile().get(mCategory, "Probability" , aProbability); + mProbability = Math.max(1, getConfigFile().get(mCategory, "Probability" , aProbability)); mAmount = (int)UT.Code.bind(1, 16, getConfigFile().get(mCategory, "Amount" , aAmount)); mSize = (int)UT.Code.bind(4, 250, getConfigFile().get(mCategory, "Size" , aSize)); mMinY = getConfigFile().get(mCategory, "MinHeight" , aMinY); @@ -64,7 +65,7 @@ public boolean generate(World aWorld, Chunk aChunk, int aDimType, int aMinX, int for (String tName : aBiomeNames) if (mBiomeList.contains(tName)) {temp = F; break;} if (temp) return F; } - if (mProbability <= 1 || aRandom.nextInt(mProbability) == 0) { + if (aRandom.nextInt(mProbability) == 0) { for (int i = 0; i < mAmount; i++) { int tX = aMinX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aMinZ + aRandom.nextInt(16); if (mAllowToGenerateinVoid || !aWorld.getBlock(tX, tY, tZ).isAir(aWorld, tX, tY, tZ)) { diff --git a/src/main/java/gregtech/tileentity/energy/reactors/MultiTileEntityReactorCore2x2.java b/src/main/java/gregtech/tileentity/energy/reactors/MultiTileEntityReactorCore2x2.java index b853305be..e67d17400 100644 --- a/src/main/java/gregtech/tileentity/energy/reactors/MultiTileEntityReactorCore2x2.java +++ b/src/main/java/gregtech/tileentity/energy/reactors/MultiTileEntityReactorCore2x2.java @@ -19,7 +19,6 @@ package gregtech.tileentity.energy.reactors; -import gregapi.data.CS.*; import gregapi.data.FL; import gregapi.data.MT; import gregapi.item.IItemReactorRod; @@ -87,7 +86,7 @@ public void onServerTickPost(boolean aFirst) { tAdjacent = tAdjacents[SIDE_Z_NEG-2]; if (tAdjacent != null) mNeutronCounts[2] += tAdjacent.mTileEntity.getReactorRodNeutronReflection(S0312[tAdjacent.mSideOfTileEntity], tNeutronCount, tModerated); tAdjacent = tAdjacents[SIDE_X_POS-2]; if (tAdjacent != null) mNeutronCounts[2] += tAdjacent.mTileEntity.getReactorRodNeutronReflection(S2103[tAdjacent.mSideOfTileEntity], tNeutronCount, tModerated); } - + tNeutronCount = getReactorRodNeutronEmission(3); tModerated = isReactorRodModerated(3); if (tNeutronCount != 0 || tModerated) { @@ -105,9 +104,9 @@ public void onServerTickPost(boolean aFirst) { updateReactorRodModeration(2); updateReactorRodModeration(3); } - + long tCalc = UT.Code.divup((oNeutronCounts[0] = mNeutronCounts[0]) + (oNeutronCounts[1] = mNeutronCounts[1]) + (oNeutronCounts[2] = mNeutronCounts[2]) + (oNeutronCounts[3] = mNeutronCounts[3]), 256); - + // TODO Raycasting through Lead, Water and similar Blocks. if (tCalc > 0 && SERVER_TIME % 20 == 10) { for (Object tEntity : worldObj.loadedEntityList) if (tEntity instanceof EntityLivingBase) { @@ -115,23 +114,23 @@ public void onServerTickPost(boolean aFirst) { if (tStrength > 0) UT.Entities.applyRadioactivity((EntityLivingBase)tEntity, (int)UT.Code.divup(tStrength, 10), tStrength); } } - + mRunning = (tCalc != 0); - + long tEnergy = mEnergy; - + if (getReactorRodNeutronReaction(0)) mRunning = T; if (getReactorRodNeutronReaction(1)) mRunning = T; if (getReactorRodNeutronReaction(2)) mRunning = T; if (getReactorRodNeutronReaction(3)) mRunning = T; - + int tDivider = 1; if (MT.Na.mLiquid.isFluidEqual(mTanks[0].getFluid())) tDivider = 6; else if (MT.Sn.mLiquid.isFluidEqual(mTanks[0].getFluid())) tDivider = 3; mEnergy = UT.Code.divup(mEnergy - tEnergy, tDivider) + tEnergy; - + oEnergy = mEnergy - tEnergy; - + if (mEnergy > 0) { boolean tIsExploding = F; if (FL.Coolant_IC2.is(mTanks[0])) {