Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes #1578

Open
wants to merge 12 commits into
base: unstable
Choose a base branch
from
2 changes: 1 addition & 1 deletion src/main/java/gregtech/api/enums/Materials.java
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ public String getToolTip(long aMultiplier) {
public String getToolTip(long aMultiplier, boolean aShowQuestionMarks) {
if (!aShowQuestionMarks && mChemicalFormula.equals("?")) return "";
if (aMultiplier >= M * 2 && !mMaterialList.isEmpty()) {
return ((mElement != null || (mMaterialList.size() < 2 && mMaterialList.get(0).mAmount == 1)) ? mChemicalFormula : "(" + mChemicalFormula + ")") + aMultiplier;
return ((mElement != null || (mMaterialList.size() < 2 && mMaterialList.get(0).mAmount == 1)) ? mChemicalFormula : "(" + mChemicalFormula + ")") + GT_Utility.makeSubscript((int)aMultiplier);
}
return mChemicalFormula;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/api/enums/OrePrefixes.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public enum OrePrefixes {
*/
batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
circuit("Circuits", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft
computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1), // A whole Computer. "computerMaster" = ComputerCube

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,14 @@ public void pollutionParticles(World aWorld,String name){
if(chk3)
aWorld.spawnParticle(name, xPos + ran3*0.5F, yPos + floatGen.nextFloat()*0.5F, zPos + floatGen.nextFloat()*0.5F, xSpd, ySpd, zSpd);
}

@Override
public boolean isGivingInformation() {
return true;
}

@Override
public String[] getInfoData() {
return new String[]{"Pollution: " + GT_Pollution.getPollution(getBaseMetaTileEntity())};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;

public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch {
Expand Down Expand Up @@ -89,8 +91,6 @@ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechT
return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Output Bus");
case 2:
return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, "Output Bus");
case 3:
return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Output Bus");
default:
return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Output Bus");
}
Expand All @@ -105,4 +105,18 @@ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aInde
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
}

@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && (aTick&0x7)==0) {
IInventory tTileEntity =aBaseMetaTileEntity.getIInventoryAtSide(aBaseMetaTileEntity.getFrontFacing());
if(tTileEntity!=null){
for (ItemStack aMInventory : mInventory)
GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity,
aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(),
null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
}
}
}
}
3 changes: 2 additions & 1 deletion src/main/java/gregtech/api/objects/MaterialStack.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gregtech.api.objects;

import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Utility;

public class MaterialStack implements Cloneable {
public long mAmount;
Expand Down Expand Up @@ -34,7 +35,7 @@ public boolean equals(Object aObject) {
public String toString() {
String temp1 = "", temp2 = mMaterial.getToolTip(true), temp3 = "", temp4 = "";
if (mAmount > 1) {
temp4 = String.valueOf(mAmount);
temp4 = GT_Utility.makeSubscript((int)mAmount);

if (mMaterial.mMaterialList.size() > 1 || isMaterialListComplex(this)) {
temp1 = "(";
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/gregtech/api/util/GT_Utility.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import org.apache.commons.lang3.StringUtils;

/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
Expand Down Expand Up @@ -2424,4 +2425,14 @@ public void calculateModifier(Enchantment aEnchantment, int aLevel) {
}
}

private static final String NORMAL_NUMERICS = "0123456789-";
private static final String UNICODE_SUBSCRIPT_NUMERICS = "\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u208B";

/**
* Converts an integer into a subscript string, such as might be used in a chemical formula, using unicode characters.
*/
public static String makeSubscript(int aValue) {
return StringUtils.replaceChars(String.valueOf(aValue), NORMAL_NUMERICS, UNICODE_SUBSCRIPT_NUMERICS);
}

}
1 change: 0 additions & 1 deletion src/main/java/gregtech/common/GT_Proxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,6 @@ else if (this.mInvalidNames.contains(aEvent.Name)) {
GT_OreDictUnificator.registerOre(OrePrefixes.item, aMaterial, aEvent.Ore);
} else if (aMaterial == Materials.Wood) {
GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
GT_OreDictUnificator.registerOre(OrePrefixes.plank, aMaterial, aEvent.Ore);
}
break;
case cell:
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/gregtech/common/items/GT_VolumetricFlask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

package gregtech.common.items;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.GT_Values;
Expand Down Expand Up @@ -42,16 +41,6 @@ public GT_VolumetricFlask(String unlocalized, String english, int maxCapacity) {
unlocalFlaskName = unlocalized;
setMaxStackSize(16);
setNoRepair();
if (Loader.isModLoaded("NotEnoughItems")) {
for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {
if (fluid != null) {
ItemStack stack = new ItemStack(this);
setCapacity(stack, getMaxCapacity());
fill(stack, new FluidStack(fluid, Integer.MAX_VALUE), true);
codechicken.nei.api.API.hideItem(stack);
}
}
}
}

public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public int checkRecipe() {
if (s==null)
s=tRecipe.mOutput.getDisplayName();
}
tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+s+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20)));
tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+s+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20)+" seconds"));
for(int i=0;i<tRecipe.mInputs.length;i++){
if (tRecipe.mOreDictAlt[i] != null) {
int count = 0;
Expand Down Expand Up @@ -295,4 +295,4 @@ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
public void startProcess() {
sendLoopStart((byte) 1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
mPlascreteCount++;
} else {
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ);
if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) {
if ((!addMaintenanceToMachineList(tTileEntity, 210)) && (!addEnergyInputToMachineList(tTileEntity, 210))) {
if (tBlock instanceof ic2.core.block.BlockIC2Door) {
if ((tMeta & 8) == 0) {
doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static gregtech.api.enums.GT_Values.VN;

import java.util.ArrayList;
import java.util.EnumSet;

import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
Expand Down Expand Up @@ -122,9 +123,8 @@ private ItemStack[] getOutputByDrops(ArrayList<ItemStack> oreBlockDrops) {
private boolean doUseMaceratorRecipe(ItemStack currentItem) {
ItemData itemData = GT_OreDictUnificator.getItemData(currentItem);
return itemData == null
|| itemData.mPrefix != OrePrefixes.crushed
&& itemData.mPrefix != OrePrefixes.dustImpure
&& itemData.mPrefix != OrePrefixes.dust
|| !EnumSet.of(OrePrefixes.crushed, OrePrefixes.dustImpure, OrePrefixes.dust, OrePrefixes.gemChipped,
OrePrefixes.gemFlawed, OrePrefixes.gemFlawless, OrePrefixes.gemExquisite, OrePrefixes.gem).contains(itemData.mPrefix)
&& itemData.mMaterial.mMaterial != Materials.Oilsands;
}

Expand Down Expand Up @@ -196,4 +196,4 @@ protected String[] getDescriptionInternal(String tierSuffix) {
"1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)",
"Radius is " + (getRadiusInChunks() << 4) + " blocks"};
}
}
}
5 changes: 4 additions & 1 deletion src/main/java/gregtech/nei/NEI_GT_Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import codechicken.nei.api.IConfigureNEI;
import cpw.mods.fml.common.FMLCommonHandler;
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_Recipe;

public class NEI_GT_Config
Expand All @@ -16,8 +17,10 @@ public void loadConfig() {
new GT_NEI_DefaultHandler(tMap);
}
}
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
if(FMLCommonHandler.instance().getEffectiveSide().isClient()) {
ALH=new GT_NEI_AssLineHandler(GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes);
codechicken.nei.api.API.addItemListEntry(ItemList.VOLUMETRIC_FLASK.get(1));
}
sIsAdded = true;
}

Expand Down