aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java6
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java15
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java20
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java27
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java31
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java10
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java17
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java265
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java90
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java87
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java18
18 files changed, 559 insertions, 62 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java
index c252d5f935..44dc931a23 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java
@@ -35,20 +35,20 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer {
public BW_GUIContainer_HeatedWaterPump(Container p_i1072_1_) {
super(p_i1072_1_);
- container = (BW_Container_HeatedWaterPump) p_i1072_1_;
+ this.container = (BW_Container_HeatedWaterPump) p_i1072_1_;
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
+ this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
// this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, 0xffffff);
if (this.container.fuel > 0) {
- this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
+ this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures);
int ik = this.container.maxfuel > 200 ? this.container.maxfuel : 200;
int i1 = ((this.container.fuel * 13) / ik);
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java
index bdffce07ee..788bcb379a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java
@@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
@@ -37,7 +38,7 @@ public class BW_GUIContainer_RadLevel extends GuiContainer {
public BW_GUIContainer_RadLevel(Container p_i1072_1_) {
super(p_i1072_1_);
- container = (BW_Container_RadioHatch) p_i1072_1_;
+ this.container = (BW_Container_RadioHatch) p_i1072_1_;
}
@@ -45,16 +46,16 @@ public class BW_GUIContainer_RadLevel extends GuiContainer {
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor3f(1, 1, 1);
this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_RSC.png"));
- drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165);
+ this.drawTexturedModalRect(this.guiLeft - 79, this.guiTop, 0, 0, 256, 165);
}
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
- int y = 51 + (container.coverage / 2 - 3);
+ int y = 51 + (this.container.coverage / 2 - 3);
int x = -63;
- if (container.coverage != 100 && container.coverage != 0)
- drawRect(x, y, x + 51, y + 1, 0xFF60D82E);
- drawRect(x, 48, x + 51, y, 0xFF8B8B8B);
- this.fontRendererObj.drawString(Byte.toString(container.coverage), 88 - 79, 50, 16448255);
+ if (this.container.coverage != 100 && this.container.coverage != 0)
+ Gui.drawRect(x, y, x + 51, y + 1, 0xFF60D82E);
+ Gui.drawRect(x, 48, x + 51, y, 0xFF8B8B8B);
+ this.fontRendererObj.drawString(Byte.toString(this.container.coverage), 88 - 79, 50, 16448255);
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java
index 34574929db..8f31fc31db 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java
@@ -44,7 +44,7 @@ public class GT_GUIContainer_CircuitProgrammer extends GuiContainer {
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1F, 1F, 1F, 1F);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
- drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_CircuitProgrammer.texture);
+ this.drawTexturedModalRect(this.guiLeft - 79, this.guiTop, 0, 0, 256, 165);
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java
index c1998f4bfe..e672eebe94 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java
@@ -43,8 +43,8 @@ public class GT_GUIContainer_Destructopack extends GuiContainer {
@Override
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
GL11.glColor4f(1F, 1F, 1F, 1F);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
- drawTexturedModalRect(guiLeft, guiTop, 0, 0, 175, 165);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(GT_GUIContainer_Destructopack.texture);
+ this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 175, 165);
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java
index 336c9fab92..540f597051 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java
@@ -46,9 +46,9 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer {
private GT_TileEntity_LESU c;
public GT_GUIContainer_LESU(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), texture.getResourceDomain());
- mContainer = ((GT_Container_LESU) this.inventorySlots);
- c = ((GT_TileEntity_LESU) (this.mContainer.mTileEntity.getMetaTileEntity()));
+ super(new GT_Container_LESU(aInventoryPlayer, aTileEntity), GT_GUIContainer_LESU.texture.getResourceDomain());
+ this.mContainer = ((GT_Container_LESU) this.inventorySlots);
+ this.c = ((GT_TileEntity_LESU) (this.mContainer.mTileEntity.getMetaTileEntity()));
}
@Override
@@ -60,7 +60,7 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer {
this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? String.valueOf(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255);
this.drawString(this.fontRendererObj, "MAX EU/t IN: " + String.valueOf(this.mContainer.mInput), 11, 32, 16448255);
this.drawString(this.fontRendererObj, "EU/t OUT: " + String.valueOf(this.mContainer.mOutput), 11, 40, 16448255);
- this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + String.valueOf(c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255);
+ this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + String.valueOf(this.c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255);
if (c.maxEUStore() >= Long.MAX_VALUE - 1) {
this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB());
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java
index 2ae5bf6317..d214b4b09e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java
@@ -26,6 +26,8 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch;
import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch;
+import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
+import com.github.bartimaeusnek.bartworks.util.BW_Util;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
@@ -45,28 +47,28 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine
super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.MOD_ID + ":textures/GUI/RadHatch.png");
this.mName = "Radio Hatch";
this.mContainer.detectAndSendChanges();
- maxSv = BioVatLogicAdder.RadioHatch.getMaxSv();
+ GT_GUIContainer_RadioHatch.maxSv = BioVatLogicAdder.RadioHatch.getMaxSv();
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) mContainer).teTimer).getLong();
- double maxT = ((GT_Container_RadioHatch) mContainer).mass * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) mContainer).sievert));
+ long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) this.mContainer).teTimer).getLong();
+ double maxT = ((GT_Container_RadioHatch) this.mContainer).mass * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) this.mContainer).sievert));
double rem = maxT - timer % maxT;
this.fontRendererObj.drawString(this.mName, 8, 4, 4210752);
this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/RadHatch.png"));
- if (((GT_Container_RadioHatch) mContainer).mass > 0) {
- GL11.glColor3f(((GT_Container_RadioHatch) mContainer).r / 255f, ((GT_Container_RadioHatch) mContainer).g / 255f, ((GT_Container_RadioHatch) mContainer).b / 255f);
+ if (((GT_Container_RadioHatch) this.mContainer).mass > 0) {
+ GL11.glColor3f(((GT_Container_RadioHatch) this.mContainer).r / 255f, ((GT_Container_RadioHatch) this.mContainer).g / 255f, ((GT_Container_RadioHatch) this.mContainer).b / 255f);
this.drawTexturedModalRect(124, 18, 124, 18, 16, 48);
}
GL11.glColor3f(1f, 1f, 1f);
this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) Math.ceil(48 * (rem / maxT)));
- this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) mContainer).sv)) / (maxSv), 16);
+ this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), 16);
-// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b}));
-// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b}));
-// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b}));
+// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b}));
+// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b}));
+// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b}));
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java
index 76625e06bc..b3fce2c4ac 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java
@@ -80,7 +80,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
private boolean needsVisualUpdate = true;
private byte mGlassTier = 0;
private int mSievert = 0;
-
+ private int mNeededSievert = 0;
public GT_TileEntity_BioVat(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -203,12 +203,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
if (gtRecipe == null)
return false;
- if (!BW_Util.areStacksEqual((ItemStack) gtRecipe.mSpecialItems, itemStack))
+ if (!BW_Util.areStacksEqualOrNull((ItemStack) gtRecipe.mSpecialItems, itemStack))
return false;
int[] conditions = specialValueUnpack(gtRecipe.mSpecialValue);
- if (conditions[2] == 0 ? (this.mSievert < conditions[3] || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0]))
+ this.mNeededSievert = conditions[3];
+
+ if (conditions[2] == 0 ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0]))
return false;
int times = 1;
@@ -494,7 +496,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
height = reCalculateHeight();
if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) {
- if ((!(BW_Util.areStacksEqual(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) {
+ if ((!(BW_Util.areStacksEqualOrNull(aStack, mStack))) || (needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % TIMERDIVIDER == 1)) {
for (int x = -1; x < 2; x++) {
for (int y = 1; y < height; y++) {
for (int z = -1; z < 2; z++) {
@@ -529,8 +531,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
if (height != reCalculateHeight())
needsVisualUpdate = true;
doAllVisualThings();
- if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1)
+ if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) {
this.mSievert = this.mRadHatches.get(0).getSievert();
+ if (this.getBaseMetaTileEntity().isActive() && this.mNeededSievert > this.mSievert)
+ this.mOutputFluids = null;
+ }
}
@Override
@@ -543,6 +548,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
}
if (this.mFluid != null)
aNBT.setString("mFluid", mFluid.getName());
+ aNBT.setInteger("mSievert",this.mSievert);
+ aNBT.setInteger("mNeededSievert",this.mNeededSievert);
super.saveNBTData(aNBT);
}
@@ -580,10 +587,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
@Override
public void loadNBTData(NBTTagCompound aNBT) {
- height = aNBT.getInteger("mFluidHeight");
- mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture"));
+ this.height = aNBT.getInteger("mFluidHeight");
+ this.mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture"));
if (!aNBT.getString("mFluid").isEmpty())
- mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid"));
+ this.mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid"));
+ this.mSievert = aNBT.getInteger("mSievert");
+ this.mNeededSievert = aNBT.getInteger("mNeededSievert");
super.loadNBTData(aNBT);
}
@@ -610,6 +619,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase {
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]};
+ return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GT_TileEntity_BioVat.MCASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[MCASING_INDEX]};
}
} \ No newline at end of file
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java
index 1eab412c16..b88c6209a0 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java
@@ -29,6 +29,8 @@ import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_RadioHatch;
import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch;
import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat;
+import cpw.mods.fml.common.Loader;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -75,13 +77,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch {
public static long calcDecayTicks(int x) {
long ret = 0;
- if (x >= 83 && x <= 100)
- ret = (long) Math.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D);
- else if (x == 43)
+ if (x == 43)
ret = 5000;
else if (x == 61)
ret = 4500;
- else if (x > 100)
+ else if (x <= 100)
+ ret = (long) Math.ceil((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D);
+ else
ret = (long) Math.ceil(((8000D * Math.tanh(-x / 65D) + 8000D)));
return ret;//*20;
}
@@ -170,19 +172,26 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch {
if (lStack == null)
return;
- if (lStack.getItem() instanceof IRadMaterial) {
- IRadMaterial material = ((IRadMaterial) lStack.getItem());
- int sv = material.getRadiationLevel(lStack);
+
+ IRadMaterial radmat = null;
+ //gt++ compat
+ if (Loader.isModLoaded("miscutils"))
+ radmat = RadioHatchCompat.GTppRadChecker(lStack);
+
+ if (lStack.getItem() instanceof IRadMaterial || radmat != null) {
+ if (radmat == null)
+ radmat = ((IRadMaterial) lStack.getItem());
+ int sv = radmat.getRadiationLevel(lStack);
if (sv > BioVatLogicAdder.RadioHatch.getMaxSv())
BioVatLogicAdder.RadioHatch.MaxSV = sv;
if (this.mass == 0 || this.sievert == sv) {
- if (this.mass < this.cap) {
- this.mass = material.getAmountOfMaterial(lStack);
+ if (this.mass + radmat.getAmountOfMaterial(lStack) <= this.cap) {
+ this.mass += radmat.getAmountOfMaterial(lStack);
this.sievert = sv;
this.mInventory[0].stackSize--;
this.updateSlots();
- this.colorForGUI = material.getColorForGUI(lStack);
- this.material = material.getNameForGUI(lStack);
+ this.colorForGUI = radmat.getColorForGUI(lStack);
+ this.material = radmat.getNameForGUI(lStack);
return;
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
index 1f494dffab..662cfbea5a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
@@ -717,7 +717,7 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.getCorresopndingItemStack(dust, werkstoff)
},
new int[]{
- 100, 400, 1500, 2000, 4000, 5000
+ 200, 1000, 2500, 2000, 4000, 5000
},
800,
16
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java
index 1c4ffbb8cb..ebc432d1b5 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java
@@ -23,6 +23,7 @@
package com.github.bartimaeusnek.bartworks.system.oregen;
import com.github.bartimaeusnek.bartworks.MainMod;
+import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE;
import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import gregtech.api.GregTech_API;
@@ -149,10 +150,16 @@ public abstract class BW_OreLayer extends GT_Worldgen {
}
public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) {
+ //security stuff to prevent crashes with 2 TileEntites on the same Spot
+ TileEntity te = aWorld.getTileEntity(aX,aY,aZ);
+ if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores)
+ return true;
+
if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) {
- return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, getDefaultBlockToReplace());
+ return BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace());
}
- return setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, getDefaultBlockToReplace());
+
+ return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace());
}
public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block){
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
index b07c84d493..c380f3399b 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
@@ -560,7 +560,7 @@ public class BWRecipes {
// Check the Recipe which has been used last time in order to not have to search for it again, if possible.
if (aRecipe != null)
- if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) aRecipe.mSpecialItems, aSpecialSlot))
+ if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot))
return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
// Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
@@ -570,12 +570,12 @@ public class BWRecipes {
Collection<GT_Recipe> tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
if (tRecipes != null)
for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot))
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack)));
if (tRecipes != null)
for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot))
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
}
@@ -585,7 +585,7 @@ public class BWRecipes {
if (aFluid != null) {
Collection<GT_Recipe> tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqual((ItemStack) tRecipe.mSpecialItems, aSpecialSlot))
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot))
return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
}
@@ -601,7 +601,7 @@ public class BWRecipes {
if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) {
return null;
} else {
- return aCheckForCollisions && isthere != null && BW_Util.areStacksEqual((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe);
+ return aCheckForCollisions && isthere != null && BW_Util.areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe);
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
index 64ea87132f..f7312eeab2 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
@@ -32,6 +32,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
+import ic2.api.item.IElectricItem;
import net.minecraft.block.Block;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
@@ -50,7 +51,6 @@ public class BW_Util {
public static final int CLEANROOM = -100;
public static final int LOWGRAVITY = -200;
-
public static String subscriptNumbers(String b){
char[] chars = b.toCharArray();
char[] nu = new char[chars.length];
@@ -182,7 +182,7 @@ public class BW_Util {
return 8 << (2*tier);
}
- public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) {
+ public static boolean areStacksEqualOrNull(ItemStack aStack1, ItemStack aStack2) {
return (aStack1 == null && aStack2 == null) || GT_Utility.areStacksEqual(aStack1, aStack2);
}
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
index 65fbb0f6a7..0fb357cdb3 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java
@@ -23,17 +23,17 @@
package com.github.bartimaeusnek.crossmod;
import com.github.bartimaeusnek.bartworks.common.commands.SummonRuin;
+import com.github.bartimaeusnek.crossmod.GTpp.loader.RadioHatchCompat;
import com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy;
import com.github.bartimaeusnek.crossmod.thaumcraft.CustomAspects;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
-import cpw.mods.fml.common.event.FMLInitializationEvent;
-import cpw.mods.fml.common.event.FMLPostInitializationEvent;
-import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import cpw.mods.fml.common.event.FMLServerStartingEvent;
+import cpw.mods.fml.common.event.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import java.util.List;
+
@Mod(
modid = BartWorksCrossmod.MOD_ID, name = BartWorksCrossmod.NAME, version = BartWorksCrossmod.VERSION,
dependencies = "required-after:IC2; "
@@ -42,6 +42,7 @@ import org.apache.logging.log4j.Logger;
+ "after:GalacticraftMars; "
+ "after:GalacticraftCore; "
+ "after:Micdoodlecore; "
+ + "after:miscutils;"
)
public class BartWorksCrossmod {
public static final String NAME = "BartWorks Mod Additions";
@@ -70,8 +71,16 @@ public class BartWorksCrossmod {
public void postInit(FMLPostInitializationEvent init) {
if (Loader.isModLoaded("GalacticraftCore"))
GalacticraftProxy.postInit(init);
+ if (Loader.isModLoaded("miscutils"))
+ new RadioHatchCompat().run();
}
+// @Mod.EventHandler
+// public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){
+// for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){
+// if (mapping.name.equalsIgnoreCase())
+// }
+// }
@Mod.EventHandler
public void onFMLServerStart(FMLServerStartingEvent event) {
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java
new file mode 100644
index 0000000000..2d63cae904
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.crossmod.GTpp