aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java20
-rw-r--r--src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java38
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java25
4 files changed, 37 insertions, 47 deletions
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
index fabd9432ac..20dbccf2cb 100644
--- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
+++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
@@ -25,8 +25,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.util.MathHelper;
-import java.util.Collection;
-import java.util.List;
+import java.util.*;
public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 {
public static GT_MetaGenerated_Item_01 INSTANCE;
@@ -861,7 +860,11 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 {
GT_Values.RA.addAssemblerRecipe(ItemList.Emitter_MV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Aluminium, 1L), ItemList.Cover_NeedsMaintainance.get(1L, new Object[0]), 600, 24);
}
- private static boolean bw = Loader.isModLoaded("bartworks");
+ private static final Map<Materials,Materials> cauldronRemap =new HashMap<>();
+
+ public static void registerCauldronCleaningFor(Materials in,Materials out){
+ cauldronRemap.put(in,out);
+ }
public boolean onEntityItemUpdate(EntityItem aItemEntity) {
int aDamage = aItemEntity.getEntityItem().getItemDamage();
@@ -877,16 +880,7 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 {
byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ);
if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) {
- if (bw) {
- if (aMaterial == Materials.Osmium)
- aMaterial = GT_BartWorks_Compat.getBartWorksMaterialByIGNName("Rarest Metal Residue");
- else if (aMaterial == Materials.Iridium)
- aMaterial = GT_BartWorks_Compat.getBartWorksMaterialByIGNName("Iridium Metal Residue");
- else if (aMaterial == Materials.Platinum)
- aMaterial = GT_BartWorks_Compat.getBartWorksMaterialByIGNName("Platinum Metallic Powder");
- else if (aMaterial == Materials.Palladium)
- aMaterial = GT_BartWorks_Compat.getBartWorksMaterialByIGNName("Palladium Metallic Powder");
- }
+ aMaterial= cauldronRemap.getOrDefault(aMaterial,aMaterial);
aItemEntity.setEntityItemStack(GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize));
aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3);
diff --git a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java
index 4085a24190..06c186d127 100644
--- a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java
+++ b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java
@@ -15,7 +15,6 @@ import org.lwjgl.opengl.GL11;
@SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
public class GT_FluidDisplayStackRenderer implements IItemRenderer {
- private static final float smallTextScale = 0.5f;
public GT_FluidDisplayStackRenderer() {
MinecraftForgeClient.registerItemRenderer(ItemList.Display_Fluid.getItem(), this);
@@ -41,25 +40,14 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer {
if (item == null || item.getItem() == null || !(item.getItem() instanceof GT_FluidDisplayItem))
return;
- Tessellator tess = Tessellator.instance;
- GL11.glPushMatrix();
- GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
-
- int l = item.getItem().getColorFromItemStack(item, 0);
- float f3 = (float)(l >> 16 & 255) / 255.0F;
- float f4 = (float)(l >> 8 & 255) / 255.0F;
- float f = (float)(l & 255) / 255.0F;
- GL11.glColor4f(f3, f4, f, 1.0F);
-
- GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
IIcon icon = item.getItem().getIconFromDamage(item.getItemDamage());
- tess.startDrawingQuads();
+ Tessellator tess = Tessellator.instance;
+ tess.startDrawingQuads();
// draw a simple rectangle for the inventory icon
final float x_min = icon.getMinU();
final float x_max = icon.getMaxU();
@@ -71,12 +59,6 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer {
tess.addVertexWithUV( 0, 0, 0, x_min, y_min);
tess.draw();
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glDisable(GL11.GL_ALPHA_TEST);
- GL11.glDisable(GL11.GL_BLEND);
-
- GL11.glPopMatrix();
-
if(item.getTagCompound() == null)
return;
@@ -91,22 +73,20 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer {
int exp = (int) (Math.log(fluidAmount) / Math.log(1000));
double shortAmount = fluidAmount / Math.pow(1000, exp);
if ( shortAmount >= 100) {
- amountString = String.format("%.0f%cL", shortAmount, "kMGT".charAt(exp - 1));
+ amountString = String.format("%.0f%cL", shortAmount, "kMGTPE".charAt(exp - 1)); //heard it here first, PetaLiters
} else if ( shortAmount >= 10) {
- amountString = String.format("%.1f%cL", shortAmount, "kMGT".charAt(exp - 1));
+ amountString = String.format("%.1f%cL", shortAmount, "kMGTPE".charAt(exp - 1));
} else {
- amountString = String.format("%.2f%cL", shortAmount, "kMGT".charAt(exp - 1));
+ amountString = String.format("%.2f%cL", shortAmount, "kMGTPE".charAt(exp - 1));
}
}
FontRenderer fontRender = Minecraft.getMinecraft().fontRenderer;
- GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glDisable(GL11.GL_DEPTH_TEST);
+ float smallTextScale = fontRender.getUnicodeFlag() ? 3F/4F : 1F/2F;
GL11.glDisable(GL11.GL_BLEND);
- GL11.glScalef(smallTextScale, smallTextScale, smallTextScale); //TODO: how to make this pretty at all scales?
- fontRender.drawString( amountString, 0, 16*2 - fontRender.FONT_HEIGHT + 1, 0xFFFFFF, true);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glScalef(smallTextScale, smallTextScale, 1.0f);
+
+ fontRender.drawString( amountString, 0, (int) (16/smallTextScale) - fontRender.FONT_HEIGHT + 1, 0xFFFFFF, true);
}
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
index c135740096..938c2d6900 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
@@ -77,6 +77,7 @@ public class GT_MetaTileEntity_Boxinator
//In case recipe is too OP for that machine
if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+ return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
}
}
return DID_NOT_FIND_RECIPE;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
index d6e31418f5..b57f0396a8 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
@@ -71,7 +71,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas
int mGlassCount = 0;
boolean doorState = false;
this.mUpdate = 100;
-
+
if (debugCleanroom) {
GT_Log.out.println(
"Cleanroom: Checking machine"
@@ -83,13 +83,25 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas
if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) {
if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) {
x = i;
+ break;
+ } else {
+ if (debugCleanroom) {
+ GT_Log.out.println("Cleanroom: Unable to detect room X edge?");
+ }
+ return false;
+ }
+ }
+ }
+ for (int i = 1; i < 8; i++) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(0, 0, i);
+ int tMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 0, i);
+ if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) {
+ if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) {
z = i;
break;
} else {
if (debugCleanroom) {
- GT_Log.out.println(
- "Cleanroom: Unable to detect room edge?"
- );
+ GT_Log.out.println("Cleanroom: Unable to detect room Z edge?");
}
return false;
}
@@ -147,7 +159,10 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas
if ((!this.addMaintenanceToMachineList(tTileEntity, 82)) && (!this.addEnergyInputToMachineList(tTileEntity, 82))) {
if (tBlock instanceof ic2.core.block.BlockIC2Door) {
if ((tMeta & 8) == 0) {
- doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0);
+ if (Math.abs(dY) < y) //x - side
+ doorState = (tMeta & 0x5) == 0x4 || (tMeta & 0x5) == 0x1;
+ else if (Math.abs(dX) < x) //y-side, corners ignored.
+ doorState = (tMeta & 0x5) == 0x5 || (tMeta & 0x5) == 0x0;
}
mDoorCount++;
} else {