use of gregapi.item.ItemFluidDisplay in project gregtech6 by GregTech6.
the class GT_API_Proxy_Client method onItemTooltip.
@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent aEvent) {
if (Abstract_Mod.sFinalized < Abstract_Mod.sModCountUsingGTAPI || ST.invalid(aEvent.itemStack))
return;
if (!DISPLAY_TEMP_TOOLTIP) {
DISPLAY_TEMP_TOOLTIP = T;
return;
}
try {
if (UT.NBT.getNBT(aEvent.itemStack).getBoolean("gt.err.oredict.output")) {
aEvent.toolTip.clear();
aEvent.toolTip.add(0, LH.Chat.BLINKING_RED + "A Recipe used an OreDict Item as Output directly, without copying it before!");
aEvent.toolTip.add(1, LH.Chat.BLINKING_RED + "This is a typical CallByReference/CallByValue Error of the Modder doing it.");
aEvent.toolTip.add(2, LH.Chat.BLINKING_RED + "Please check all Recipes outputting this Item, and report the Recipes to their Owner.");
aEvent.toolTip.add(3, LH.Chat.BLINKING_RED + "The Owner of the RECIPE, NOT the Owner of the Item!");
return;
}
String aRegName = ST.regName(aEvent.itemStack);
if (aRegName == null) {
aEvent.toolTip.set(0, LH.Chat.BLINKING_RED + "ERROR: THIS ITEM HAS NOT BEEN REGISTERED!!!");
aRegName = "ERROR: THIS ITEM HAS NOT BEEN REGISTERED!!!";
}
short aMeta = ST.meta_(aEvent.itemStack);
byte aBlockMeta = UT.Code.bind4(aMeta);
Block aBlock = ST.block(aEvent.itemStack);
Item aItem = ST.item(aEvent.itemStack);
if (aEvent.itemStack.getTagCompound() == null) {
if (aBlock == Blocks.dirt && aBlockMeta == 1) {
aEvent.toolTip.set(0, aEvent.toolTip.get(0).replaceAll("Dirt", "Coarse Dirt"));
}
if (MD.RC.mLoaded && "Railcraft:part.plate".equalsIgnoreCase(aRegName)) {
switch(aMeta) {
case 0:
aEvent.toolTip.set(0, LH.Chat.WHITE + LH.get("oredict.plateIron.name"));
break;
case 1:
aEvent.toolTip.set(0, LH.Chat.WHITE + LH.get("oredict.plateSteel.name"));
break;
case 2:
aEvent.toolTip.set(0, LH.Chat.WHITE + LH.get("oredict.plateTinAlloy.name"));
break;
case 3:
aEvent.toolTip.set(0, LH.Chat.WHITE + LH.get("oredict.plateCopper.name"));
break;
case 4:
aEvent.toolTip.set(0, LH.Chat.WHITE + LH.get("oredict.plateLead.name"));
break;
}
}
}
if (MD.Mek.owns(aRegName)) {
aEvent.toolTip.set(0, aEvent.toolTip.get(0).replaceAll("Osmium", MT.Ge.mNameLocal));
}
if (ItemsGT.RECIPE_REMOVED_USE_TRASH_BIN_INSTEAD.contains(aEvent.itemStack, T)) {
aEvent.toolTip.add(LH.Chat.BLINKING_RED + "Recipe has been removed in favour of the GregTech Ender Garbage Bin");
}
ICover tCover = CoverRegistry.get(aEvent.itemStack);
if (tCover != null)
tCover.addToolTips(aEvent.toolTip, aEvent.itemStack, aEvent.showAdvancedItemTooltips);
if (aBlock != NB) {
if (IL.TC_Warded_Glass.equal(aEvent.itemStack, F, T)) {
aEvent.toolTip.add(LH.getToolTipBlastResistance(aBlock, 999));
} else if (ItemsGT.SHOW_RESISTANCE.contains(aEvent.itemStack, T)) {
if (IL.ICBM_Concrete.block() == aBlock) {
switch(aMeta) {
default:
aEvent.toolTip.add(LH.getToolTipBlastResistance(aBlock, 30));
break;
case 1:
aEvent.toolTip.add(LH.getToolTipBlastResistance(aBlock, 38));
break;
case 2:
aEvent.toolTip.add(LH.getToolTipBlastResistance(aBlock, 48));
break;
}
} else {
aEvent.toolTip.add(LH.getToolTipBlastResistance(aBlock, aBlock.getExplosionResistance(null)));
}
aEvent.toolTip.add(LH.getToolTipHarvest(aBlock.getMaterial(), aBlock.getHarvestTool(aBlockMeta), aBlock.getHarvestLevel(aBlockMeta)));
}
if (BlocksGT.openableCrowbar.contains(aBlock)) {
aEvent.toolTip.add(LH.Chat.DGRAY + LH.get(LH.TOOL_TO_OPEN_CROWBAR));
}
}
if (BooksGT.BOOK_REGISTER.containsKey(aEvent.itemStack, T)) {
aEvent.toolTip.add(LH.Chat.DGRAY + LH.get(LH.TOOLTIP_SHELFABLE));
}
if (Sandwiches.INGREDIENTS.containsKey(aEvent.itemStack, T)) {
aEvent.toolTip.add(LH.Chat.DGRAY + LH.get(LH.TOOLTIP_SANDWICHABLE));
}
if (aItem.isBeaconPayment(aEvent.itemStack)) {
aEvent.toolTip.add(LH.Chat.DGRAY + LH.get(LH.TOOLTIP_BEACON_PAYMENT));
}
OreDictItemData tData = OM.anydata_(aEvent.itemStack);
if (!(aItem instanceof ItemFluidDisplay) && SHOW_INTERNAL_NAMES) {
if (tData != null && tData.hasValidPrefixMaterialData()) {
if (tData.mBlackListed) {
if (ST.isGT(aItem))
aEvent.toolTip.add(LH.Chat.ORANGE + tData.toString());
else
aEvent.toolTip.add(LH.Chat.DCYAN + aRegName + LH.Chat.WHITE + " - " + LH.Chat.CYAN + aMeta + LH.Chat.WHITE + " - " + LH.Chat.ORANGE + tData.toString());
} else {
if (ST.isGT(aItem))
aEvent.toolTip.add(LH.Chat.GREEN + tData.toString());
else
aEvent.toolTip.add(LH.Chat.DCYAN + aRegName + LH.Chat.WHITE + " - " + LH.Chat.CYAN + aMeta + LH.Chat.WHITE + " - " + LH.Chat.GREEN + tData.toString());
}
} else {
if (!ST.isGT(aItem))
aEvent.toolTip.add(LH.Chat.DCYAN + aRegName + LH.Chat.WHITE + " - " + LH.Chat.CYAN + aMeta);
}
}
if (tData != null) {
if (tData.hasValidPrefixData()) {
for (IOreDictListenerItem tListener : tData.mPrefix.mListenersItem) {
String tToolTip = tListener.getListenerToolTip(tData.mPrefix, tData.mMaterial.mMaterial, aEvent.itemStack);
if (tToolTip != null)
aEvent.toolTip.add(tToolTip);
}
} else {
if (IL.RC_Firestone_Refined.equal(aEvent.itemStack, T, T))
aEvent.toolTip.add(LH.Chat.CYAN + "Works in Burning Boxes (" + (800 * EU_PER_LAVA) + " HU per Lava Block)");
else if (IL.RC_Firestone_Cracked.equal(aEvent.itemStack, T, T))
aEvent.toolTip.add(LH.Chat.CYAN + "Works in Burning Boxes (" + (600 * EU_PER_LAVA) + " HU per Lava Block)");
else if (IL.TF_Pick_Giant.equal(aEvent.itemStack, T, T))
aEvent.toolTip.add(LH.Chat.CYAN + "Can be repaired with Knightmetal Ingots on the Anvil");
else if (IL.TF_Sword_Giant.equal(aEvent.itemStack, T, T))
aEvent.toolTip.add(LH.Chat.CYAN + "Can be repaired with Ironwood Ingots on the Anvil");
else if (IL.TF_Lamp_of_Cinders.equal(aEvent.itemStack, T, T))
aEvent.toolTip.add(LH.Chat.CYAN + "Can be used as a Lighter for GT6 things and TNT");
}
if (tData.hasValidMaterialData()) {
boolean tUnburnable = F;
for (OreDictMaterialStack tMaterial : tData.getAllMaterialStacks()) {
if (tMaterial.mMaterial.contains(TD.Properties.UNBURNABLE))
tUnburnable = T;
for (IOreDictListenerItem tListener : tMaterial.mMaterial.mListenersItem) {
String tToolTip = tListener.getListenerToolTip(tData.mPrefix, tData.mMaterial.mMaterial, aEvent.itemStack);
if (tToolTip != null)
aEvent.toolTip.add(tToolTip);
}
}
if (tData.mMaterial.mMaterial.mToolTypes > 0 && (tData.mPrefix != null || (aEvent.itemStack.getMaxStackSize() > 1 && tData.mByProducts.length == 0 && tData.mMaterial.mAmount <= U))) {
aEvent.toolTip.add(LH.Chat.BLUE + "Q: " + tData.mMaterial.mMaterial.mToolQuality + " - S: " + tData.mMaterial.mMaterial.mToolSpeed + " - D: " + tData.mMaterial.mMaterial.mToolDurability);
}
if (SHOW_CHEM_FORMULAS && UT.Code.stringValid(tData.mMaterial.mMaterial.mTooltipChemical) && (tData.mPrefix == null ? tData.mByProducts.length == 0 : tData.mPrefix.contains(TD.Prefix.TOOLTIP_MATERIAL))) {
aEvent.toolTip.add(LH.Chat.YELLOW + tData.mMaterial.mMaterial.mTooltipChemical);
}
if (tData.mMaterial.mMaterial == MT.Nikolite) {
aEvent.toolTip.set(0, aEvent.toolTip.get(0).replaceAll("(Teslatite|Electrotine)", MT.Nikolite.mNameLocal));
}
if (tData.mMaterial.mMaterial == MT.Ge) {
aEvent.toolTip.set(0, aEvent.toolTip.get(0).replaceAll("Osmium", MT.Ge.mNameLocal));
}
if (tData.hasValidPrefixData()) {
if (tData.mPrefix == OP.dustTiny && ANY.Blaze.mToThis.contains(tData.mMaterial.mMaterial)) {
aEvent.toolTip.set(0, aEvent.toolTip.get(0).replaceAll(tData.mMaterial.mMaterial.mNameLocal, OP.dustTiny.mMaterialPre + tData.mMaterial.mMaterial.mNameLocal));
}
if (tData.mPrefix.contains(TD.Prefix.NEEDS_SHARPENING))
aEvent.toolTip.add(LH.Chat.CYAN + LH.get(LH.TOOLTIP_NEEDS_SHARPENING));
if (tData.mPrefix.contains(TD.Prefix.NEEDS_HANDLE))
aEvent.toolTip.add(LH.Chat.CYAN + LH.get(LH.TOOLTIP_NEEDS_HANDLE) + LH.Chat.WHITE + tData.mMaterial.mMaterial.mHandleMaterial.getLocal());
ArrayListNoNulls<Integer> tShapelessAmounts = new ArrayListNoNulls<>();
for (AdvancedCrafting1ToY tHandler : tData.mPrefix.mShapelessManagersSingle) if (tHandler.hasOutputFor(tData.mMaterial.mMaterial))
tShapelessAmounts.add(1);
for (AdvancedCraftingXToY tHandler : tData.mPrefix.mShapelessManagers) if (tHandler.hasOutputFor(tData.mMaterial.mMaterial))
tShapelessAmounts.add(tHandler.mInputCount);
if (!tShapelessAmounts.isEmpty()) {
Collections.sort(tShapelessAmounts);
aEvent.toolTip.add(LH.Chat.CYAN + LH.get(LH.TOOLTIP_SHAPELESS_CRAFT) + LH.Chat.WHITE + tShapelessAmounts);
}
if (tData.mPrefix.contains(TD.Prefix.TOOLTIP_ENCHANTS)) {
if (!tData.mMaterial.mMaterial.mEnchantmentTools.isEmpty()) {
if (!tData.mPrefix.contains(TD.Prefix.AMMO_ALIKE)) {
if (tData.mMaterial.mMaterial.mEnchantmentTools.size() <= 5) {
aEvent.toolTip.add(LH.Chat.PURPLE + LH.get(LH.TOOLTIP_POSSIBLE_TOOL_ENCHANTS));
for (ObjectStack<Enchantment> tEnchantment : tData.mMaterial.mMaterial.mEnchantmentTools) {
if (tEnchantment.mObject == Enchantment.fortune) {
aEvent.toolTip.add(LH.Chat.PINK + Enchantment.fortune.getTranslatedName((int) tEnchantment.mAmount) + " / " + Enchantment.looting.getTranslatedName((int) tEnchantment.mAmount));
} else if (tEnchantment.mObject == Enchantment.knockback) {
aEvent.toolTip.add(LH.Chat.PINK + Enchantment.knockback.getTranslatedName((int) tEnchantment.mAmount) + " / " + Enchantment.punch.getTranslatedName((int) tEnchantment.mAmount));
} else if (tEnchantment.mObject == Enchantment.fireAspect) {
if (tEnchantment.mAmount >= 3)
aEvent.toolTip.add(LH.Chat.PINK + Enchantment.fireAspect.getTranslatedName((int) tEnchantment.mAmount) + " / " + Enchantment.flame.getTranslatedName((int) tEnchantment.mAmount) + " / Auto Smelt I");
else
aEvent.toolTip.add(LH.Chat.PINK + Enchantment.fireAspect.getTranslatedName((int) tEnchantment.mAmount) + " / " + Enchantment.flame.getTranslatedName((int) tEnchantment.mAmount));
} else {
aEvent.toolTip.add(LH.Chat.PINK + tEnchantment.mObject.getTranslatedName((int) tEnchantment.mAmount));
}
}
} else {
aEvent.toolTip.add(LH.Chat.PURPLE + LH.get(LH.TOOLTIP_TOO_MANY_TOOL_ENCHANTS));
}
}
}
if (MD.BTL.mLoaded && tData.mMaterial.mMaterial.contains(TD.Properties.BETWEENLANDS)) {
aEvent.toolTip.add(LH.Chat.GREEN + LH.get(LH.TOOLTIP_BETWEENLANDS_RESISTANCE));
}
if (!tData.mPrefix.containsAny(TD.Prefix.TOOL_HEAD, TD.Prefix.WEAPON_ALIKE, TD.Prefix.AMMO_ALIKE, TD.Prefix.TOOL_ALIKE)) {
if (!tData.mMaterial.mMaterial.mEnchantmentArmors.isEmpty()) {
if (tData.mMaterial.mMaterial.mEnchantmentArmors.size() <= 3) {
aEvent.toolTip.add(LH.Chat.PURPLE + LH.get(LH.TOOLTIP_POSSIBLE_ARMOR_ENCHANTS));
for (ObjectStack<Enchantment> tEnchantment : tData.mMaterial.mMaterial.mEnchantmentArmors) {
aEvent.toolTip.add(LH.Chat.PINK + tEnchantment.mObject.getTranslatedName((int) tEnchantment.mAmount));
}
} else {
aEvent.toolTip.add(LH.Chat.PURPLE + LH.get(LH.TOOLTIP_TOO_MANY_ARMOR_ENCHANTS));
}
}
if ((IL.TF_Mazestone.exists() || IL.TF_Mazehedge.exists()) && tData.mMaterial.mMaterial.contains(TD.Properties.MAZEBREAKER)) {
aEvent.toolTip.add(LH.Chat.PINK + LH.get(LH.TOOLTIP_TWILIGHT_MAZE_BREAKING));
}
}
}
if (aBlock == NB || !(aBlock instanceof MultiTileEntityBlockInternal || aBlock instanceof IBlockBase)) {
if (tData.mMaterial.mMaterial.contains(TD.Properties.FLAMMABLE)) {
if (tData.mMaterial.mMaterial.contains(TD.Properties.EXPLOSIVE)) {
aEvent.toolTip.add(LH.Chat.RED + LH.get(LH.TOOLTIP_FLAMMABLE_AND_EXPLOSIVE));
} else {
aEvent.toolTip.add(LH.Chat.RED + LH.get(LH.TOOLTIP_FLAMMABLE));
}
} else if (tData.mMaterial.mMaterial.contains(TD.Properties.EXPLOSIVE)) {
aEvent.toolTip.add(LH.Chat.RED + LH.get(LH.TOOLTIP_EXPLOSIVE));
}
}
}
if (tUnburnable && !MD.MC.owns(aRegName))
aEvent.toolTip.add(LH.Chat.GREEN + LH.get(LH.TOOLTIP_UNBURNABLE));
}
if (aEvent.showAdvancedItemTooltips) {
boolean temp = T;
for (OreDictMaterialStack tMaterial : tData.getAllMaterialStacks()) if (tMaterial.mAmount != 0 && !tMaterial.mMaterial.contains(TD.Properties.DONT_SHOW_THIS_COMPONENT)) {
if (temp) {
aEvent.toolTip.add(LH.Chat.DCYAN + LH.get(LH.TOOLTIP_CONTAINED_MATERIALS));
temp = F;
}
StringBuilder tString = new StringBuilder(128);
double aWeight = tMaterial.weight();
long tWeight = ((long) (aWeight * 1000)) % 1000;
tString.append(LH.Chat.WHITE).append(UT.Code.displayUnits(tMaterial.mAmount)).append(" ");
tString.append(LH.Chat.YELLOW).append(tMaterial.mMaterial.getLocal());
tString.append(LH.Chat.WHITE).append(" (");
tString.append(LH.Chat.CYAN).append("M: ");
tString.append(LH.Chat.WHITE).append(tMaterial.mMaterial.mMeltingPoint);
tString.append(LH.Chat.RED).append("K ");
tString.append(LH.Chat.CYAN).append(" B: ");
tString.append(LH.Chat.WHITE).append(tMaterial.mMaterial.mBoilingPoint);
tString.append(LH.Chat.RED).append("K ");
tString.append(LH.Chat.CYAN).append(" W: ");
tString.append(LH.Chat.WHITE).append((long) aWeight).append(".").append(tWeight < 1 ? "000" : tWeight < 10 ? "00" + tWeight : tWeight < 100 ? "0" + tWeight : tWeight);
tString.append(LH.Chat.YELLOW).append("kg");
tString.append(LH.Chat.WHITE).append(")");
aEvent.toolTip.add(tString.toString());
}
} else {
aEvent.toolTip.add(LH.Chat.DGRAY + "Enable F3+H Mode for Info about contained Materials.");
}
if (ST.isGT(aItem) && tData.hasValidPrefixMaterialData()) {
if (tData.mMaterial.mMaterial.mOriginalMod == null) {
aEvent.toolTip.add(LH.Chat.BLUE + "Material from an Unknown Mod");
} else if (tData.mMaterial.mMaterial.mOriginalMod == MD.MC) {
aEvent.toolTip.add(LH.Chat.BLUE + "Vanilla Material");
} else if (tData.mMaterial.mMaterial.mOriginalMod == MD.GAPI) {
if (tData.mMaterial.mMaterial.mID > 0 && tData.mMaterial.mMaterial.mID < 8000) {
aEvent.toolTip.add(LH.Chat.BLUE + "Material from the Periodic Table of Elements");
} else {
aEvent.toolTip.add(LH.Chat.BLUE + "Random Material handled by Greg API");
}
} else {
aEvent.toolTip.add(LH.Chat.BLUE + "Material from " + tData.mMaterial.mMaterial.mOriginalMod.mName);
}
}
}
// Remove all Nulls and fix eventual Formatting mistakes.
for (int i = 1, j = aEvent.toolTip.size(); i < j; i++) {
String tTooltip = aEvent.toolTip.get(i);
if (tTooltip == null) {
aEvent.toolTip.remove(i--);
j--;
} else
aEvent.toolTip.set(i, tTooltip + LH.Chat.RESET_TOOLTIP);
}
} catch (Throwable e) {
e.printStackTrace(ERR);
}
}
use of gregapi.item.ItemFluidDisplay in project AE2FluidCraft-Rework by GlodBlock.
the class GregTech6RecipeExtractor method getInputIngredients.
@Override
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs) {
this.removeMachine(rawInputs);
List<PositionedStack> compressed = compress(rawInputs);
List<OrderStack<?>> tmp = new LinkedList<>();
for (int i = 0; i < compressed.size(); i++) {
if (compressed.get(i) == null)
continue;
ItemStack item = compressed.get(i).items[0];
OrderStack<?> stack;
if (item.getItem() instanceof ItemFluidDisplay) {
FluidStack fluid = ((ItemFluidDisplay) item.getItem()).getFluid(item);
if (fluid == null || fluid.amount <= 0)
continue;
stack = new OrderStack<>(fluid, i);
tmp.add(stack);
} else {
stack = OrderStack.pack(compressed.get(i), i);
if (stack != null)
tmp.add(stack);
}
}
return tmp;
}
use of gregapi.item.ItemFluidDisplay in project gregtech6 by GregTech6.
the class GT_API method onModPreInit2.
@Override
@SuppressWarnings({ "resource", "deprecation" })
public void onModPreInit2(FMLPreInitializationEvent aEvent) {
File tFile = new File(DirectoriesGT.CONFIG_GT, "IDs.cfg");
if (!tFile.exists())
tFile = new File(DirectoriesGT.CONFIG_GT, "ids.cfg");
Config.sConfigFileIDs = new Configuration(tFile);
Config.sConfigFileIDs.save();
ConfigsGT.GREGTECH = new Config("GregTech.cfg").setUseDefaultInNames(F);
ConfigsGT.RECIPES = new Config("Recipes.cfg");
ConfigsGT.WORLDGEN = new Config("WorldGenerationNew.cfg");
ConfigsGT.WORLDGEN_GT5 = new Config("old_barely_used_gt5_style_garbage_worldgen.cfg");
ConfigsGT.MATERIAL = new Config("Materials.cfg");
ConfigsGT.OREPROCESSING = new Config("OreProcessing.cfg");
// Deprecated Config Files.
ConfigsGT.OVERPOWERED = ConfigsGT.MACHINES = ConfigsGT.SPECIAL = ConfigsGT.GREGTECH;
tFile = new File(DirectoriesGT.CONFIG_GT, "Stacksizes.cfg");
if (!tFile.exists())
tFile = new File(DirectoriesGT.CONFIG_GT, "stacksizes.cfg");
Configuration tStackConfig = new Configuration(tFile);
tFile = new File(DirectoriesGT.LOGS, "gregtech.log");
if (!tFile.exists())
try {
tFile.createNewFile();
} catch (Throwable e) {
/**/
}
List<String> tList = ((LogBuffer) OUT).mBufferedLog;
try {
OUT = new PrintStream(tFile);
} catch (Throwable e) {
OUT = System.out;
}
for (String tString : tList) OUT.println(tString);
if (ConfigsGT.GREGTECH.get("general", "LoggingErrors", T)) {
tList = ((LogBuffer) ERR).mBufferedLog;
ERR = OUT;
for (String tString : tList) ERR.println(tString);
} else {
OUT.println("**********************************************************************");
OUT.println("* WARNING: ERROR LOGGING HAS BEEN DISABLED FOR THIS LOG FILE *");
OUT.println("**********************************************************************");
}
tFile = new File(DirectoriesGT.CONFIG_GT, "materiallist.log");
if (!tFile.exists()) {
try {
tFile.createNewFile();
} catch (Throwable e) {
/**/
}
}
try {
MAT_LOG = new PrintStream(tFile);
MAT_LOG.println("**********************************************************************");
MAT_LOG.println("* This is the complete List of usable GregTech Materials *");
MAT_LOG.println("**********************************************************************");
} catch (Throwable e) {
/**/
}
tFile = new File(DirectoriesGT.LOGS, "oredict.log");
if (!tFile.exists()) {
try {
tFile.createNewFile();
} catch (Throwable e) {
/**/
}
}
try {
tList = ((LogBuffer) ORD).mBufferedLog;
ORD = new PrintStream(tFile);
ORD.println("**********************************************************************");
ORD.println("* This is the complete Log of the GregTech OreDictionary Handler *");
ORD.println("**********************************************************************");
for (String tString : tList) ORD.println(tString);
} catch (Throwable e) {
/**/
}
if (ConfigsGT.GREGTECH.get("general", "LoggingPlayerActivity", !CODE_CLIENT)) {
tFile = new File(DirectoriesGT.LOGS, "playeractivity_" + (System.currentTimeMillis() / 60000) + ".log");
if (!tFile.exists()) {
try {
tFile.createNewFile();
} catch (Throwable e) {
/**/
}
}
try {
mPlayerLogger = new LoggerPlayerActivity(new PrintStream(tFile));
} catch (Throwable e) {
/**/
}
}
ConfigsGT.CLIENT = new Config(DirectoriesGT.MINECRAFT, "GregTech.cfg");
D1 = ConfigsGT.CLIENT.get("debug", "logs", F);
D2 = ConfigsGT.CLIENT.get("debug", "oredict", F);
D3 = ConfigsGT.CLIENT.get("debug", "misc", F);
CLIENT_BLOCKUPDATE_SOUNDS = ConfigsGT.CLIENT.get("debug", "block_update_sounds", F);
if (ConfigsGT.CLIENT.get("debug", "april_fools", F))
APRIL_FOOLS = T;
if (ConfigsGT.CLIENT.get("debug", "xmas_july", F))
XMAS_IN_JULY = T;
if (ConfigsGT.CLIENT.get("debug", "xmas_december", F))
XMAS_IN_DECEMBER = T;
if (APRIL_FOOLS) {
MT.W.setLocal("Wolframium");
MT.V.setLocal("Vandalium");
MT.B.setLocal("Boring");
MT.S.setLocal("Sulphur");
MT.K.setLocal("Kalium");
MT.Na.setLocal("Natrium");
MT.Ar.setLocal("Aragon");
MT.Al.setLocal("Aluminum");
MT.Ni.setLocal("Ferrous Metal");
MT.Pt.setLocal("Shiny Metal");
MT.Mithril.setLocal("Mana Infused Metal");
MT.Hg.setLocal("Quicksilver");
MT.Mo.setLocal("Molly-B");
MT.Sb.setLocal("Anti-Money");
MT.Tc.setLocal("Gregorium");
MT.Si.setLocal("Silicone");
MT.Cr.setLocal("Chrome");
MT.Cu.setLocal("Cooper");
MT.AnnealedCopper.setLocal("Anilled Cooper");
MT.Mg.setLocal("Manganesium");
MT.Mn.setLocal("Animenese");
MT.As.setLocal("Arse Nick");
MT.Br.setLocal("Bro, that's mine");
MT.Kr.setLocal("Kryptonite");
MT.Bi.setLocal("Biffmiff");
MT.Sg.setLocal("Resistance is Futile");
MT.Zr.setLocal("Diamond");
MT.Au.setLocal("Pyrite");
MT.Pyrite.setLocal("Gold");
MT.Fe.setLocal("Irun");
MT.IronWood.setLocal("Irunwood");
MT.ShadowIron.setLocal("Shade Irun");
MT.DarkIron.setLocal("Dank Irun");
MT.MeteoricIron.setLocal("Metaur Irun");
MT.GildedIron.setLocal("Guild Irun");
MT.WroughtIron.setLocal("Wrecked Irun");
MT.Steel.setLocal("Style");
MT.RedSteel.setLocal("Rad Style");
MT.BlueSteel.setLocal("Blu Style");
MT.BlackSteel.setLocal("Afroamerican Style");
MT.MeteoricSteel.setLocal("Metaur Style");
MT.MeteoricRedSteel.setLocal("Metaur Rad Style");
MT.MeteoricBlueSteel.setLocal("Metaur Blu Style");
MT.MeteoricBlackSteel.setLocal("Metaur Afroamerican Style");
MT.DamascusSteel.setLocal("Dank Style");
MT.VanadiumSteel.setLocal("Vandalium Style");
MT.TungstenSteel.setLocal("Wolf Style");
MT.ShadowSteel.setLocal("Shade Style");
MT.Steeleaf.setLocal("Style Leave");
MT.Knightmetal.setLocal("Night Metal");
MT.FierySteel.setLocal("Fury Style");
MT.Thaumium.setLocal("Thaumanominum");
MT.DarkThaumium.setLocal("Dank Thaumanominum");
MT.Coal.setLocal("Cool");
MT.Charcoal.setLocal("Charred Cole");
MT.Lapis.setLocal("Le Piss");
MT.Redstone.setLocal("Blingstone");
MT.Glowstone.setLocal("Klostein");
MT.Emerald.setLocal("Chaos Emerald");
MT.Craponite.setLocal("Pink Diamond");
MT.Diamond.setLocal("Sapphire");
MT.DiamondPink.setLocal("Craponite");
MT.Bedrock.setLocal("Sofarock");
MT.Plastic.setLocal("LEGO");
MT.Asbestos.setLocal("Bestos");
MT.AncientDebris.setLocal("Cinnabun");
MT.Cinnamon.setLocal("Ancient Debris");
MT.WOODS.Cinnamon.setLocal("Ancient Debris");
MT.Rb.setLocal("Ruby");
MT.Ruby.setLocal("Red Sapphire");
MT.KNO3.setLocal("Niter");
MT.NaNO3.setLocal("Nitre");
MT.Glyceryl.setLocal("Nitro");
MT.Gunpowder.setLocal("Boompowder");
MT.Lubricant.setLocal("Lube");
MT.H2SO4.setLocal("Sulphuric Acid");
MT.H2S2O7.setLocal("Disulphuric Acid");
MT.STONES.Greenschist.setLocal("Green Shit");
MT.STONES.Blueschist.setLocal("Blue Shit");
MT.Nikolite.setLocal("Bluestone");
MT.PigIron.setLocal("Ferrobacon");
MT.TinAlloy.setLocal("Tin*");
MT.Bronze.setLocal("Tinkerers Alloy");
MT.BlackBronze.setLocal("Afroamerican Tinkerers Alloy");
MT.Constantan.setLocal("Cupronickel");
MT.Ge.setLocal("Platosmium");
MT.Amazonite.setLocal("Bezosite");
MT.NetherQuartz.setLocal("Weather Quartz");
MT.MilkyQuartz.setLocal("Milk Quartz");
MT.CertusQuartz.setLocal("Citrus Quartz");
MT.ChargedCertusQuartz.setLocal("Charged Citrus Quartz");
MT.Firestone.setLocal("Hot Garbage");
MT.UUMatter.setLocal("UwU-Matter");
MT.UUAmplifier.setLocal("UwU-Amplifier");
MT.OREMATS.Galena.setLocal("Silverlead");
MT.OREMATS.Huebnerite.setLocal("Boobnerite");
MT.OREMATS.Bromargyrite.setLocal("Bromagnerite");
MT.OREMATS.Chalcopyrite.setLocal("Chackapackerite");
for (OreDictMaterial tMaterial : OreDictMaterial.MATERIAL_MAP.values()) if (tMaterial.mNameLocal.toLowerCase().contains("wood"))
tMaterial.setLocal(tMaterial.mNameLocal + " >:] nice");
}
if (D1) {
tList = ((LogBuffer) DEB).mBufferedLog;
DEB = OUT;
for (String tString : tList) DEB.println(tString);
}
for (OreDictPrefix tPrefix : OreDictPrefix.VALUES) if (!tPrefix.contains(TD.Prefix.PREFIX_UNUSED)) {
tPrefix.setConfigStacksize(tStackConfig.get("stacksizes", tPrefix.mNameInternal + "_" + tPrefix.mDefaultStackSize, tPrefix.mDefaultStackSize).getInt());
}
tStackConfig.save();
SURVIVAL_INTO_ADVENTURE_MODE = ConfigsGT.GREGTECH.get("general", "forceAdventureMode", F);
ADVENTURE_MODE_KIT = ConfigsGT.GREGTECH.get("general", "AdventureModeStartingKit", !MD.GT.mLoaded);
HUNGER_BY_INVENTORY_WEIGHT = ConfigsGT.GREGTECH.get("general", "AFK_Hunger", MD.GT.mLoaded);
TOOL_BREAK_FATIQUE = ConfigsGT.GREGTECH.get("general", "ToolBreakFatique", T);
INVENTORY_UNIFICATION = ConfigsGT.GREGTECH.get("general", "InventoryUnification", T);
XP_ORB_COMBINING = ConfigsGT.GREGTECH.get("general", "XP_Orb_Combining", T);
CONFIG_HARDNESS_MULTIPLIER_SAND = ConfigsGT.GREGTECH.get("general", "HardnessMultiplier_Sand", 1);
CONFIG_HARDNESS_MULTIPLIER_ROCK = ConfigsGT.GREGTECH.get("general", "HardnessMultiplier_Rock", 1);
CONFIG_HARDNESS_MULTIPLIER_ORES = ConfigsGT.GREGTECH.get("general", "HardnessMultiplier_Ores", 1);
ITEM_DESPAWN_TIME = ConfigsGT.GREGTECH.get("general", "ItemDespawnTime", 6000);
TREE_GROWTH_TIME = ConfigsGT.GREGTECH.get("general", "Tree_Growth_Time", 1);
ENTITY_CRAMMING = ConfigsGT.GREGTECH.get("general", "MaxEqualEntitiesAtOneSpot", 3);
DRINKS_ALWAYS_DRINKABLE = ConfigsGT.GREGTECH.get("general", "drinks_always_drinkable", F);
EMIT_EU_AS_RF = ConfigsGT.GREGTECH.get("general", "Emit_EU_as_RF_from_Blocks", F);
NERFED_WOOD = ConfigsGT.GREGTECH.get("general", "WoodNeedsSawForCrafting", T);
FORCE_GRAVEL_NO_FLINT = ConfigsGT.GREGTECH.get("general", "GravelWontDropFlint", F);
FAST_LEAF_DECAY = ConfigsGT.GREGTECH.get("general", "FastLeafDecay", T);
CONSTANT_ENERGY = ConfigsGT.GREGTECH.get("general", "UninterruptedEnergyRequirement", T);
FOOD_OVERDOSE_DEATH = ConfigsGT.GREGTECH.get("general", "DeathByOverdosingCertainFoods", T);
NUTRITION_SYSTEM = ConfigsGT.GREGTECH.get("general", "NutritionSystem", T);
OBSTRUCTION_CHECKS = ConfigsGT.GREGTECH.get("general", "ObstructionChecks", T);
OWNERSHIP_RESET = ConfigsGT.GREGTECH.get("general", "ResetPlayerOwnershipOfGT6Blocks", F);
SPAWN_ZONE_MOB_PROTECTION = ConfigsGT.GREGTECH.get("general", "PreventMobSpawnsCloseToSpawn", T);
SPAWN_NO_BATS = ConfigsGT.GREGTECH.get("general", "PreventBatSpawnsOnNonVanillaStone", T);
SPAWN_HOSTILES_ONLY_IN_DARKNESS = ConfigsGT.GREGTECH.get("general", "PreventMobSpawnsAboveLightLevel0", T);
DISABLE_GT6_CRAFTING_RECIPES = ConfigsGT.GREGTECH.get("general", "DisableGT6CraftingRecipesDEBUG", F);
TOOL_SOUNDS = ConfigsGT.GREGTECH.get("general", "sound_tools", T);
MOBS_DROP_LEAD = ConfigsGT.GREGTECH.get("general", "mobs_drop_lead_instead_of_iron", T);
MOBS_DROP_MEAT = ConfigsGT.GREGTECH.get("general", "mobs_drop_variety_meats", T);
MOBS_DROP_JUNK = ConfigsGT.GREGTECH.get("general", "mobs_drop_random_junk", T);
MOBS_DROP_BOOK = ConfigsGT.GREGTECH.get("general", "mobs_drop_books_and_manuals", T);
MOBS_DROP_NAME = ConfigsGT.GREGTECH.get("general", "mobs_drop_nametags_when_named", T);
ZOMBIES_DIG_WITH_TOOLS = ConfigsGT.GREGTECH.get("general", "Zombies_Dig_With_Tools", F);
ZOMBIES_DIG_TILEENTITIES = ConfigsGT.GREGTECH.get("general", "Zombies_Dig_TileEntities", F);
ZOMBIES_HOLD_PICKAXES = ConfigsGT.GREGTECH.get("general", "Zombies_Hold_Pickaxes", F);
ZOMBIES_HOLD_TNT = ConfigsGT.GREGTECH.get("general", "Zombies_Hold_TNT", F);
ZOMBIES_IGNITE_HELD_TNT = ConfigsGT.GREGTECH.get("general", "Zombies_Ignite_Held_TNT", F);
UT.Sounds.MULTITHREADED = ConfigsGT.GREGTECH.get("general", "sound_multi_threading", F);
ENABLE_ADDING_IC2_MACERATOR_RECIPES = ConfigsGT.GREGTECH.get("ic2", "EnableAddingMaceratorRecipes", T);
ENABLE_ADDING_IC2_EXTRACTOR_RECIPES = ConfigsGT.GREGTECH.get("ic2", "EnableAddingExtractorRecipes", T);
ENABLE_ADDING_IC2_COMPRESSOR_RECIPES = ConfigsGT.GREGTECH.get("ic2", "EnableAddingCompressorRecipes", T);
ENABLE_ADDING_IC2_OREWASHER_RECIPES = ConfigsGT.GREGTECH.get("ic2", "EnableAddingOreWasherRecipes", T);
ENABLE_ADDING_IC2_CENTRIFUGE_RECIPES = ConfigsGT.GREGTECH.get("ic2", "EnableAddingThermalCentrifugeRecipes", T);
if (!ConfigsGT.GREGTECH.get("general", "UseTFCAttackMultiplierWhenLoaded", T) || TFC_DAMAGE_MULTIPLIER < 1 || (!MD.TFC.mLoaded && !MD.TFCP.mLoaded))
TFC_DAMAGE_MULTIPLIER = 1;
if (MD.IC2C.mLoaded) {
DISABLE_ALL_IC2_MACERATOR_RECIPES = F;
ENABLE_ADDING_IC2_MACERATOR_RECIPES = T;
DISABLE_ALL_IC2_EXTRACTOR_RECIPES = F;
ENABLE_ADDING_IC2_EXTRACTOR_RECIPES = T;
DISABLE_ALL_IC2_COMPRESSOR_RECIPES = F;
ENABLE_ADDING_IC2_COMPRESSOR_RECIPES = T;
DISABLE_ALL_IC2_OREWASHER_RECIPES = F;
ENABLE_ADDING_IC2_OREWASHER_RECIPES = F;
DISABLE_ALL_IC2_CENTRIFUGE_RECIPES = F;
ENABLE_ADDING_IC2_CENTRIFUGE_RECIPES = F;
} else if (MD.IC2.mLoaded) {
DISABLE_ALL_IC2_MACERATOR_RECIPES = ConfigsGT.GREGTECH.get("ic2", "DisableAllMaceratorRecipes", F);
if (DISABLE_ALL_IC2_MACERATOR_RECIPES)
ENABLE_ADDING_IC2_MACERATOR_RECIPES = F;
DISABLE_ALL_IC2_EXTRACTOR_RECIPES = ConfigsGT.GREGTECH.get("ic2", "DisableAllExtractorRecipes", F);
if (DISABLE_ALL_IC2_EXTRACTOR_RECIPES)
ENABLE_ADDING_IC2_EXTRACTOR_RECIPES = F;
DISABLE_ALL_IC2_COMPRESSOR_RECIPES = ConfigsGT.GREGTECH.get("ic2", "DisableAllCompressorRecipes", F);
if (DISABLE_ALL_IC2_COMPRESSOR_RECIPES)
ENABLE_ADDING_IC2_COMPRESSOR_RECIPES = F;
DISABLE_ALL_IC2_OREWASHER_RECIPES = ConfigsGT.GREGTECH.get("ic2", "DisableAllOreWasherRecipes", F);
if (DISABLE_ALL_IC2_OREWASHER_RECIPES)
ENABLE_ADDING_IC2_OREWASHER_RECIPES = F;
DISABLE_ALL_IC2_CENTRIFUGE_RECIPES = ConfigsGT.GREGTECH.get("ic2", "DisableAllThermalCentrifugeRecipes", F);
if (DISABLE_ALL_IC2_CENTRIFUGE_RECIPES)
ENABLE_ADDING_IC2_CENTRIFUGE_RECIPES = F;
} else {
DISABLE_ALL_IC2_MACERATOR_RECIPES = F;
ENABLE_ADDING_IC2_MACERATOR_RECIPES = F;
DISABLE_ALL_IC2_EXTRACTOR_RECIPES = F;
ENABLE_ADDING_IC2_EXTRACTOR_RECIPES = F;
DISABLE_ALL_IC2_COMPRESSOR_RECIPES = F;
ENABLE_ADDING_IC2_COMPRESSOR_RECIPES = F;
DISABLE_ALL_IC2_OREWASHER_RECIPES = F;
ENABLE_ADDING_IC2_OREWASHER_RECIPES = F;
DISABLE_ALL_IC2_CENTRIFUGE_RECIPES = F;
ENABLE_ADDING_IC2_CENTRIFUGE_RECIPES = F;
}
if (ConfigsGT.GREGTECH.get("general", "disable_STDOUT", F))
System.out.close();
if (ConfigsGT.GREGTECH.get("general", "disable_STDERR", F))
System.err.close();
if (ConfigsGT.GREGTECH.get("general", "hardermobspawners", T))
Blocks.mob_spawner.setHardness(500.0F);
if (ConfigsGT.GREGTECH.get("general", "blastresistantmobspawners", T))
Blocks.mob_spawner.setResistance(6000000.0F);
else
Blocks.mob_spawner.setResistance(60);
FIRE_EXPLOSIONS = ConfigsGT.GREGTECH.get("machines", "explode_by_fire", T);
RAIN_EXPLOSIONS = ConfigsGT.GREGTECH.get("machines", "explode_by_rain", T);
WATER_EXPLOSIONS = ConfigsGT.GREGTECH.get("machines", "explode_by_water", T);
THUNDER_EXPLOSIONS = ConfigsGT.GREGTECH.get("machines", "explode_by_thunder", T);
OVERCHARGE_EXPLOSIONS = ConfigsGT.GREGTECH.get("machines", "explode_by_overload", F);
FIRE_BREAKING = ConfigsGT.GREGTECH.get("machines", "break_by_fire", T);
RAIN_BREAKING = ConfigsGT.GREGTECH.get("machines", "break_by_rain", T);
WATER_BREAKING = ConfigsGT.GREGTECH.get("machines", "break_by_water", T);
THUNDER_BREAKING = ConfigsGT.GREGTECH.get("machines", "break_by_thunder", T);
OVERCHARGE_BREAKING = ConfigsGT.GREGTECH.get("machines", "break_by_overload", F);
if (FIRE_EXPLOSIONS)
FIRE_BREAKING = T;
if (RAIN_EXPLOSIONS)
RAIN_BREAKING = T;
if (WATER_EXPLOSIONS)
WATER_BREAKING = T;
if (THUNDER_EXPLOSIONS)
THUNDER_BREAKING = T;
if (OVERCHARGE_EXPLOSIONS)
OVERCHARGE_BREAKING = T;
if (CONFIG_HARDNESS_MULTIPLIER_SAND <= 0.0)
CONFIG_HARDNESS_MULTIPLIER_SAND = 1.0;
if (CONFIG_HARDNESS_MULTIPLIER_ROCK <= 0.0)
CONFIG_HARDNESS_MULTIPLIER_ROCK = 1.0;
if (CONFIG_HARDNESS_MULTIPLIER_ORES <= 0.0)
CONFIG_HARDNESS_MULTIPLIER_ORES = 1.0;
HARDNESS_MULTIPLIER_SAND = CONFIG_HARDNESS_MULTIPLIER_SAND;
HARDNESS_MULTIPLIER_ROCK = CONFIG_HARDNESS_MULTIPLIER_ROCK;
HARDNESS_MULTIPLIER_ORES = CONFIG_HARDNESS_MULTIPLIER_ORES;
if (ConfigsGT.GREGTECH.get("compat", "IC2Classic", T))
ICompat.COMPAT_CLASSES.add((ICompat) UT.Reflection.callConstructor("gregapi.compat.industrialcraft.CompatIC2C", 0, null, D2));
if (ConfigsGT.GREGTECH.get("compat", "IC2EnergyItems", T))
ICompat.COMPAT_CLASSES.add(COMPAT_EU_ITEM = (ICompatIC2EUItem) UT.Reflection.callConstructor("gregapi.compat.industrialcraft.CompatIC2EUItem", 0, null, D2));
if (ConfigsGT.GREGTECH.get("compat", "IndustrialCraft2", T))
ICompat.COMPAT_CLASSES.add(COMPAT_IC2 = (ICompatIC2) UT.Reflection.callConstructor("gregapi.compat.industrialcraft.CompatIC2", 0, null, D2));
if (ConfigsGT.GREGTECH.get("compat", "ThaumCraft", T))
ICompat.COMPAT_CLASSES.add(COMPAT_TC = (ICompatTC) UT.Reflection.callConstructor("gregapi.compat.thaumcraft.CompatTC", 0, null, D2));
if (ConfigsGT.GREGTECH.get("compat", "BuildCraft", T))
ICompat.COMPAT_CLASSES.add(COMPAT_BC = (ICompatBC) UT.Reflection.callConstructor("gregapi.compat.buildcraft.CompatBC", 0, null, D2));
if (ConfigsGT.GREGTECH.get("compat", "ComputerCraft", T))
ICompat.COMPAT_CLASSES.add(COMPAT_CC = (ICompatCC) UT.Reflection.callConstructor("gregapi.compat.computercraft.CompatCC", 0, null, D2));
if (ConfigsGT.GREGTECH.get("compat", "Forestry", T))
ICompat.COMPAT_CLASSES.add(COMPAT_FR = (ICompatFR) UT.Reflection.callConstructor("gregapi.compat.forestry.CompatFR", 0, null, D2));
if (ConfigsGT.GREGTECH.get("compat", "GalactiCraft", T))
ICompat.COMPAT_CLASSES.add(COMPAT_GC = (ICompatGC) UT.Reflection.callConstructor("gregapi.compat.galacticraft.CompatGC", 0, null, D2));
if (MD.TC.mLoaded)
try {
ThaumcraftApi.objectTags.isEmpty();
} catch (NoSuchFieldError e) {
throw new RuntimeException("Please uninstall ThaumicFixer, GregTech-6 itself by now fixes the Thaumometer Lag Issue in a far better and less 'Thaumcraft-Addons breaking' way than Thaumic Fixer.");
}
SHOW_HIDDEN_ITEMS = ConfigsGT.CLIENT.get(ConfigCategories.visibility, "HiddenGTItems", F);
SHOW_HIDDEN_MATERIALS = ConfigsGT.CLIENT.get(ConfigCategories.visibility, "HiddenGTMaterials", F);
SHOW_HIDDEN_PREFIXES = ConfigsGT.CLIENT.get(ConfigCategories.visibility, "HiddenGTPrefixes", F);
SHOW_MICROBLOCKS = ConfigsGT.CLIENT.get(ConfigCategories.visibility, "MicroBlocks", F);
SHOW_BUMBLEBEES = ConfigsGT.CLIENT.get(ConfigCategories.visibility, "Bumblebees", F);
SHOW_ORE_BLOCK_PREFIXES = ConfigsGT.CLIENT.get(ConfigCategories.visibility, "OreBlocks", F);
SHOW_INTERNAL_NAMES = ConfigsGT.CLIENT.get(ConfigCategories.visibility, "InternalNames", F);
SHOW_CHEM_FORMULAS = ConfigsGT.CLIENT.get(ConfigCategories.visibility, "ChemTooltips", T);
ITexture.Util.GT_ALPHA_BLENDING = ConfigsGT.CLIENT.get(ConfigCategories.general, "useGTAlphaBlending", ITexture.Util.GT_ALPHA_BLENDING);
ITexture.Util.MC_ALPHA_BLENDING = ConfigsGT.CLIENT.get(ConfigCategories.general, "useMCAlphaBlending", ITexture.Util.MC_ALPHA_BLENDING);
GT6WorldGenerator.PFAA = (ConfigsGT.WORLDGEN.get(ConfigCategories.general, "AutoDetectPFAA", T) && MD.PFAA.mLoaded && MD.COG.mLoaded);
GT6WorldGenerator.TFC = (ConfigsGT.WORLDGEN.get(ConfigCategories.general, "AutoDetectTFC", T) && (MD.TFC.mLoaded || MD.TFCP.mLoaded));
// Register Crafting Recipe Classes.
RecipeSorter.register("gregtech:shaped", AdvancedCraftingShaped.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped before:minecraft:shapeless");
RecipeSorter.register("gregtech:shapeless", AdvancedCraftingShapeless.class, RecipeSorter.Category.SHAPELESS, "after:gregtech:shaped after:minecraft:shapeless");
RecipeSorter.register("gregtech:1ToY", AdvancedCrafting1ToY.class, RecipeSorter.Category.SHAPELESS, "after:gregtech:shaped after:gregtech:shapeless");
RecipeSorter.register("gregtech:XToY", AdvancedCraftingXToY.class, RecipeSorter.Category.SHAPELESS, "after:gregtech:shaped after:gregtech:1ToY");
RecipeSorter.register("gregtech:tool", AdvancedCraftingTool.class, RecipeSorter.Category.SHAPELESS, "after:gregtech:shaped after:gregtech:XToY");
// A Default Packet Handler for some of the already existing Code. Yes, all those Packets are generalised special cases in order to save on Bandwidth.
// [ +127] = PacketConfig
// [ +126] = PacketPrefix
// [ +125] = PacketItemStackChat
// [+112 to +119] = PacketBlockEvent
// [+104 to +111] = PacketBlockError
// [+ 72 to + 79] = PacketDeathPoint
// [-120 to + 71] = PacketSyncData
// [-128 to -121] = PacketSound
NW_API = new NetworkHandler(MD.GAPI.mID, "GAPI", new PacketConfig(), new PacketPrefix(), new PacketItemStackChat(), new PacketBlockEvent(0), new PacketBlockEvent(1), new PacketBlockEvent(2), new PacketBlockEvent(3), new PacketBlockEvent(4), new PacketBlockEvent(5), new PacketBlockEvent(6), new PacketBlockEvent(7), new PacketBlockError(0), new PacketBlockError(1), new PacketBlockError(2), new PacketBlockError(3), new PacketBlockError(4), new PacketBlockError(5), new PacketBlockError(6), new PacketBlockError(7), new PacketDeathPoint(0), new PacketDeathPoint(1), new PacketDeathPoint(2), new PacketDeathPoint(3), new PacketDeathPoint(4), new PacketDeathPoint(5), new PacketDeathPoint(6), new PacketDeathPoint(7), new PacketSound(0), new PacketSound(1), new PacketSound(2), new PacketSound(3), new PacketSound(4), new PacketSound(5), new PacketSound(6), new PacketSound(7), new PacketSyncDataName(0), new PacketSyncDataName(1), new PacketSyncDataName(2), new PacketSyncDataName(3), new PacketSyncDataName(4), new PacketSyncDataName(5), new PacketSyncDataName(6), new PacketSyncDataName(7), new PacketSyncDataByte(0), new PacketSyncDataByte(1), new PacketSyncDataByte(2), new PacketSyncDataByte(3), new PacketSyncDataByte(4), new PacketSyncDataByte(5), new PacketSyncDataByte(6), new PacketSyncDataByte(7), new PacketSyncDataShort(0), new PacketSyncDataShort(1), new PacketSyncDataShort(2), new PacketSyncDataShort(3), new PacketSyncDataShort(4), new PacketSyncDataShort(5), new PacketSyncDataShort(6), new PacketSyncDataShort(7), new PacketSyncDataInteger(0), new PacketSyncDataInteger(1), new PacketSyncDataInteger(2), new PacketSyncDataInteger(3), new PacketSyncDataInteger(4), new PacketSyncDataInteger(5), new PacketSyncDataInteger(6), new PacketSyncDataInteger(7), new PacketSyncDataLong(0), new PacketSyncDataLong(1), new PacketSyncDataLong(2), new PacketSyncDataLong(3), new PacketSyncDataLong(4), new PacketSyncDataLong(5), new PacketSyncDataLong(6), new PacketSyncDataLong(7), new PacketSyncDataByteArray(0), new PacketSyncDataByteArray(1), new PacketSyncDataByteArray(2), new PacketSyncDataByteArray(3), new PacketSyncDataByteArray(4), new PacketSyncDataByteArray(5), new PacketSyncDataByteArray(6), new PacketSyncDataByteArray(7), new PacketSyncDataIDs(0), new PacketSyncDataIDs(1), new PacketSyncDataIDs(2), new PacketSyncDataIDs(3), new PacketSyncDataIDs(4), new PacketSyncDataIDs(5), new PacketSyncDataIDs(6), new PacketSyncDataIDs(7), new PacketSyncDataByteAndIDs(0), new PacketSyncDataByteAndIDs(1), new PacketSyncDataByteAndIDs(2), new PacketSyncDataByteAndIDs(3), new PacketSyncDataByteAndIDs(4), new PacketSyncDataByteAndIDs(5), new PacketSyncDataByteAndIDs(6), new PacketSyncDataByteAndIDs(7), new PacketSyncDataShortAndIDs(0), new PacketSyncDataShortAndIDs(1), new PacketSyncDataShortAndIDs(2), new PacketSyncDataShortAndIDs(3), new PacketSyncDataShortAndIDs(4), new PacketSyncDataShortAndIDs(5), new PacketSyncDataShortAndIDs(6), new PacketSyncDataShortAndIDs(7), new PacketSyncDataIntegerAndIDs(0), new PacketSyncDataIntegerAndIDs(1), new PacketSyncDataIntegerAndIDs(2), new PacketSyncDataIntegerAndIDs(3), new PacketSyncDataIntegerAndIDs(4), new PacketSyncDataIntegerAndIDs(5), new PacketSyncDataIntegerAndIDs(6), new PacketSyncDataIntegerAndIDs(7), new PacketSyncDataLongAndIDs(0), new PacketSyncDataLongAndIDs(1), new PacketSyncDataLongAndIDs(2), new PacketSyncDataLongAndIDs(3), new PacketSyncDataLongAndIDs(4), new PacketSyncDataLongAndIDs(5), new PacketSyncDataLongAndIDs(6), new PacketSyncDataLongAndIDs(7), new PacketSyncDataByteArrayAndIDs(0), new PacketSyncDataByteArrayAndIDs(1), new PacketSyncDataByteArrayAndIDs(2), new PacketSyncDataByteArrayAndIDs(3), new PacketSyncDataByteArrayAndIDs(4), new PacketSyncDataByteArrayAndIDs(5), new PacketSyncDataByteArrayAndIDs(6), new PacketSyncDataByteArrayAndIDs(7), new PacketSyncDataIDsAndCovers(0), new PacketSyncDataIDsAndCovers(1), new PacketSyncDataIDsAndCovers(2), new PacketSyncDataIDsAndCovers(3), new PacketSyncDataIDsAndCovers(4), new PacketSyncDataIDsAndCovers(5), new PacketSyncDataIDsAndCovers(6), new PacketSyncDataIDsAndCovers(7), new PacketSyncDataByteAndIDsAndCovers(0), new PacketSyncDataByteAndIDsAndCovers(1), new PacketSyncDataByteAndIDsAndCovers(2), new PacketSyncDataByteAndIDsAndCovers(3), new PacketSyncDataByteAndIDsAndCovers(4), new PacketSyncDataByteAndIDsAndCovers(5), new PacketSyncDataByteAndIDsAndCovers(6), new PacketSyncDataByteAndIDsAndCovers(7), new PacketSyncDataShortAndIDsAndCovers(0), new PacketSyncDataShortAndIDsAndCovers(1), new PacketSyncDataShortAndIDsAndCovers(2), new PacketSyncDataShortAndIDsAndCovers(3), new PacketSyncDataShortAndIDsAndCovers(4), new PacketSyncDataShortAndIDsAndCovers(5), new PacketSyncDataShortAndIDsAndCovers(6), new PacketSyncDataShortAndIDsAndCovers(7), new PacketSyncDataIntegerAndIDsAndCovers(0), new PacketSyncDataIntegerAndIDsAndCovers(1), new PacketSyncDataIntegerAndIDsAndCovers(2), new PacketSyncDataIntegerAndIDsAndCovers(3), new PacketSyncDataIntegerAndIDsAndCovers(4), new PacketSyncDataIntegerAndIDsAndCovers(5), new PacketSyncDataIntegerAndIDsAndCovers(6), new PacketSyncDataIntegerAndIDsAndCovers(7), new PacketSyncDataLongAndIDsAndCovers(0), new PacketSyncDataLongAndIDsAndCovers(1), new PacketSyncDataLongAndIDsAndCovers(2), new PacketSyncDataLongAndIDsAndCovers(3), new PacketSyncDataLongAndIDsAndCovers(4), new PacketSyncDataLongAndIDsAndCovers(5), new PacketSyncDataLongAndIDsAndCovers(6), new PacketSyncDataLongAndIDsAndCovers(7), new PacketSyncDataByteArrayAndIDsAndCovers(0), new PacketSyncDataByteArrayAndIDsAndCovers(1), new PacketSyncDataByteArrayAndIDsAndCovers(2), new PacketSyncDataByteArrayAndIDsAndCovers(3), new PacketSyncDataByteArrayAndIDsAndCovers(4), new PacketSyncDataByteArrayAndIDsAndCovers(5), new PacketSyncDataByteArrayAndIDsAndCovers(6), new PacketSyncDataByteArrayAndIDsAndCovers(7), new PacketSyncDataCoverVisuals(0), new PacketSyncDataCoverVisuals(1), new PacketSyncDataCoverVisuals(2), new PacketSyncDataCoverVisuals(3), new PacketSyncDataCoverVisuals(4), new PacketSyncDataCoverVisuals(5), new PacketSyncDataCoverVisuals(6), new PacketSyncDataCoverVisuals(7), new PacketSyncDataByteAndCoverVisuals(0), new PacketSyncDataByteAndCoverVisuals(1), new PacketSyncDataByteAndCoverVisuals(2), new PacketSyncDataByteAndCoverVisuals(3), new PacketSyncDataByteAndCoverVisuals(4), new PacketSyncDataByteAndCoverVisuals(5), new PacketSyncDataByteAndCoverVisuals(6), new PacketSyncDataByteAndCoverVisuals(7), new PacketSyncDataShortAndCoverVisuals(0), new PacketSyncDataShortAndCoverVisuals(1), new PacketSyncDataShortAndCoverVisuals(2), new PacketSyncDataShortAndCoverVisuals(3), new PacketSyncDataShortAndCoverVisuals(4), new PacketSyncDataShortAndCoverVisuals(5), new PacketSyncDataShortAndCoverVisuals(6), new PacketSyncDataShortAndCoverVisuals(7), new PacketSyncDataIntegerAndCoverVisuals(0), new PacketSyncDataIntegerAndCoverVisuals(1), new PacketSyncDataIntegerAndCoverVisuals(2), new PacketSyncDataIntegerAndCoverVisuals(3), new PacketSyncDataIntegerAndCoverVisuals(4), new PacketSyncDataIntegerAndCoverVisuals(5), new PacketSyncDataIntegerAndCoverVisuals(6), new PacketSyncDataIntegerAndCoverVisuals(7), new PacketSyncDataLongAndCoverVisuals(0), new PacketSyncDataLongAndCoverVisuals(1), new PacketSyncDataLongAndCoverVisuals(2), new PacketSyncDataLongAndCoverVisuals(3), new PacketSyncDataLongAndCoverVisuals(4), new PacketSyncDataLongAndCoverVisuals(5), new PacketSyncDataLongAndCoverVisuals(6), new PacketSyncDataLongAndCoverVisuals(7), new PacketSyncDataByteArrayAndCoverVisuals(0), new PacketSyncDataByteArrayAndCoverVisuals(1), new PacketSyncDataByteArrayAndCoverVisuals(2), new PacketSyncDataByteArrayAndCoverVisuals(3), new PacketSyncDataByteArrayAndCoverVisuals(4), new PacketSyncDataByteArrayAndCoverVisuals(5), new PacketSyncDataByteArrayAndCoverVisuals(6), new PacketSyncDataByteArrayAndCoverVisuals(7));
NW_AP2 = new NetworkHandler(MD.GAPI.mID, "GAP2", new PacketSyncDataByte(0), new PacketSyncDataByte(1), new PacketSyncDataByte(2), new PacketSyncDataByte(3), new PacketSyncDataByte(4), new PacketSyncDataByte(5), new PacketSyncDataByte(6), new PacketSyncDataByte(7), new PacketSyncDataShort(0), new PacketSyncDataShort(1), new PacketSyncDataShort(2), new PacketSyncDataShort(3), new PacketSyncDataShort(4), new PacketSyncDataShort(5), new PacketSyncDataShort(6), new PacketSyncDataShort(7), new PacketSyncDataInteger(0), new PacketSyncDataInteger(1), new PacketSyncDataInteger(2), new PacketSyncDataInteger(3), new PacketSyncDataInteger(4), new PacketSyncDataInteger(5), new PacketSyncDataInteger(6), new PacketSyncDataInteger(7), new PacketSyncDataLong(0), new PacketSyncDataLong(1), new PacketSyncDataLong(2), new PacketSyncDataLong(3), new PacketSyncDataLong(4), new PacketSyncDataLong(5), new PacketSyncDataLong(6), new PacketSyncDataLong(7), new PacketSyncDataByteArray(0), new PacketSyncDataByteArray(1), new PacketSyncDataByteArray(2), new PacketSyncDataByteArray(3), new PacketSyncDataByteArray(4), new PacketSyncDataByteArray(5), new PacketSyncDataByteArray(6), new PacketSyncDataByteArray(7), new PacketSyncDataIDs(0), new PacketSyncDataIDs(1), new PacketSyncDataIDs(2), new PacketSyncDataIDs(3), new PacketSyncDataIDs(4), new PacketSyncDataIDs(5), new PacketSyncDataIDs(6), new PacketSyncDataIDs(7), new PacketSyncDataByteAndIDs(0), new PacketSyncDataByteAndIDs(1), new PacketSyncDataByteAndIDs(2), new PacketSyncDataByteAndIDs(3), new PacketSyncDataByteAndIDs(4), new PacketSyncDataByteAndIDs(5), new PacketSyncDataByteAndIDs(6), new PacketSyncDataByteAndIDs(7), new PacketSyncDataShortAndIDs(0), new PacketSyncDataShortAndIDs(1), new PacketSyncDataShortAndIDs(2), new PacketSyncDataShortAndIDs(3), new PacketSyncDataShortAndIDs(4), new PacketSyncDataShortAndIDs(5), new PacketSyncDataShortAndIDs(6), new PacketSyncDataShortAndIDs(7), new PacketSyncDataIntegerAndIDs(0), new PacketSyncDataIntegerAndIDs(1), new PacketSyncDataIntegerAndIDs(2), new PacketSyncDataIntegerAndIDs(3), new PacketSyncDataIntegerAndIDs(4), new PacketSyncDataIntegerAndIDs(5), new PacketSyncDataIntegerAndIDs(6), new PacketSyncDataIntegerAndIDs(7), new PacketSyncDataLongAndIDs(0), new PacketSyncDataLongAndIDs(1), new PacketSyncDataLongAndIDs(2), new PacketSyncDataLongAndIDs(3), new PacketSyncDataLongAndIDs(4), new PacketSyncDataLongAndIDs(5), new PacketSyncDataLongAndIDs(6), new PacketSyncDataLongAndIDs(7), new PacketSyncDataByteArrayAndIDs(0), new PacketSyncDataByteArrayAndIDs(1), new PacketSyncDataByteArrayAndIDs(2), new PacketSyncDataByteArrayAndIDs(3), new PacketSyncDataByteArrayAndIDs(4), new PacketSyncDataByteArrayAndIDs(5), new PacketSyncDataByteArrayAndIDs(6), new PacketSyncDataByteArrayAndIDs(7), new PacketSyncDataIDsAndCovers(0), new PacketSyncDataIDsAndCovers(1), new PacketSyncDataIDsAndCovers(2), new PacketSyncDataIDsAndCovers(3), new PacketSyncDataIDsAndCovers(4), new PacketSyncDataIDsAndCovers(5), new PacketSyncDataIDsAndCovers(6), new PacketSyncDataIDsAndCovers(7), new PacketSyncDataByteAndIDsAndCovers(0), new PacketSyncDataByteAndIDsAndCovers(1), new PacketSyncDataByteAndIDsAndCovers(2), new PacketSyncDataByteAndIDsAndCovers(3), new PacketSyncDataByteAndIDsAndCovers(4), new PacketSyncDataByteAndIDsAndCovers(5), new PacketSyncDataByteAndIDsAndCovers(6), new PacketSyncDataByteAndIDsAndCovers(7), new PacketSyncDataShortAndIDsAndCovers(0), new PacketSyncDataShortAndIDsAndCovers(1), new PacketSyncDataShortAndIDsAndCovers(2), new PacketSyncDataShortAndIDsAndCovers(3), new PacketSyncDataShortAndIDsAndCovers(4), new PacketSyncDataShortAndIDsAndCovers(5), new PacketSyncDataShortAndIDsAndCovers(6), new PacketSyncDataShortAndIDsAndCovers(7), new PacketSyncDataIntegerAndIDsAndCovers(0), new PacketSyncDataIntegerAndIDsAndCovers(1), new PacketSyncDataIntegerAndIDsAndCovers(2), new PacketSyncDataIntegerAndIDsAndCovers(3), new PacketSyncDataIntegerAndIDsAndCovers(4), new PacketSyncDataIntegerAndIDsAndCovers(5), new PacketSyncDataIntegerAndIDsAndCovers(6), new PacketSyncDataIntegerAndIDsAndCovers(7), new PacketSyncDataLongAndIDsAndCovers(0), new PacketSyncDataLongAndIDsAndCovers(1), new PacketSyncDataLongAndIDsAndCovers(2), new PacketSyncDataLongAndIDsAndCovers(3), new PacketSyncDataLongAndIDsAndCovers(4), new PacketSyncDataLongAndIDsAndCovers(5), new PacketSyncDataLongAndIDsAndCovers(6), new PacketSyncDataLongAndIDsAndCovers(7), new PacketSyncDataByteArrayAndIDsAndCovers(0), new PacketSyncDataByteArrayAndIDsAndCovers(1), new PacketSyncDataByteArrayAndIDsAndCovers(2), new PacketSyncDataByteArrayAndIDsAndCovers(3), new PacketSyncDataByteArrayAndIDsAndCovers(4), new PacketSyncDataByteArrayAndIDsAndCovers(5), new PacketSyncDataByteArrayAndIDsAndCovers(6), new PacketSyncDataByteArrayAndIDsAndCovers(7), new PacketSyncDataCoverVisuals(0), new PacketSyncDataCoverVisuals(1), new PacketSyncDataCoverVisuals(2), new PacketSyncDataCoverVisuals(3), new PacketSyncDataCoverVisuals(4), new PacketSyncDataCoverVisuals(5), new PacketSyncDataCoverVisuals(6), new PacketSyncDataCoverVisuals(7), new PacketSyncDataByteAndCoverVisuals(0), new PacketSyncDataByteAndCoverVisuals(1), new PacketSyncDataByteAndCoverVisuals(2), new PacketSyncDataByteAndCoverVisuals(3), new PacketSyncDataByteAndCoverVisuals(4), new PacketSyncDataByteAndCoverVisuals(5), new PacketSyncDataByteAndCoverVisuals(6), new PacketSyncDataByteAndCoverVisuals(7), new PacketSyncDataShortAndCoverVisuals(0), new PacketSyncDataShortAndCoverVisuals(1), new PacketSyncDataShortAndCoverVisuals(2), new PacketSyncDataShortAndCoverVisuals(3), new PacketSyncDataShortAndCoverVisuals(4), new PacketSyncDataShortAndCoverVisuals(5), new PacketSyncDataShortAndCoverVisuals(6), new PacketSyncDataShortAndCoverVisuals(7), new PacketSyncDataIntegerAndCoverVisuals(0), new PacketSyncDataIntegerAndCoverVisuals(1), new PacketSyncDataIntegerAndCoverVisuals(2), new PacketSyncDataIntegerAndCoverVisuals(3), new PacketSyncDataIntegerAndCoverVisuals(4), new PacketSyncDataIntegerAndCoverVisuals(5), new PacketSyncDataIntegerAndCoverVisuals(6), new PacketSyncDataIntegerAndCoverVisuals(7), new PacketSyncDataLongAndCoverVisuals(0), new PacketSyncDataLongAndCoverVisuals(1), new PacketSyncDataLongAndCoverVisuals(2), new PacketSyncDataLongAndCoverVisuals(3), new PacketSyncDataLongAndCoverVisuals(4), new PacketSyncDataLongAndCoverVisuals(5), new PacketSyncDataLongAndCoverVisuals(6), new PacketSyncDataLongAndCoverVisuals(7), new PacketSyncDataByteArrayAndCoverVisuals(0), new PacketSyncDataByteArrayAndCoverVisuals(1), new PacketSyncDataByteArrayAndCoverVisuals(2), new PacketSyncDataByteArrayAndCoverVisuals(3), new PacketSyncDataByteArrayAndCoverVisuals(4), new PacketSyncDataByteArrayAndCoverVisuals(5), new PacketSyncDataByteArrayAndCoverVisuals(6), new PacketSyncDataByteArrayAndCoverVisuals(7));
// Registering the TileEntity used for Meta-Generated Blocks to store the 32000 variations.
GameRegistry.registerTileEntity(PrefixBlockTileEntity.class, "gt.MetaBlockTileEntity");
// Creating and loading the Lang File.
if (CODE_CLIENT) {
tFile = new File(DirectoriesGT.MINECRAFT, "GregTech.lang");
if (!tFile.exists())
tFile = new File(DirectoriesGT.MINECRAFT, "gregtech.lang");
LanguageHandler.sLangFile = new Configuration(tFile);
} else {
sBlockIconload.clear();
sBlockIconload = null;
sItemIconload.clear();
sItemIconload = null;
}
// Creating and loading the Unification Config.
OreDictManager.INSTANCE.mUnificationConfig = new Config("Unification.cfg");
// Initialising the Re-Registrations.
new LoaderOreDictReRegistrations().run();
// Register the Falling MetaBlock Entity.
EntityRegistry.registerModEntity(PrefixBlockFallingEntity.class, "gt.MetaBlockFallingEntity", 0, this, 160, 1, T);
// Initialise Enchantments.
new Enchantment_WerewolfDamage();
new Enchantment_EnderDamage();
new Enchantment_Radioactivity();
new Enchantment_SlimeDamage();
// Initialises the Fluid Display Item.
IL.Display_Fluid.set(new ItemFluidDisplay());
// Initialises the Integrated Circuit Item.
IL.Circuit_Selector.set(new ItemIntegratedCircuit());
// Initialises the Empty Slot Marker Item.
IL.Empty_Slot.set(new ItemEmptySlot());
// Register the GUI Handler.
NetworkRegistry.INSTANCE.registerGuiHandler(this, api_proxy);
// Fixing vanilla Oak Plank Slab Recipe.
CR.remove(ST.make(Blocks.planks, 1, 0), ST.make(Blocks.planks, 1, 1), ST.make(Blocks.planks, 1, 2));
CR.shaped(ST.make(Blocks.wooden_slab, 6, 0), CR.NONE, "WWW", 'W', ST.make(Blocks.planks, 1, 0));
// Preventing a Water Dupe by registering this Recipe early so it won't be overridden
RM.Canner.addRecipe1(T, 16, 16, ST.make(Items.glass_bottle, 1, 0), FL.Water.make(250), NF, ST.make(Items.potionitem, 1, 0));
RM.Canner.addRecipe1(T, 16, 16, ST.make(Items.potionitem, 1, 0), ST.make(Items.glass_bottle, 1, 0));
try {
LoadController tLoadController = ((LoadController) UT.Reflection.getFieldContent(Loader.instance(), "modController", T, T));
List<ModContainer> tModList = tLoadController.getActiveModList(), tNewModsList = new ArrayList<>(tModList.size());
ModContainer tGregTech = null;
for (short i = 0; i < tModList.size(); i++) {
ModContainer tMod = tModList.get(i);
if (tMod.getModId().equalsIgnoreCase(MD.GAPI.mID))
tGregTech = tMod;
else
tNewModsList.add(tMod);
}
if (tGregTech != null)
tNewModsList.add(0, tGregTech);
UT.Reflection.setFieldContent(tLoadController, "activeModList", tNewModsList);
} catch (Throwable e) {
e.printStackTrace(ERR);
}
for (ICompat tCompat : ICompat.COMPAT_CLASSES) try {
tCompat.onPreLoad(aEvent);
} catch (Throwable e) {
e.printStackTrace(ERR);
}
}
use of gregapi.item.ItemFluidDisplay in project AE2FluidCraft-Rework by GlodBlock.
the class GregTech6RecipeExtractor method getOutputIngredients.
@Override
public List<OrderStack<?>> getOutputIngredients(List<PositionedStack> rawOutputs) {
List<PositionedStack> compressed = compress(rawOutputs);
List<OrderStack<?>> tmp = new LinkedList<>();
for (int i = 0; i < compressed.size(); i++) {
if (compressed.get(i) == null)
continue;
ItemStack item = compressed.get(i).items[0];
OrderStack<?> stack;
if (item.getItem() instanceof ItemFluidDisplay) {
FluidStack fluid = ((ItemFluidDisplay) item.getItem()).getFluid(item);
if (fluid == null || fluid.amount <= 0)
continue;
stack = new OrderStack<>(fluid, i);
tmp.add(stack);
} else {
stack = OrderStack.pack(compressed.get(i), i);
if (stack != null)
tmp.add(stack);
}
}
return tmp;
}
Aggregations