diff options
63 files changed, 2430 insertions, 575 deletions
diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml index 25c354b227..c86d8889b7 100644 --- a/.github/workflows/release-tags.yml +++ b/.github/workflows/release-tags.yml @@ -43,3 +43,9 @@ jobs: prerelease: false title: "${{ env.RELEASE_VERSION }}" files: build/libs/*.jar + + - name: Publish to Maven + run: ./gradlew publish + env: + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} diff --git a/.gitignore b/.gitignore index ba4022fb72..860dfaf823 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ whitelist.json *.ipr *.iws src/main/resources/mixins.*.json +*.bat asm /screenshots /world diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000000..a6b5f68cd0 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,3 @@ +# Any Github changes require admin approval +/.github/** @GTNewHorizons/admin + diff --git a/build.gradle b/build.gradle index e466de0fd5..b647108772 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ -//version: 1641429628 +//version: 1642484596 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. -Please check https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle for updates. +Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates. */ @@ -88,6 +88,7 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly") checkPropertyExists("usesShadowedDependencies") checkPropertyExists("developmentEnvironmentUserName") +boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false String javaSourceDir = "src/main/java/" String scalaSourceDir = "src/main/scala/" @@ -151,12 +152,16 @@ configurations.all { // Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version 'git config core.fileMode false'.execute() -// Pulls version from git tag + +// Pulls version first from the VERSION env and then git tag +String identifiedVersion try { - version = minecraftVersion + "-" + gitVersion() + String versionOverride = System.getenv("VERSION") ?: null + identifiedVersion = versionOverride == null ? gitVersion() : versionOverride + version = minecraftVersion + "-" + identifiedVersion } catch (Exception e) { - throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!"); + throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag, or the VERSION override must be set!"); } group = modGroup @@ -223,7 +228,7 @@ dependencies { annotationProcessor("com.google.code.gson:gson:2.8.6") annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT") // using 0.8 to workaround a issue in 0.7 which fails mixin application - compile("org.spongepowered:mixin:0.7.11-SNAPSHOT") { + compile("com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH") { // Mixin includes a lot of dependencies that are too up-to-date exclude module: "launchwrapper" exclude module: "guava" @@ -231,7 +236,7 @@ dependencies { exclude module: "commons-io" exclude module: "log4j-core" } - compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev") + compile("com.github.GTNewHorizons:SpongeMixins:1.5.0") } } @@ -480,7 +485,9 @@ task apiJar(type: Jar) { } artifacts { - archives sourcesJar + if(!noPublishedSources) { + archives sourcesJar + } archives devJar if(apiPackage) { archives apiJar @@ -491,29 +498,28 @@ artifacts { publishing { publications { maven(MavenPublication) { - artifact source: jar - artifact source: sourcesJar, classifier: "src" - artifact source: devJar, classifier: "dev" + artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: "" + if(!noPublishedSources) { + artifact source: sourcesJar, classifier: "src" + } + artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev" if (apiPackage) { artifact source: apiJar, classifier: "api" } - groupId = System.getenv("ARTIFACT_GROUP_ID") ?: group + groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons" artifactId = System.getenv("ARTIFACT_ID") ?: project.name - version = System.getenv("ARTIFACT_VERSION") ?: project.version + // Using the identified version, not project.version as it has the prepended 1.7.10 + version = System.getenv("RELEASE_VERSION") ?: identifiedVersion } } - + repositories { maven { - String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown" - String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown" - String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName" - name = "GitHubPackages" - url = githubRepositoryUrl + url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases" credentials { - username = System.getenv("GITHUB_ACTOR") ?: "NONE" - password = System.getenv("GITHUB_TOKEN") ?: "NONE" + username = System.getenv("MAVEN_USER") ?: "NONE" + password = System.getenv("MAVEN_PASSWORD") ?: "NONE" } } } @@ -537,7 +543,7 @@ if (isNewBuildScriptVersionAvailable(projectDir.toString())) { } static URL availableBuildScriptUrl() { - new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle") + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle") } boolean performBuildScriptUpdate(String projectDir) { @@ -579,7 +585,7 @@ configure(updateBuildScript) { def checkPropertyExists(String propertyName) { if (project.hasProperty(propertyName) == false) { - throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties") + throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties") } } diff --git a/dependencies.gradle b/dependencies.gradle index d961dac3ac..8643003184 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,42 +1,38 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:master-SNAPSHOT:dev") - /*compileOnly("com.github.GTNewHorizons:StructureLib:master-SNAPSHOT:dev") { // Transitive from GT5-Unofficial + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.18:dev") + compile("com.github.GTNewHorizons:StructureLib:1.0.14:dev") + compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.1.22-GTNH:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:NotEnoughItems:master-SNAPSHOT:dev") { // Transitive from GT5-Unofficial + compileOnly("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:CodeChickenLib:master-SNAPSHOT:dev") { // Transitive from GT5-Unofficial - transitive = false - } - compileOnly("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") { // Transitive from GT5-Unofficial - transitive = false - }*/ + compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") compile("curse.maven:cofh-core-69162:2388751") compile("curse.maven:advsolar-362768:2885953") - compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:master-SNAPSHOT:dev") { + compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-70-GTNH:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:Baubles:master-SNAPSHOT:dev") { + compileOnly("com.github.GTNewHorizons:Baubles:1.0.1.14:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:master-SNAPSHOT:dev") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:Railcraft:master-SNAPSHOT:dev") { + compileOnly("com.github.GTNewHorizons:Railcraft:9.13.5:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderIO:master-SNAPSHOT:dev") { + compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.27:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:EnderCore:master-SNAPSHOT:dev") { + compileOnly("com.github.GTNewHorizons:EnderCore:0.2.6:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:SC2:master-SNAPSHOT:dev") { + compileOnly("com.github.GTNewHorizons:SC2:2.0.1:dev") { transitive = false } @@ -49,4 +45,7 @@ dependencies { compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Chisel:2.10.6-GTNH:dev") { + transitive = false + } } diff --git a/repositories.gradle b/repositories.gradle index d88a8fcc74..23d0667ab9 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -2,6 +2,10 @@ repositories { maven { + name = "GTNH Maven" + url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + } + maven { name = "ic2" url = "http://maven.ic2.player.to/" metadataSources { diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java index 9787a38504..1513a0999c 100644 --- a/src/main/java/gtPlusPlus/GTplusplus.java +++ b/src/main/java/gtPlusPlus/GTplusplus.java @@ -228,6 +228,22 @@ public class GTplusplus implements ActionListener { Logger.INFO( "Finally, we are finished. Have some cripsy bacon as a reward." ); + + // Log free GT++ Meta IDs + if (CORE.DEVENV) { + // 750 - 999 are reserved for Alkalus. + for (int i=750; i<1000;i++) { + if (gregtech.api.GregTech_API.METATILEENTITIES[i] == null) { + Logger.INFO("MetaID "+i+" is free."); + } + } + // 30000 - 31999 are reserved for Alkalus. + for (int i=30000; i<32000;i++) { + if (gregtech.api.GregTech_API.METATILEENTITIES[i] == null) { + Logger.INFO("MetaID "+i+" is free."); + } + } + } } @EventHandler diff --git a/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java index 36ea2af7cc..90f9c1056a 100644 --- a/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java +++ b/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java @@ -92,12 +92,7 @@ public class VolumetricFlaskSetter extends BasicTileBlockWithTooltip { @Override public int getRenderBlockPass() { - return 1; - } - - @Override - public boolean isOpaqueCube() { - return false; + return 0; } @Override diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java index 0e88a20aac..2e1d43bdda 100644 --- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java +++ b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java @@ -226,6 +226,8 @@ public class ConfigHandler { pollutionPerSecondMultiMassFabricator = config.get("pollution", "pollutionPerSecondMultiMassFabricator", pollutionPerSecondMultiMassFabricator,"pollution rate in gibbl/s for the Matter fabrication CPU").getInt(pollutionPerSecondMultiMassFabricator); pollutionPerSecondMultiRefinery = config.get("pollution", "pollutionPerSecondMultiRefinery", pollutionPerSecondMultiRefinery,"pollution rate in gibbl/s for the Reactor fuel processing plant").getInt(pollutionPerSecondMultiRefinery); //pollutionPerSecondMultiGeneratorArray; + pollutionPerSecondMultiIndustrialRockBreaker = config.get("pollution", "pollutionPerSecondMultiIndustrialRockBreaker", pollutionPerSecondMultiIndustrialRockBreaker,"pollution rate in gibbl/s for the Industrial Rock Breaker").getInt(pollutionPerSecondMultiIndustrialRockBreaker); + pollutionPerSecondMultiIndustrialChisel = config.get("pollution", "pollutionPerSecondMultiIndustrialChisel", pollutionPerSecondMultiIndustrialChisel,"pollution rate in gibbl/s for the Industrial Chisel").getInt(pollutionPerSecondMultiIndustrialChisel); pollutionPerSecondMultiTreeFarm = config.get("pollution", "pollutionPerSecondMultiTreeFarm", pollutionPerSecondMultiTreeFarm,"pollution rate in gibbl/s for the Tree growth simulator").getInt(pollutionPerSecondMultiTreeFarm); pollutionPerSecondMultiFrothFlotationCell = config.get("pollution", "pollutionPerSecondMultiFrothFlotationCell", pollutionPerSecondMultiFrothFlotationCell,"pollution rate in gibbl/s for the Flotation cell regulator").getInt(pollutionPerSecondMultiFrothFlotationCell); pollutionPerSecondMultiAutoCrafter = config.get("pollution", "pollutionPerSecondMultiAutoCrafter", pollutionPerSecondMultiAutoCrafter,"pollution rate in gibbl/s for the Large-Scale auto assembler v1.01").getInt(pollutionPerSecondMultiAutoCrafter); diff --git a/src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java index de3106c957..65e84d7272 100644 --- a/src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java +++ b/src/main/java/gtPlusPlus/core/container/Container_VolumetricFlaskSetter.java @@ -4,6 +4,7 @@ import java.util.Iterator; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.inventories.Inventory_VolumetricFlaskSetter; import gtPlusPlus.core.slots.SlotNoInput; @@ -24,8 +25,8 @@ public class Container_VolumetricFlaskSetter extends Container { public final Inventory_VolumetricFlaskSetter inventoryChest; - public short mCustomValue; - private short oCustomValue; + public int mCustomValue; + private int oCustomValue; private int mTimer; @@ -181,5 +182,9 @@ public class Container_VolumetricFlaskSetter extends Container { break; } } + + public void log(String aString) { + Logger.INFO("[Flask-Container] "+aString); + } }
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java index 0257e51d0c..512f31dd47 100644 --- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java +++ b/src/main/java/gtPlusPlus/core/gui/machine/GUI_VolumetricFlaskSetter.java @@ -5,13 +5,13 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.container.Container_VolumetricFlaskSetter; import gtPlusPlus.core.gui.widget.GuiValueField; import gtPlusPlus.core.handler.PacketHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.network.packet.Packet_VolumetricFlaskGui; import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter; -import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.util.ResourceLocation; @@ -19,67 +19,203 @@ import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class GUI_VolumetricFlaskSetter extends GuiContainer { - private GuiTextField mText; + private static final ResourceLocation mGuiTextures = new ResourceLocation( + CORE.MODID, "textures/gui/VolumetricFlaskSetter.png" + ); + private Container_VolumetricFlaskSetter mContainer; private boolean mIsOpen = false; + private GuiValueField mText; private TileEntityVolumetricFlaskSetter mTile; - private Container_VolumetricFlaskSetter mContainer; - private static final ResourceLocation mGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/VolumetricFlaskSetter.png"); - public GUI_VolumetricFlaskSetter(Container_VolumetricFlaskSetter aContainer){ + public GUI_VolumetricFlaskSetter(Container_VolumetricFlaskSetter aContainer) { super(aContainer); mContainer = aContainer; mTile = mContainer.mTileEntity; } - public void initGui(){ + @Override + protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(mGuiTextures); + final int x = (this.width - this.xSize) / 2; + final int y = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + } + + @Override + protected void drawGuiContainerForegroundLayer(final int i, final int j) { + super.drawGuiContainerForegroundLayer(i, j); + this.mText.drawTextBox(); + this.fontRendererObj.drawString( + I18n.format("container.VolumetricFlaskSetter", new Object[0]), 4, 3, 4210752 + ); + int aYVal = 49; + this.fontRendererObj.drawString( + I18n.format("0 = 16l", new Object[0]), 8, aYVal, 4210752 + ); + this.fontRendererObj.drawString( + I18n.format("4 = 576l", new Object[0]), 64, aYVal, 4210752 + ); + this.fontRendererObj.drawString( + I18n.format("1 = 36l", new Object[0]), 8, aYVal += 8, 4210752 + ); + this.fontRendererObj.drawString( + I18n.format("5 = 720l", new Object[0]), 64, aYVal, 4210752 + ); + this.fontRendererObj.drawString( + I18n.format("2 = 144l", new Object[0]), 8, aYVal += 8, 4210752 + ); + this.fontRendererObj.drawString( + I18n.format("6 = 864l", new Object[0]), 64, aYVal, 4210752 + ); + this.fontRendererObj.drawString( + I18n.format("3 = 432l", new Object[0]), 8, aYVal += 8, 4210752 + ); + this.fontRendererObj.drawString( + I18n.format("-> = Custom", new Object[0]), 59, aYVal, 4210752 + ); + + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + super.drawScreen(par1, par2, par3); + } + + protected String getText() { + return this.mText.getText(); + } + + public void initGui() { super.initGui(); - Keyboard.enableRepeatEvents(true); + // Keyboard.enableRepeatEvents(true); mIsOpen = true; - this.mText = new GuiValueField(this.fontRendererObj, 26, 31, this.width / 2 - 62, this.height/2-52, 106, 14); + this.mText = new GuiValueField( + this.fontRendererObj, 26, 31, this.width / 2 + - 62, this.height / 2 - 52, 106, 14, this + ); mText.setMaxStringLength(5); mText.setEnableBackgroundDrawing(true); mText.setText("0"); mText.setFocused(true); } - protected void keyTyped(char par1, int par2){ + public boolean isNumber(char c) { + boolean isNum = ((c >= 48 && c <= 57) || c == 45); + if (isNum) { + log("Found Digit: "+c+" | char value"); + } + else { + switch (c) { + case '0' : + case '1' : + case '2' : + case '3' : + case '4' : + case '5' : + case '6' : + case '7' : + case '8' : + case '9' : + log("Found Digit: "+c+" | char switch"); + return true; + } + } + return isNum; + } + + public boolean isNumber(int c) { + switch (c) { + case Keyboard.KEY_0 : + case Keyboard.KEY_1 : + case Keyboard.KEY_2 : + case Keyboard.KEY_3 : + case Keyboard.KEY_4 : + case Keyboard.KEY_5 : + case Keyboard.KEY_6 : + case Keyboard.KEY_7 : + case Keyboard.KEY_8 : + case Keyboard.KEY_9 : + case Keyboard.KEY_NUMPAD0 : + case Keyboard.KEY_NUMPAD1 : + case Keyboard.KEY_NUMPAD2 : + case Keyboard.KEY_NUMPAD3 : + case Keyboard.KEY_NUMPAD4 : + case Keyboard.KEY_NUMPAD5 : + case Keyboard.KEY_NUMPAD6 : + case Keyboard.KEY_NUMPAD7 : + case Keyboard.KEY_NUMPAD8 : + case Keyboard.KEY_NUMPAD9 : + log("Found Digit: "+Keyboard.getKeyName(c)+" | LWJGL Keybinding"); + return true; + } + return false; + } + + protected void keyTyped(char par1, int par2) { if (mIsOpen) { + log("Pressed " + par1 + " | " + par2); if (mText.isFocused()) { + log("Text box has focus."); if (par2 == Keyboard.KEY_RETURN) { - if (mText.isFocused()) { - mText.setFocused(false); - } + log("Pressed Enter, unfocusing."); + mText.setFocused(false); } else if (par2 == Keyboard.KEY_BACK) { + log("Pressed Backspace."); String aCurrentText = getText(); if (aCurrentText.length() > 0) { - this.mText.setText(aCurrentText.substring(0, aCurrentText.length() - 1)); + this.mText.setText( + aCurrentText.substring( + 0, aCurrentText.length() - 1 + ) + ); if (getText().length() <= 0) { - this.mText.setText("0"); + setText(0); } sendUpdateToServer(); } } else { - if (isNumber(par1)) { - if (this.mText.getText().equals("0")) { - this.mText.setText(""+par1); + if (isNumber(par2) || isNumber(par1)) { + log("Pressed number."); + if (this.mText.getText().equals("0")) { + this.mText.textboxKeyTyped(par1, par2); sendUpdateToServer(); } else { - this.mText.textboxKeyTyped(par1, par2); - sendUpdateToServer(); + this.mText.textboxKeyTyped(par1, par2); + sendUpdateToServer(); } } else { - super.keyTyped(par1, par2); + log("Pressed unused key."); + super.keyTyped(par1, par2); } - } + } } else { - super.keyTyped(par1, par2); + log("Text box not focused."); + super.keyTyped(par1, par2); } } + else { + log("Gui is not open?"); + } + } + + protected void mouseClicked(int x, int y, int btn) { + if (mIsOpen) { + log("Clicked."); + this.mText.mouseClicked(x, y, btn); + if (!mText.didClickInTextField(x, y)) { + log("Did not click in text box, passing to super."); + super.mouseClicked(x, y, btn); + } + } + else { + log("Gui is not open?"); + } } @Override @@ -88,10 +224,29 @@ public class GUI_VolumetricFlaskSetter extends GuiContainer { mText.setEnabled(false); mText.setVisible(false); super.onGuiClosed(); - Keyboard.enableRepeatEvents(false); + // Keyboard.enableRepeatEvents(false); + } + + public int parse(String aValue) { + try { + return Integer.parseInt(getText()); + } + catch (NumberFormatException e) { + return 0; + } + } + + public void sendUpdateToServer() { + if (getText().length() > 0) { + PacketHandler.sendToServer(new Packet_VolumetricFlaskGui(mTile, parse(getText()))); + } + } + + public void setText(int aValue) { + this.mText.setText("" + aValue); } - public void updateScreen(){ + public void updateScreen() { super.updateScreen(); // Update Textbox to 0 if Empty if (getText().length() <= 0) { @@ -101,83 +256,19 @@ public class GUI_VolumetricFlaskSetter extends GuiContainer { this.mText.updateCursorCounter(); // Check TextBox Value is correct - short aCustomValue = 0; if (getText().length() > 0) { - try { - aCustomValue = Short.parseShort(getText()); - short aTileValue = ((Container_VolumetricFlaskSetter) mContainer).mCustomValue; - if (mContainer != null) { - if (aTileValue != aCustomValue){ - this.mText.setText(""+aTileValue); - } + int aCustomValue = parse(getText()); + int aTileValue = ((Container_VolumetricFlaskSetter) mContainer).mCustomValue; + if (mContainer != null) { + if (aTileValue != aCustomValue) { + setText(aTileValue); } - } catch (NumberFormatException ex) { - } - } - } - - public void drawScreen(int par1, int par2, float par3){ - this.drawDefaultBackground(); - super.drawScreen(par1, par2, par3); - - - } - - protected void mouseClicked(int x, int y, int btn) { - if (mIsOpen) { - super.mouseClicked(x, y, btn); - this.mText.mouseClicked(x, y, btn); } } - - - - @Override - protected void drawGuiContainerForegroundLayer(final int i, final int j){ - super.drawGuiContainerForegroundLayer(i, j); - this.mText.drawTextBox(); - this.fontRendererObj.drawString(I18n.format("container.VolumetricFlaskSetter", new Object[0]), 4, 3, 4210752); - int aYVal = 49; - this.fontRendererObj.drawString(I18n.format("0 = 16l", new Object[0]), 8, aYVal, 4210752); - this.fontRendererObj.drawString(I18n.format("4 = 576l", new Object[0]), 64, aYVal, 4210752); - this.fontRendererObj.drawString(I18n.format("1 = 36l", new Object[0]), 8, aYVal+=8, 4210752); - this.fontRendererObj.drawString(I18n.format("5 = 720l", new Object[0]), 64, aYVal, 4210752); - this.fontRendererObj.drawString(I18n.format("2 = 144l", new Object[0]), 8, aYVal+=8, 4210752); - this.fontRendererObj.drawString(I18n.format("6 = 864l", new Object[0]), 64, aYVal, 4210752); - this.fontRendererObj.drawString(I18n.format("3 = 432l", new Object[0]), 8, aYVal+=8, 4210752); - this.fontRendererObj.drawString(I18n.format("-> = Custom", new Object[0]), 59, aYVal, 4210752); - - } - - @Override - protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){ - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - this.mc.renderEngine.bindTexture(mGuiTextures); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } - - public boolean isNumber(char c) { - return ((c >= 48 && c <= 57) || c == 45); - } - - protected String getText() { - return this.mText.getText(); - } - - protected void sendUpdateToServer() { - short aCustomValue = 0; - if (getText().length() > 0) { - try { - aCustomValue = Short.parseShort(getText()); - PacketHandler.sendToServer(new Packet_VolumetricFlaskGui(mTile, aCustomValue)); - } catch (NumberFormatException ex) { - - } - } + public void log(String aString) { + Logger.INFO("[Flask-GUI] "+aString); } -}
\ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java b/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java index ac4c1a8aee..c9c294ea1c 100644 --- a/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java +++ b/src/main/java/gtPlusPlus/core/gui/widget/GuiValueField.java @@ -2,7 +2,9 @@ package gtPlusPlus.core.gui.widget; import java.lang.reflect.Field; +import gtPlusPlus.core.gui.machine.GUI_VolumetricFlaskSetter; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.preloader.DevHelper; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiTextField; @@ -11,76 +13,86 @@ public class GuiValueField extends GuiTextField { private final FontRenderer mFontRenderer; private final int mScreenLocationX; private final int mScreenLocationY; - - public GuiValueField(FontRenderer aFontRenderer, int aX, int aY, int aScreenLocationX, int aScreenLocationY, int aWidth, int aHeight) { + private final GUI_VolumetricFlaskSetter mGUI; + + public GuiValueField(FontRenderer aFontRenderer, int aX, int aY, int aScreenLocationX, int aScreenLocationY, int aWidth, int aHeight, GUI_VolumetricFlaskSetter aGUI) { super(aFontRenderer, aX, aY, aWidth, aHeight); mFontRenderer = aFontRenderer; mScreenLocationX = aScreenLocationX; mScreenLocationY = aScreenLocationY; + mGUI = aGUI; } - - public boolean canLoseFocus() { - Field canLoseFocus = ReflectionUtils.getField(GuiTextField.class, "canLoseFocus"); + + public boolean canLoseFocus() { + Field canLoseFocus = ReflectionUtils.getField(GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146212_n" : "canLoseFocus"); if (canLoseFocus != null) { return (boolean) ReflectionUtils.getFieldValue(canLoseFocus, this); } return true; } - + + @Override public boolean isFocused() { - Field isFocused = ReflectionUtils.getField(GuiTextField.class, "isFocused"); - if (isFocused != null) { - return (boolean) ReflectionUtils.getFieldValue(isFocused, this); - } - return false; + return super.isFocused(); } - + public boolean isBackgroundDrawingEnabled() { - Field enableBackgroundDrawing = ReflectionUtils.getField(GuiTextField.class, "enableBackgroundDrawing"); + Field enableBackgroundDrawing = ReflectionUtils.getField(GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146215_m" : "enableBackgroundDrawing"); if (enableBackgroundDrawing != null) { return (boolean) ReflectionUtils.getFieldValue(enableBackgroundDrawing, this); } return true; } + public int getLineScrollOffset() { - Field lineScrollOffset = ReflectionUtils.getField(GuiTextField.class, "lineScrollOffset"); + Field lineScrollOffset = ReflectionUtils.getField(GuiTextField.class, DevHelper.isObfuscatedEnvironment() ? "field_146225_q" : "lineScrollOffset"); if (lineScrollOffset != null) { return (int) ReflectionUtils.getFieldValue(lineScrollOffset, this); } return 0; } - - /** - * Args: x, y, buttonClicked - */ - public void mouseClicked(int aX, int aY, int aButton){ - - boolean flag = aX >= this.mScreenLocationX && aX < this.mScreenLocationX + this.width && aY >= this.mScreenLocationY && aY < this.mScreenLocationY + this.height; - //Logger.INFO("Clicked X:"+aX); - //Logger.INFO("Clicked Y:"+aY); - //Logger.INFO("ScreenPos X:"+mScreenLocationX); - //Logger.INFO("ScreenPos Y:"+mScreenLocationY); - //Logger.INFO("Render X:"+xPosition); - //Logger.INFO("Render Y:"+yPosition); - - if (canLoseFocus()) - { - this.setFocused(flag); - } - - if (isFocused() && aButton == 0) - { - int l = aX - this.mScreenLocationX; + public boolean didClickInTextField(int aX, int aY) { + mGUI.log("Clicked at X:"+aX+", Y:"+aY); + boolean aDidClick = aX >= this.mScreenLocationX && aX < this.mScreenLocationX + this.width && aY >= this.mScreenLocationY && aY < this.mScreenLocationY + this.height; + mGUI.log("Did click in textbox? "+aDidClick); + mGUI.log("Expected Region: X:"+mScreenLocationX+"-"+(this.mScreenLocationX + this.width)); + mGUI.log("Expected Region: Y:"+mScreenLocationY+"-"+(this.mScreenLocationY + this.height)); + return aDidClick; + } - if (isBackgroundDrawingEnabled()) - { - l -= 4; - } + /** + * Args: x, y, buttonClicked + */ + @Override + public void mouseClicked(int aX, int aY, int aButton){ + boolean aDidClick = didClickInTextField(aX, aY); - String s = this.mFontRenderer.trimStringToWidth(this.getText().substring(getLineScrollOffset()), this.getWidth()); - this.setCursorPosition(this.mFontRenderer.trimStringToWidth(s, l).length() + getLineScrollOffset()); - } - } + mGUI.log("Did click inside text box? "+aDidClick); + mGUI.log("Focus 1: "+this.isFocused()); + this.setFocused(aDidClick); + mGUI.log("Focus 2: "+this.isFocused()); + if (isFocused()) { + int l = aX - this.mScreenLocationX; + if (isBackgroundDrawingEnabled()) { + l -= 4; + } + if (aButton == 0) { + mGUI.log("Left clicked in text box."); + String s = this.mFontRenderer.trimStringToWidth(this.getText().substring(getLineScrollOffset()), this.getWidth()); + this.setCursorPosition(this.mFontRenderer.trimStringToWidth(s, l).length() + getLineScrollOffset()); + } + else if (aButton == 1) { + mGUI.log("Right clicked in text box."); + mGUI.setText(0); + mGUI.sendUpdateToServer(); + String s = this.mFontRenderer.trimStringToWidth(this.getText().substring(getLineScrollOffset()), this.getWidth()); + this.setCursorPosition(this.mFontRenderer.trimStringToWidth(s, l).length() + getLineScrollOffset()); + } + } + else { + mGUI.log("Clicked, but no focus."); + } + } } diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index b55001f1c2..1db54a4933 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -162,6 +162,8 @@ public class COMPAT_HANDLER { GregtechIndustrialForgeHammer.run(); GregtechMolecularTransformer.run(); GregtechIndustrialElementDuplicator.run(); + GregtechIndustrialRockBreaker.run(); + GregtechIndustrialChisel.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index fd3d8c7a2b..4004ab2724 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -14,6 +14,7 @@ import gtPlusPlus.core.common.compat.COMPAT_Baubles; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.*; import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes; +import gtPlusPlus.core.item.base.cell.BaseItemCell; import gtPlusPlus.core.item.base.dusts.BaseItemDust; import gtPlusPlus.core.item.base.foil.BaseItemFoil; import gtPlusPlus.core.item.base.foods.BaseItemFood; @@ -203,6 +204,8 @@ public final class ModItems { public static Item dustIgnis; public static Item dustTerra; public static Item dustAqua; + + public static Item cellHydrogenChlorideMix; public static BaseEuItem metaItem2; @@ -695,7 +698,10 @@ public final class ModItems { dustAer = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AER, true)[0]; dustIgnis = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().IGNIS, true)[0]; dustTerra = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().TERRA, true)[0]; - dustAqua = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AQUA, true)[0]; + dustAqua = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AQUA, true)[0]; + + ItemUtils.generateSpecialUseDusts(MISC_MATERIALS.WOODS_GLASS, false); + cellHydrogenChlorideMix = new BaseItemCell("hydrogenchloridemix", "Hydrogen Chloride Mix", MISC_MATERIALS.HYDROGEN_CHLORIDE.getRGB()); //Nuclear Fuel Dusts dustLithiumCarbonate = ItemUtils.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", "Li2CO3", Utils.rgbtoHexValue(240, 240, 240))[0]; //https://en.wikipedia.org/wiki/Lithium_carbonate diff --git a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java index 688483b831..ad47adcf64 100644 --- a/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java +++ b/src/main/java/gtPlusPlus/core/item/base/cell/BaseItemCell.java @@ -12,6 +12,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import ic2.core.Ic2Items; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; public class BaseItemCell extends BaseItemComponent{ @@ -26,7 +27,10 @@ public class BaseItemCell extends BaseItemComponent{ public BaseItemCell(final String unlocalName, final String localName, final short[] RGBa) { super(unlocalName, localName, RGBa); this.fluidColour = RGBa; - FluidContainerRegistry.registerFluidContainer(FluidUtils.getFluidStack(unlocalName.toLowerCase(), 0), ItemUtils.getSimpleStack(this), Ic2Items.cell.copy()); + FluidStack aFluid = FluidUtils.getFluidStack(unlocalName.toLowerCase(), 1000); + if (aFluid != null) { + FluidContainerRegistry.registerFluidContainer(aFluid, ItemUtils.getSimpleStack(this), Ic2Items.cell.copy()); + } } public BaseItemCell(final String unlocalName, final String localName, final short[] RGBa, final Fluid cellFluid) { diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java index a42d179f65..43bd669829 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -103,6 +103,7 @@ public class GenericChem extends ItemPackage { public static ItemStack mPurpleCatalyst; public static ItemStack mBrownCatalyst; public static ItemStack mPinkCatalyst; + public static ItemStack mFormaldehydeCatalyst; public static ItemStack mMillingBallAlumina; public static ItemStack mMillingBallSoapstone; @@ -151,6 +152,7 @@ public class GenericChem extends ItemPackage { mSodiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 10, 1); mPotassiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 11, 1); mPotassiumHydroxide = ItemUtils.simpleMetaStack(mGenericChemItem1, 12, 1); + mFormaldehydeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 13, 1); } @@ -169,6 +171,7 @@ public class GenericChem extends ItemPackage { ItemUtils.addItemToOreDictionary(mSodiumEthylXanthate, "dustSodiumEthylXanthate"); ItemUtils.addItemToOreDictionary(mPotassiumEthylXanthate, "dustPotassiumEthylXanthate"); ItemUtils.addItemToOreDictionary(mPotassiumHydroxide, "dustPotassiumHydroxide"); + ItemUtils.addItemToOreDictionary(mFormaldehydeCatalyst, "catalystFormaldehyde"); } @@ -289,6 +292,7 @@ public class GenericChem extends ItemPackage { recipeCatalystPurple(); recipeCatalystBrown(); recipeCatalystPink(); + recipeCatalystFormaldehyde(); recipeGrindingBallAlumina(); recipeGrindingBallSoapstone(); @@ -773,6 +777,20 @@ public class GenericChem extends ItemPackage { 2000); } + + private void recipeCatalystFormaldehyde() { + // Assembly Recipe + CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { + getTierThreeChip(), + CI.getEmptyCatalyst(4), + ItemUtils.getSimpleStack(RocketFuels.Formaldehyde_Catalyst_Dust, 8) + }, + GT_Values.NF, + ItemUtils.getSimpleStack(mFormaldehydeCatalyst, 4), + 30 * 20, + 240); + + } private void recipeCadaverineAndPutrescine() { diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java index b96e0c76ea..c9c5ca98f6 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -54,7 +54,7 @@ public class RocketFuels extends ItemPackage { public static Fluid Monomethylhydrazine_Plus_Nitric_Acid; public static Item Ammonium_Nitrate_Dust; - public static Item Formaldehyde_Catalyst; + public static Item Formaldehyde_Catalyst_Dust; public static ItemStack Formaldehyde_Catalyst_Stack; public RocketFuels() { @@ -246,7 +246,7 @@ public class RocketFuels extends ItemPackage { CORE.RA.addChemicalPlantRecipe( new ItemStack[] { CI.getNumberedAdvancedCircuit(21), - ItemUtils.getSimpleStack(Formaldehyde_Catalyst, 0), + ItemUtils.getSimpleStack(GenericChem.mFormaldehydeCatalyst, 0), }, new FluidStack[] { FluidUtils.getFluidStack("oxygen", 16000), @@ -273,7 +273,7 @@ public class RocketFuels extends ItemPackage { null, null, null, - ItemUtils.getSimpleStack(Formaldehyde_Catalyst, 4), + ItemUtils.getSimpleStack(Formaldehyde_Catalyst_Dust, 4), 160, 30); @@ -284,7 +284,7 @@ public class RocketFuels extends ItemPackage { CORE.RA.addChemicalPlantRecipe( new ItemStack[] { CI.getNumberedAdvancedCircuit(21), - ItemUtils.getSimpleStack(Formaldehyde_Catalyst, 0), + ItemUtils.getSimpleStack(GenericChem.mFormaldehydeCatalyst, 0), }, new FluidStack[] { FluidUtils.getFluidStack("fluid.hydrazine", 2000), @@ -492,8 +492,8 @@ public class RocketFuels extends ItemPackage { @Override public void items() { - Formaldehyde_Catalyst = ItemUtils.generateSpecialUseDusts("FormaldehydeCatalyst", "Formaldehyde Catalyst", "Fe16V1", Utils.rgbtoHexValue(25, 5, 25))[0]; - Formaldehyde_Catalyst_Stack = ItemUtils.getSimpleStack(Formaldehyde_Catalyst); + Formaldehyde_Catalyst_Dust = ItemUtils.generateSpecialUseDusts("FormaldehydeCatalyst", "Formaldehyde Catalyst", "Fe16V1", Utils.rgbtoHexValue(25, 5, 25))[0]; + Formaldehyde_Catalyst_Stack = ItemUtils.getSimpleStack(Formaldehyde_Catalyst_Dust); } @Override diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java index 9a00b49342..c763a1a434 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java @@ -23,7 +23,7 @@ public class ItemGenericChemBase extends Item { final protected IIcon base[]; - final private int aMetaSize = 13; + final private int aMetaSize = 14; /* * 0 - Red Metal Catalyst //FeCu @@ -39,6 +39,7 @@ public class ItemGenericChemBase extends Item { * 10 - Sodium Ethyl Xanthate //CH3CH2ONa + CS2 → CH3CH2OCS2Na * 11 - Potassium Ethyl Xanthate //CH3CH2OH + CS2 + KOH → CH3CH2OCS2K + H2O * 12 - Potassium Hydroxide // KOH + * 13 - Formaldehyde Catalyst //Fe16V1 */ public ItemGenericChemBase() { diff --git a/src/main/java/gtPlusPlus/core/lib/CORE.java b/src/main/java/gtPlusPlus/core/lib/CORE.java index bb0df9d5fb..463a10258a 100644 --- a/src/main/java/gtPlusPlus/core/lib/CORE.java +++ b/src/main/java/gtPlusPlus/core/lib/CORE.java @@ -302,6 +302,8 @@ public class CORE { public static int pollutionPerSecondMultiThermalBoiler = 700; public static int pollutionPerSecondMultiMolecularTransformer = 1000; public static int pollutionPerSecondMultiAlgaePond = 0; + public static int pollutionPerSecondMultiIndustrialRockBreaker = 100; + public static int pollutionPerSecondMultiIndustrialChisel = 50; //pollution single blocks public static int basePollutionPerSecondSemiFluidGenerator = 40; public static double[] pollutionReleasedByTierSemiFluidGenerator = new double[]{0,2.0,4.0,8.0}; diff --git a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java index 8d20f2ff67..9f5882c5ea 100644 --- a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java +++ b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java @@ -62,11 +62,11 @@ public class LoadedMods { public static boolean CropsPlusPlus = false; //Barts Crop Mod public static boolean Reliquary = false; public static boolean SpiceOfLife = false; + public static boolean RemoteIO = false; public static boolean BartWorks = false; public static boolean GoodGenerator = false; private static int totalMods; - @SuppressWarnings("deprecation") public static void checkLoaded(){ Logger.INFO("Looking for optional mod prereqs."); @@ -179,7 +179,7 @@ public class LoadedMods { OpenBlocks = true; Logger.INFO("Components enabled for: OpenBlocks"); totalMods++; - } + } if (isModLoaded("Thaumcraft")){ Thaumcraft = true; Logger.INFO("Components enabled for: Thaumcraft"); @@ -345,6 +345,11 @@ public class LoadedMods { Witchery = true; Logger.INFO("Components enabled for: Witchery"); totalMods++; + } + if (isModLoaded("RIO")){ + RemoteIO = true; + Logger.INFO("Components enabled for: RemoteIO"); + totalMods++; } Logger.INFO("Content found for "+totalMods+" mods"); diff --git a/src/main/java/gtPlusPlus/core/material/ELEMENT.java b/src/main/java/gtPlusPlus/core/material/ELEMENT.java index 54af01ef6e..01d3fd5330 100644 --- a/src/main/java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/main/java/gtPlusPlus/core/material/ELEMENT.java @@ -236,13 +236,14 @@ public final class ELEMENT { 0, false, new MaterialStack[]{ - new MaterialStack(getInstance().OXYGEN, 30), - new MaterialStack(getInstance().IRON, 20), - new MaterialStack(getInstance().SILICONDIOXIDE, 20), - new MaterialStack(getInstance().ALUMINIUMOXIDE, 10), - new MaterialStack(getInstance().POTASSIUM, 10), - new MaterialStack(getInstance().CALCIUM, 5), - new MaterialStack(getInstance().SODIUM, 5) + new MaterialStack(getInstance().OXYGEN, 16), + new MaterialStack(getInstance().IRON, 10), + new MaterialStack(getInstance().SILICONDIOXIDE, 10), + new MaterialStack(getInstance().ALUMINIUMOXIDE, 6), + new MaterialStack(getInstance().POTASSIUM, 6), + new MaterialStack(getInstance().CALCIUM, 4), + new MaterialStack(getInstance().SODIUM, 4), + new MaterialStack(getInstance().YTTERBIUM, 2) });//Not a GT Inherited Material public static final Material RUNITE = new Material("Runite", MaterialState.SOLID, TextureSet.SET_FINE, new short[] {60, 200, 190}, 6750, 11550, 73, 87, true, "§", 0);//Not a GT Inherited Material diff --git a/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java index 47ac6b170e..31ad5e466b 100644 --- a/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -185,6 +185,26 @@ public final class MISC_MATERIALS { new MaterialStack(ELEMENT.getInstance().CARBON, 1), new MaterialStack(ELEMENT.getInstance().OXYGEN, 2) }); + + public static final Material WOODS_GLASS = new Material( + "Wood's Glass", //Material Name + MaterialState.SOLID, //State + TextureSets.GEM_A.get(), //Texture Set + new short[] {220, 60, 255}, //Material Colour + -1, + -1, + -1, + -1, + false, + "Si4Ba3Na2Ni", + 0, + false, + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().SILICON, 40), + new MaterialStack(ELEMENT.getInstance().BARIUM, 30), + new MaterialStack(ELEMENT.getInstance().SODIUM, 20), + new MaterialStack(ELEMENT.getInstance().NICKEL, 10), + }); /* diff --git a/src/main/java/gtPlusPlus/core/material/ORES.java b/src/main/java/gtPlusPlus/core/material/ORES.java index 0186c23a07..82757b2ee6 100644 --- a/src/main/java/gtPlusPlus/core/material/ORES.java +++ b/src/main/java/gtPlusPlus/core/material/ORES.java @@ -486,10 +486,11 @@ public final class ORES { -1, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 3), new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 2), new MaterialStack(ELEMENT.getInstance().DYSPROSIUM, 2), new MaterialStack(ELEMENT.getInstance().URANIUM235, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN,32), + new MaterialStack(ELEMENT.getInstance().OXYGEN,29), new MaterialStack(ELEMENT.getInstance().HYDROGEN, 24) }); diff --git a/src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java b/src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java index 460b29e802..c77db21800 100644 --- a/src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java +++ b/src/main/java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java @@ -68,6 +68,13 @@ public class LOADER_Machine_Components { CI.sensor_HV = ItemList.Sensor_HV.get(1); CI.sensor_EV = ItemList.Sensor_EV.get(1); CI.sensor_IV = ItemList.Sensor_IV.get(1); + if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + CI.fluidRegulator_LV = ItemUtils.getValueOfItemList("FluidRegulator_LV", ItemList.Pump_LV).get(1); + CI.fluidRegulator_MV = ItemUtils.getValueOfItemList("FluidRegulator_MV", ItemList.Pump_MV).get(1); + CI.fluidRegulator_HV = ItemUtils.getValueOfItemList("FluidRegulator_HV", ItemList.Pump_HV).get(1); + CI.fluidRegulator_EV = ItemUtils.getValueOfItemList("FluidRegulator_EV", ItemList.Pump_EV).get(1); + CI.fluidRegulator_IV = ItemUtils.getValueOfItemList("FluidRegulator_IV", ItemList.Pump_IV).get(1); + } } private static void registerGTExperimentalComponents(){ @@ -96,7 +103,13 @@ public class LOADER_Machine_Components { CI.sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1); CI.sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1); CI.sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1); - + + if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + CI.fluidRegulator_LuV = ItemUtils.getValueOfItemList("FluidRegulator_LuV", ItemList.Pump_LuV).get(1); + CI.fluidRegulator_ZPM = ItemUtils.getValueOfItemList("FluidRegulator_ZPM", ItemList.Pump_ZPM).get(1); + CI.fluidRegulator_UV = ItemUtils.getValueOfItemList("FluidRegulator_UV", ItemList.Pump_UV).get(1); + } + registerComponentsULV(); registerComponentsMAX(); } @@ -135,6 +148,12 @@ public class LOADER_Machine_Components { CI.sensor_UV = GregtechItemList.Sensor_UV.get(1); CI.sensor_MAX = GregtechItemList.Sensor_MAX.get(1); + if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + CI.fluidRegulator_LuV = ItemUtils.getValueOfItemList("FluidRegulator_LuV", ItemList.Pump_LuV).get(1); + CI.fluidRegulator_ZPM = ItemUtils.getValueOfItemList("FluidRegulator_ZPM", ItemList.Pump_ZPM).get(1); + CI.fluidRegulator_UV = ItemUtils.getValueOfItemList("FluidRegulator_UV", ItemList.Pump_UV).get(1); + } + registerComponentsULV(); } @@ -171,6 +190,12 @@ public class LOADER_Machine_Components { CI.sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1); CI.sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1); CI.sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1); + + if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + CI.fluidRegulator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32665, 1); + CI.fluidRegulator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32666, 1); + CI.fluidRegulator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32667, 1); + } // Thanks 0lafe CI.electricMotor_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32596, 1); diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index bca1ceea68..e8a681b5ab 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -91,6 +91,7 @@ public class RECIPES_GREGTECH { fluidheaterRecipes(); chemplantRecipes(); packagerRecipes(); + alloySmelterRecipes(); implosionRecipes(); @@ -107,7 +108,15 @@ public class RECIPES_GREGTECH { addFuels(); } - + private static void alloySmelterRecipes() { + + //Wood's Glass Laser Lens + GT_Values.RA.addAlloySmelterRecipe( + MISC_MATERIALS.WOODS_GLASS.getDust(5), + ItemList.Shape_Mold_Ball.get(0), + GregtechItemList.Laser_Lens_WoodsGlass.get(1), + 20 * 300, + MaterialUtils.getVoltageForTier(3)); private static void packagerRecipes() { @@ -367,7 +376,7 @@ public class RECIPES_GREGTECH { CI.getTertiaryTieredFluid(aLaureniumTier-2, 6 * 144) }, new ItemStack[] { - GregtechItemList.Casing_Machine_Custom_3.get(1) + GregtechItemList.Casing_Machine_Custom_3.get(1) }, new FluidStack[] { @@ -375,7 +384,7 @@ public class RECIPES_GREGTECH { 20 * 20, MaterialUtils.getVoltageForTier(aLaureniumTier-2), 5); - + int aBotmiumTier = ALLOY.BOTMIUM.vTier; // Adding Recipes for Casings CORE.RA.addChemicalPlantRecipe( @@ -391,7 +400,7 @@ public class RECIPES_GREGTECH { CI.getTertiaryTieredFluid(aBotmiumTier-2, 6 * 144) }, new ItemStack[] { - GregtechItemList.Casing_Machine_Custom_4.get(1) + GregtechItemList.Casing_Machine_Custom_4.get(1) }, new FluidStack[] { @@ -399,7 +408,7 @@ public class RECIPES_GREGTECH { 20 * 20, MaterialUtils.getVoltageForTier(aBotmiumTier-2), 6); - + //Refine GT HF into GT++ HF if (FluidUtils.doesHydrofluoricAcidGtExist()) { @@ -1136,29 +1145,6 @@ public class RECIPES_GREGTECH { 20 * 120, 480*4); - - //Wood's Glass Laser Lens - CORE.RA.addBlastSmelterRecipe( - new ItemStack[] { - ItemUtils.getGregtechCircuit(5), - ItemList.Shape_Mold_Ball.get(0), - ELEMENT.getInstance().BARIUM.getDust(1), - ELEMENT.getInstance().SODIUM.getDust(1), - ELEMENT.getInstance().SILICON.getDust(2), - ELEMENT.getInstance().NICKEL.getDust(1), - ItemUtils.getItemStackOfAmountFromOreDict("dustGlass", 5) - }, - FluidUtils.getUUM(1000), - null, - new ItemStack[] { - GregtechItemList.Laser_Lens_WoodsGlass.get(1) - }, - new int[] {10000}, - 20 * 300, - (int) GT_Values.V[3]); - - - } private static void fluidcannerRecipes() { @@ -1694,15 +1680,17 @@ public class RECIPES_GREGTECH { 10 * 20, 60); - final FluidStack[] sulfurdioxideOutput = { - FluidUtils.getFluidStack("oxygen", 2000) - }; - GT_Values.RA.addDistillationTowerRecipe( - FluidUtils.getFluidStack("sulfurdioxide", 144 * 3), - sulfurdioxideOutput, - ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), - 5 * 20, - 30); + if (!GTNH) { + final FluidStack[] sulfurdioxideOutput = { + FluidUtils.getFluidStack("oxygen", 2000) + }; + GT_Values.RA.addDistillationTowerRecipe( + FluidUtils.getFluidStack("sulfurdioxide", 144 * 3), + sulfurdioxideOutput, + ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), + 5 * 20, + 30); + } } private static void addFuels() { @@ -1765,11 +1753,11 @@ public class RECIPES_GREGTECH { } private static void fluidExtractorRecipes() { - + } private static void chemicalBathRecipes() { - + } private static void centrifugeRecipes() { @@ -1792,7 +1780,7 @@ public class RECIPES_GREGTECH { } private static void mixerRecipes() { - + GT_Values.RA.addMixerRecipe( ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), null, @@ -1820,7 +1808,7 @@ public class RECIPES_GREGTECH { } private static void chemicalReactorRecipes() { - + //Bombs GT_Values.RA.addChemicalRecipe( ItemUtils.getSimpleStack(ModItems.itemBombCasing, 4), @@ -1837,7 +1825,7 @@ public class RECIPES_GREGTECH { null, ItemUtils.getSimpleStack(ModItems.itemBomb, 4), 10 * 20); - + GT_Values.RA.addChemicalRecipe( CI.getNumberedAdvancedCircuit(21), ItemUtils.getItemStackOfAmountFromOreDict("dustApatite", 32), @@ -1917,7 +1905,7 @@ public class RECIPES_GREGTECH { } private static void autoclaveRecipes() { - + } private static void benderRecipes() { @@ -1940,7 +1928,7 @@ public class RECIPES_GREGTECH { } private static void macerationRecipes() { - + GT_ModHandler.addPulverisationRecipe(ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 9)); @@ -2280,11 +2268,11 @@ public class RECIPES_GREGTECH { } private static void sifterRecipes() { - + } private static void electroMagneticSeperatorRecipes() { - + if (!GTNH) { // Trinium GT_Values.RA.addElectromagneticSeparatorRecipe( diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java index bfa75b6e14..ae4eb36a39 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -496,12 +496,6 @@ public class RECIPES_General { generatePipeRecipes(e.mDefaultLocalName, e.getMass(), tVoltageMultiplier); } - RecipeUtils.addShapedGregtechRecipe( - CI.component_Plate[4], "rotorGtStainlessSteel", CI.component_Plate[4], - CI.getTieredCircuitOreDictName(3), CI.machineHull_HV, CI.getTieredCircuitOreDictName(3), - CI.component_Plate[4], CI.electricPump_HV, CI.component_Plate[4], - GregtechItemList.Hatch_Air_Intake.get(1L, new Object[0])); - RecipeUtils.addShapedGregtechRecipe(CI.component_Plate[6], ALLOY.MARAGING250.getGear(1), CI.component_Plate[6], CI.getTieredCircuitOreDictName(4), GregtechItemList.Casing_AdvancedVacuum.get(1), CI.getTieredCircuitOreDictName(4), CI.component_Plate[5], ItemList.Hatch_Input_IV.get(1), diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 8b9d334a41..476bebeb89 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -254,6 +254,8 @@ public class RECIPES_Machines { zyngen(); milling(); sparging(); + chisels(); + rockBreaker(); gt4FarmManager(); gt4Redstone(); @@ -2043,10 +2045,23 @@ public class RECIPES_Machines { ItemStack aTieredFluidRegulator = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? FluidRegulator_IV.get(1) : ItemList.Pump_IV.get(1); RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[6], ItemList.Casing_Grate.get(1), CI.component_Plate[6], - CI.component_Plate[6], aTieredFluidRegulator, CI.component_Plate[6], - CI.getTieredCircuit(4), ItemList.Hatch_Input_IV.get(1), CI.getTieredCircuit(4), + CI.component_Plate[6], CI.getFluidRegulator(5, 1), CI.component_Plate[6], + CI.getTieredCircuit(5), ItemList.Hatch_Input_IV.get(1), CI.getTieredCircuit(5), GregtechItemList.Hatch_Air_Intake.get(1)); - + + + RecipeUtils.addShapedGregtechRecipe( + CI.getPlate(6, 1), ItemList.Casing_Gearbox_Titanium.get(1), CI.getPlate(6, 1), + CI.getPlate(6, 1), CI.getFluidRegulator(5, 1), CI.getPlate(6, 1), + CI.getTieredCircuit(6), ItemList.Hatch_Input_IV.get(1), CI.getTieredCircuit(6), + GregtechItemList.Hatch_Reservoir.get(1)); + + RecipeUtils.addShapedGregtechRecipe( + CI.getPlate(7, 1), GregtechItemList.Hatch_Air_Intake.get(1), CI.getPlate(7, 1), + CI.getPlate(7, 1), CI.getFluidRegulator(7, 1), CI.getPlate(7, 1), + CI.getTieredCircuit(7), ItemList.Hatch_Input_ZPM.get(1), CI.getTieredCircuit(7), + GregtechItemList.Hatch_Air_Intake_Extreme.get(1)); + if (CORE.ConfigSwitches.enableMultiblock_LiquidFluorideThoriumReactor){ //Thorium Reactor @@ -3272,6 +3287,78 @@ public class RECIPES_Machines { 60 * 20 * 2, MaterialUtils.getVoltageForTier(5)); } + + private static void chisels() { + ItemStack[] aChisels = new ItemStack[] { + GregtechItemList.GT_Chisel_LV.get(1), + GregtechItemList.GT_Chisel_MV.get(1), + GregtechItemList.GT_Chisel_HV.get(1), + }; + for (int i=1;i<4;i++) { + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(10+i), + CI.getTieredMachineCasing(i), + CI.getPlate(i, 4), + CI.getElectricMotor(i, 2), + CI.getConveyor(i, 2), + CI.getRobotArm(i, 1) + }, + CI.getTieredFluid(i, 144 * 4), + aChisels[i-1], + 20 * 20, + MaterialUtils.getVoltageForTier(i)); + } + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(14), + aChisels[2], + CI.getPlate(4, 8), + CI.getElectricMotor(4, 8), + CI.getConveyor(4, 8), + CI.getRobotArm(4, 4) + }, + CI.getTieredFluid(4, 144 * 8), + GregtechItemList.Controller_IndustrialAutoChisel.get(1), + 20 * 20, + MaterialUtils.getVoltageForTier(4)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(14), + ItemList.Casing_SolidSteel.get(2), + CI.getPlate(4, 2), + CI.getTieredComponent(OrePrefixes.plate, 3, 4), + CI.getTieredComponent(OrePrefixes.ring, 3, 8), + CI.getTieredComponent(OrePrefixes.rod, 2, 4), + }, + CI.getTieredFluid(2, 144 * 2), + GregtechItemList.Casing_IndustrialAutoChisel.get(1), + 20 * 20, + MaterialUtils.getVoltageForTier(3)); + + + + } + + private static void rockBreaker() { + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(12), + ItemList.Machine_EV_RockBreaker.get(1), + ALLOY.STAINLESS_STEEL.getPlate(8), + ALLOY.STAINLESS_STEEL.getRing(4), + CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.plateDouble, 8), + ALLOY.EGLIN_STEEL.getScrew(8), + }, + ELEMENT.getInstance().ALUMINIUM.getFluidStack(144 * 8), + GregtechItemList.Controller_IndustrialRockBreaker.get(1), + 60 * 20 * 2, + MaterialUtils.getVoltageForTier(4)); + + } private static void fakeMachineCasingCovers() { GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { @@ -3315,11 +3402,11 @@ public class RECIPES_Machines { return; } Class ModBlocksClass = ReflectionUtils.getClass("com.riciJak.Ztones.init.ModBlocks"); - Block agon = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "agonBlock")); - Block korp = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "korpBlock")); - Block jelt = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "jeltBlock")); - Block bitt = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "bittBlock")); - Block iszm = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "iszmBlock")); + Block agon = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "agonBlock")); + Block korp = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "korpBlock")); + Block jelt = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "jeltBlock")); + Block bitt = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "bittBlock")); + Block iszm = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "iszmBlock")); // "agon", "iszm", "korp", "jelt", "bitt" diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java index 864d0bcca8..860a87deae 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java @@ -13,6 +13,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.MISC_MATERIALS; @@ -118,12 +119,25 @@ public class RECIPES_RareEarthProcessing { null, new int[] {10000, 10000, 10000}, 20 * 30, - (int) GT_Values.V[2]); + 120); // Generate Special Laser Recipe + CORE.RA.addMixerRecipe( + CI.getNumberedBioCircuit(2), + ItemUtils.getItemStackOfAmountFromOreDict("cellChlorine", 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), + null, + null, + null, + ItemUtils.getSimpleStack(ModItems.cellHydrogenChlorideMix, 2), + null, + null, + null, + 20 * 10, + 480); + CORE.RA.addUvLaserRecipe( - ELEMENT.getInstance().CHLORINE.getCell(2), - ELEMENT.getInstance().HYDROGEN.getCell(2), + ItemUtils.getSimpleStack(ModItems.cellHydrogenChlorideMix, 4), ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 4), 20 * 30, 480); diff --git a/src/main/java/gtPlusPlus/core/recipe/common/CI.java b/src/main/java/gtPlusPlus/core/recipe/common/CI.java index c5a514c31a..f656cfe9f0 100644 --- a/src/main/java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/main/java/gtPlusPlus/core/recipe/common/CI.java @@ -128,6 +128,15 @@ public class CI { public static ItemStack sensor_ZPM; public static ItemStack sensor_UV; public static ItemStack sensor_MAX; + + public static ItemStack fluidRegulator_LV; + public static ItemStack fluidRegulator_MV; + public static ItemStack fluidRegulator_HV; + public static ItemStack fluidRegulator_EV; + public static ItemStack fluidRegulator_IV; + public static ItemStack fluidRegulator_LuV; + public static ItemStack fluidRegulator_ZPM; + public static ItemStack fluidRegulator_UV; //Machine Casings public static ItemStack machineCasing_ULV; @@ -896,6 +905,48 @@ public class CI { } return ItemUtils.getSimpleStack(aType, aSize); } + + public static ItemStack getFluidRegulator(int aTier, int aSize) { + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + return CI.getElectricPump(aTier, aSize); + } + ItemStack aType; + int aLazyTier = 0; + if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_LV; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_LV; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_MV; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_HV; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_EV; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_IV; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_LuV; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_ZPM; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_UV; + } + else if (aTier == aLazyTier++) { + aType = CI.fluidRegulator_UV; + } + else { + aType = CI.fluidRegulator_LV; + } + return ItemUtils.getSimpleStack(aType, aSize); + } public static ItemStack getElectricPiston(int aTier, int aSize) { ItemStack aType; diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java index 5b837397b1..bc096c0d53 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java +++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java @@ -26,22 +26,22 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide public int locationY; public int locationZ; private int aCurrentMode = 0; - private short aCustomValue = 1000; + private int aCustomValue = 1000; public TileEntityVolumetricFlaskSetter() { this.inventoryContents = new Inventory_VolumetricFlaskSetter(); this.setTileLocation(); } - public short getCustomValue() { + public int getCustomValue() { //Logger.INFO("Value: "+this.aCustomValue); return this.aCustomValue; } public void setCustomValue(int aVal) { - Logger.INFO("Old Value: "+this.aCustomValue); + log("Old Value: "+this.aCustomValue); this.aCustomValue = (short) MathUtils.balance(aVal, 0, Short.MAX_VALUE); - Logger.INFO("New Value: "+this.aCustomValue); + log("New Value: "+this.aCustomValue); markDirty(); } @@ -141,7 +141,7 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide // Skip slot 7 (Custom) unless it has a value > 0 if (e == 7 && getCustomValue() <= 0) { - Logger.INFO("Skipping Custom slot as value <= 0"); + log("Skipping Custom slot as value <= 0"); continue; } if (e == Container_VolumetricFlaskSetter.SLOT_OUTPUT) { @@ -168,8 +168,8 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide // Check that the Circuit in the Output slot is not null and the same type as the circuit input. if (aTypeInCheckedSlot > 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) { if (g.getItem() == f.getItem() && VolumetricFlaskHelper.getFlaskCapacity(f) == getCapacityForSlot(e) && ((aInputFluidStack == null && aFluidInCheckedSlot == null) || aInputFluidStack.isFluidEqual(aFluidInCheckedSlot))) { - Logger.INFO("Input Slot Flask Contains: "+(aInputFluidStack != null ? aInputFluidStack.getLocalizedName() : "Empty")); - Logger.INFO("Output Slot Flask Contains: "+(aFluidInCheckedSlot != null ? aFluidInCheckedSlot.getLocalizedName() : "Empty")); + log("Input Slot Flask Contains: "+(aInputFluidStack != null ? aInputFluidStack.getLocalizedName() : "Empty")); + log("Output Slot Flask Contains: "+(aFluidInCheckedSlot != null ? aFluidInCheckedSlot.getLocalizedName() : "Empty")); aSize = f.stackSize + g.stackSize; if (aSize > 16) { aInputStack = g.copy(); @@ -253,7 +253,7 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide final NBTTagCompound chestData = new NBTTagCompound(); this.inventoryContents.writeToNBT(chestData); nbt.setTag("ContentsChest", chestData); - nbt.setShort("aCustomValue", aCustomValue); + nbt.setInteger("aCustomValue", aCustomValue); if (this.hasCustomInventoryName()) { nbt.setString("CustomName", this.getCustomName()); } @@ -265,7 +265,7 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide super.readFromNBT(nbt); // Utils.LOG_WARNING("Trying to read NBT data from TE."); this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest")); - this.aCustomValue = nbt.getShort("aCustomValue"); + this.aCustomValue = nbt.getInteger("aCustomValue"); if (nbt.hasKey("CustomName", 8)) { this.setCustomName(nbt.getString("CustomName")); } @@ -399,5 +399,9 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide return false; } } + + public void log(String aString) { + Logger.INFO("[Flask-Tile] "+aString); + } } diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java index b322036ef7..0e2fff3f35 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java @@ -254,7 +254,7 @@ public class HazmatUtils { aItemFields.add(ReflectionUtils.getField(aItemsGravisuite, "graviChestPlate")); AutoMap<ItemStack> aGravisuite = new AutoMap<ItemStack>(); for (Field aItemField : aItemFields) { - Item aItemObject = (Item) ReflectionUtils.getFieldValue(aItemField); + Item aItemObject = ReflectionUtils.getFieldValue(aItemField); if (aItemObject != null) { aGravisuite.add(ItemUtils.getSimpleStack(aItemObject)); } @@ -274,7 +274,7 @@ public class HazmatUtils { aItemFields.add(ReflectionUtils.getField(aItemsEMT, "ultimateSolarHelmet")); AutoMap<ItemStack> aASP = new AutoMap<ItemStack>(); for (Field aItemField : aItemFields) { - Item aItemObject = (Item) ReflectionUtils.getFieldValue(aItemField); + Item aItemObject = ReflectionUtils.getFieldValue(aItemField); if (aItemObject != null) { aASP.add(ItemUtils.getSimpleStack(aItemObject)); } diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java index e96bd3391b..fa685aa93c 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -1314,9 +1314,6 @@ public class ItemUtils { } public static boolean isCatalyst(ItemStack aStack) { - if (GT_Utility.areStacksEqual(aStack, RocketFuels.Formaldehyde_Catalyst_Stack, true)) { - return true; - } if (GT_Utility.areStacksEqual(aStack, GenericChem.mBlueCatalyst, true)) { return true; } @@ -1338,6 +1335,9 @@ public class ItemUtils { if (GT_Utility.areStacksEqual(aStack, GenericChem.mPinkCatalyst, true)) { return true; } + if (GT_Utility.areStacksEqual(aStack, GenericChem.mFormaldehydeCatalyst, true)) { + return true; + } if (GT_Utility.areStacksEqual(aStack, AgriculturalChem.mGreenCatalyst, true)) { return true; } diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index f3890aa932..12c765d049 100644 --- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -1077,13 +1077,13 @@ public class ReflectionUtils { return false; } - public static Object getFieldValue(Field field) { + public static <T> T getFieldValue(Field field) { return getFieldValue(field, null); } - public static Object getFieldValue(Field field, Object instance) { + public static <T> T getFieldValue(Field field, Object instance) { try { - return field.get(instance); + return (T) field.get(instance); } catch (IllegalArgumentException | IllegalAccessException e) { } return null; diff --git a/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java b/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java index 5ff001ea2a..fd07fd1bbe 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java +++ b/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java @@ -79,8 +79,8 @@ public class Preloader_FMLLoadingPlugin implements IFMLLoadingPlugin { //Preloader_Logger.INFO("Is Client? "+Utils.isClient()+" | Is Server? "+Utils.isServer()); Locale aDefaultLocale = Locale.getDefault(); NumberFormat aFormat = NumberFormat.getInstance(); - Locale aDisplayLocale = (Locale) ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale")); - Locale aFormatLocale = (Locale) ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultFormatLocale")); + Locale aDisplayLocale = ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale")); + Locale aFormatLocale = ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultFormatLocale")); Preloader_Logger.INFO("Locale: "+aDefaultLocale+" | Test: "+aFormat.format(1000000000)+" | Display: "+aDisplayLocale+" | Format: "+aFormatLocale); } diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java index 05b8054ff8..86a22ce4b9 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java +++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java @@ -82,7 +82,7 @@ public class ClassTransformer_TT_ThaumicRestorer { mTookLastTick = ReflectionUtils.getField(mTileRepairerClass, "tookLastTick"); mDamageLastTick = ReflectionUtils.getField(mTileRepairerClass, "dmgLastTick"); mProxyTC = ReflectionUtils.getField(mThaumicTinkerer, "tcProxy"); - repairTConTools = (boolean) ReflectionUtils.getFieldValue(mRepairTiconTools); + repairTConTools = ReflectionUtils.getFieldValue(mRepairTiconTools); mInit = true; } if (mInit) { diff --git a/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java b/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java index e25c06653c..532d20f1b2 100644 --- a/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java +++ b/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java @@ -68,7 +68,7 @@ public class BetterKeyboard { Field aKeyNameSize = ReflectionUtils.getField(Keyboard.class, "keyName"); Field aKeyMapSize = ReflectionUtils.getField(Keyboard.class, "keyMap"); Field aKeyDownBuffer = ReflectionUtils.getField(Keyboard.class, "keyDownBuffer"); - String[] aOldKeyNameArray = (String[]) ReflectionUtils.getFieldValue(aKeyNameSize); + String[] aOldKeyNameArray = ReflectionUtils.getFieldValue(aKeyNameSize); if (aOldKeyNameArray != null && aOldKeyNameArray.length < Short.MAX_VALUE) { String[] aNewKeyNameArray = new String[Short.MAX_VALUE]; for (int i=0;i<aOldKeyNameArray.length;i++) { @@ -82,7 +82,7 @@ public class BetterKeyboard { FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Failed Patching Field: "+aKeyDownBuffer.getName()); } } - Map<String, Integer> aOldKeyMapArray = (Map<String, Integer>) ReflectionUtils.getFieldValue(aKeyMapSize); + Map<String, Integer> aOldKeyMapArray = ReflectionUtils.getFieldValue(aKeyMapSize); if (aOldKeyNameArray != null && aOldKeyMapArray.size() < Short.MAX_VALUE) { Map<String, Integer> aNewKeyMapArray = new HashMap<String, Integer>(Short.MAX_VALUE); aNewKeyMapArray.putAll(aOldKeyMapArray); @@ -94,7 +94,7 @@ public class BetterKeyboard { FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Failed Patching Field: "+aKeyDownBuffer.getName()); } } - ByteBuffer aOldByteBuffer = (ByteBuffer) ReflectionUtils.getFieldValue(aKeyDownBuffer); + ByteBuffer aOldByteBuffer = ReflectionUtils.getFieldValue(aKeyDownBuffer); if (aOldByteBuffer != null && aOldByteBuffer.capacity() == Keyboard.KEYBOARD_SIZE) { ByteBuffer aNewByteBuffer = BufferUtils.createByteBuffer(Short.MAX_VALUE); try { diff --git a/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java b/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java new file mode 100644 index 0000000000..38f0d5a89b --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java @@ -0,0 +1,16 @@ +package gtPlusPlus.xmod.advsolar; + +import advsolar.common.AdvancedSolarPanel; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.RecipeUtils; + +public class HANDLER_AdvSolar { + + public static void postInit() { + if (LoadedMods.AdvancedSolarPanel) { + RecipeUtils.removeRecipeByOutput(ItemUtils.getSimpleStack(AdvancedSolarPanel.blockMolecularTransformer)); + } + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java b/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java index 95067300c8..52f498988c 100644 --- a/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java +++ b/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java @@ -91,7 +91,7 @@ public class HANDLER_BiomesOPlenty { Field aBopColouredSapling = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "colorizedSaplings"); if (aBopMiscItem != null) { - Item aMiscItem = (Item) ReflectionUtils.getFieldValue(aBopMiscItem); + Item aMiscItem = ReflectionUtils.getFieldValue(aBopMiscItem); if (aMiscItem != null) { mPineCone = aMiscItem; } @@ -99,25 +99,25 @@ public class HANDLER_BiomesOPlenty { if (aBopBlock1 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopBlock1); + Block aBlock = ReflectionUtils.getFieldValue(aBopBlock1); if (aBlock != null) { logs1 = aBlock; } } if (aBopBlock2 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopBlock2); + Block aBlock = ReflectionUtils.getFieldValue(aBopBlock2); if (aBlock != null) { logs2 = aBlock; } } if (aBopBlock3 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopBlock3); + Block aBlock = ReflectionUtils.getFieldValue(aBopBlock3); if (aBlock != null) { logs3 = aBlock; } } if (aBopBlock4 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopBlock4); + Block aBlock = ReflectionUtils.getFieldValue(aBopBlock4); if (aBlock != null) { logs4 = aBlock; } @@ -125,25 +125,25 @@ public class HANDLER_BiomesOPlenty { if (aBopLeaves1 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopLeaves1); + Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves1); if (aBlock != null) { leaves1 = aBlock; } } if (aBopLeaves2 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopLeaves2); + Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves2); if (aBlock != null) { leaves2 = aBlock; } } if (aBopLeaves3 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopLeaves3); + Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves3); if (aBlock != null) { leaves3 = aBlock; } } if (aBopLeaves4 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopLeaves4); + Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves4); if (aBlock != null) { leaves4 = aBlock; } @@ -151,13 +151,13 @@ public class HANDLER_BiomesOPlenty { if (aBopColouredLeaves1 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopColouredLeaves1); + Block aBlock = ReflectionUtils.getFieldValue(aBopColouredLeaves1); if (aBlock != null) { colorizedLeaves1 = aBlock; } } if (aBopColouredLeaves2 != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopColouredLeaves2); + Block aBlock = ReflectionUtils.getFieldValue(aBopColouredLeaves2); if (aBlock != null) { colorizedLeaves2 = aBlock; } @@ -165,13 +165,13 @@ public class HANDLER_BiomesOPlenty { if (aBopSapling != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopSapling); + Block aBlock = ReflectionUtils.getFieldValue(aBopSapling); if (aBlock != null) { saplings = aBlock; } } if (aBopColouredSapling != null) { - Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopColouredSapling); + Block aBlock = ReflectionUtils.getFieldValue(aBopColouredSapling); if (aBlock != null) { colorizedSaplings = aBlock; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index e731cf0730..7e81f1c514 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -421,6 +421,13 @@ public enum GregtechItemList implements GregtechItemContainer { // Big Steam Macerator Controller_SteamMaceratorMulti, + + // Industrial Rock Breaker + Controller_IndustrialRockBreaker, + + // Industrial Chisel + Controller_IndustrialAutoChisel, + Casing_IndustrialAutoChisel, // Custom Machine Casings Casing_Machine_Custom_1, @@ -443,6 +450,10 @@ public enum GregtechItemList implements GregtechItemContainer { //Air Intake hatch Hatch_Air_Intake, + Hatch_Air_Intake_Extreme, + + //Reservoir Hatch + Hatch_Reservoir, //XL Turbine Rotor Hatch Hatch_Turbine_Rotor, @@ -764,6 +775,12 @@ public enum GregtechItemList implements GregtechItemContainer { //GT RTG RTG, + + // Chisel Machines + GT_Chisel_LV, + GT_Chisel_MV, + GT_Chisel_HV, + //Plasma Tank /*Plasma_Tank,*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index f1e79360d1..0ed4a690bb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -303,8 +303,8 @@ public interface IGregtech_RecipeAdder { public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel); - public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu); - public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu); + public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu); + public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu); public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier); public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int[] aChances, int time, long eu, int aTier); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java index 5fb3b11d08..02b7a03f3b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java @@ -1,165 +1,65 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; -import java.lang.reflect.Field; - -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_Input { - - private static XSTR floatGen; - public int mProgresstime = 0, mMaxProgresstime = 0; +public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_FluidGenerator { - public GT_MetaTileEntity_Hatch_AirIntake(final int aID, final String aName, final String aNameRegional, - final int aTier) { + public GT_MetaTileEntity_Hatch_AirIntake(final int aID, final String aName, final String aNameRegional, final int aTier) { super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - /*public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - }*/ - - private static String[] S; - private static Field F; - - public synchronized String[] getDescription() { - try { - if (F == null || S == null) { - Field t = ReflectionUtils.getField(this.getClass(), "mDescriptionArray"); - if (t != null) { - F = t; - } - else { - F = ReflectionUtils.getField(this.getClass(), "mDescription"); - } - if (S == null && F != null) { - Object o = F.get(this); - if (o instanceof String[]) { - S = (String[]) o; - } - else if (o instanceof String) { - S = new String[] {(String) o}; - } - } - - } - } - catch (Throwable t) { - - } - if (S != null) { - final String[] desc = new String[S.length + 4]; - System.arraycopy(S, 0, desc, 0, S.length); - desc[S.length] = "DO NOT OBSTRUCT THE INPUT!"; - desc[S.length + 1] = "Draws in Air from the surrounding environment"; - desc[S.length + 2] = "Creates 1000L of Air every 4 ticks"; - desc[S.length + 3] = CORE.GT_Tooltip; - return desc; - } - else { - return new String[] {"DO NOT OBSTRUCT THE INPUT!", "Draws in Air from the surrounding environment", "Creates 1000L of Air every 4 ticks", CORE.GT_Tooltip}; - } - - } - - public ITexture[] getTexturesActive(final ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, - new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)}; - } - - public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, - new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)}; - } - - public boolean isSimpleMachine() { - return true; - } - - public boolean isFacingValid(final byte aFacing) { - return true; + public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_AirIntake(this.mName, this.mTier, this.mDescription, this.mTextures); } - public boolean isAccessAllowed(final EntityPlayer aPlayer) { - return true; + @Override + public String[] getCustomTooltip() { + String[] aTooltip = new String[3]; + aTooltip[0] = "DO NOT OBSTRUCT THE INPUT!"; + aTooltip[1] = "Draws in Air from the surrounding environment"; + aTooltip[2] = "Creates "+getAmountOfFluidToGenerate()+"L of Air every "+getMaxTickTime()+" ticks"; + return aTooltip; } - public boolean isValidSlot(final int aIndex) { - return false; + @Override + public Fluid getFluidToGenerate() { + return FluidUtils.getAir(1).getFluid(); } - public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_AirIntake(this.mName, this.mTier, this.mDescription, this.mTextures); + @Override + public int getAmountOfFluidToGenerate() { + return 1000; } - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, - final ItemStack aStack) { - return false; + @Override + public int getMaxTickTime() { + return 4; } - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, - final ItemStack aStack) { - return false; + @Override + public int getCapacity() { + return 128000; } - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - - if (!aBaseMetaTileEntity.isAllowedToWork()) { - aBaseMetaTileEntity.setActive(false); - mProgresstime = 0; - mMaxProgresstime = 0; - } - else { - aBaseMetaTileEntity.setActive(true); - mMaxProgresstime = 4; - if (++mProgresstime >= mMaxProgresstime) { - addAirToHatch(aTick); - mProgresstime = 0; - } - } + @Override + public boolean doesHatchMeetConditionsToGenerate() { + return this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing()); } - - @Override - public int getProgresstime() { - return mProgresstime; - } - - @Override - public int maxProgresstime() { - return mMaxProgresstime; - } - @Override - public int increaseProgress(int aProgress) { - mProgresstime += aProgress; - return mMaxProgresstime - mProgresstime; - } - - public void pollutionParticles(final World aWorld, final String name) { + @Override + public void generateParticles(World aWorld, String name) { if (this.getBaseMetaTileEntity().isServerSide()) { return; } @@ -207,97 +107,4 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I (double) -ySpd, (double) zSpd); } - static { - GT_MetaTileEntity_Hatch_AirIntake.floatGen = new XSTR(); - } - - public int getTankPressure() { - return 100; - } - - public int getCapacity() { - return 128000; - } - - @Override - public boolean canTankBeEmptied() { - return true; - } - - private static Fluid AIR; - - public boolean isAirInHatch() { - if (this.mFluid != null) { - if (AIR == null) { - AIR = FluidUtils.getAir(1).getFluid(); - } - if (AIR == this.mFluid.getFluid()) { - return true; - } - } - return false; - } - - public boolean addAirToHatch(long aTick) { - if (!this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing())) { - return false; - } - boolean didFill = this.fill(FluidUtils.getAir(1000), true) > 0; - if (didFill) { - this.pollutionParticles(this.getBaseMetaTileEntity().getWorld(), "cloud"); - } - return didFill; - } - - @Override - public boolean canTankBeFilled() { - if (this.mFluid == null || (this.mFluid != null && (this.mFluid.amount <= this.getCapacity()))) { - return true; - } - return false; - } - - @Override - public boolean doesEmptyContainers() { - return false; - } - - @Override - public boolean doesFillContainers() { - return true; - } - - @Override - public int fill(FluidStack aFluid, boolean doFill) { - return super.fill(aFluid, doFill); - } - - @Override - public boolean canFill(ForgeDirection aSide, Fluid aFluid) { - return false; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return 0; - } - - @Override - public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { - return 0; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mProgresstime", mProgresstime); - aNBT.setInteger("mMaxProgresstime", mMaxProgresstime); - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - mProgresstime = aNBT.getInteger("mProgresstime"); - mMaxProgresstime = aNBT.getInteger("mMaxProgresstime"); - super.loadNBTData(aNBT); - } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java new file mode 100644 index 0000000000..45611d9e05 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java @@ -0,0 +1,32 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; + +public class GT_MetaTileEntity_Hatch_AirIntake_Extreme extends GT_MetaTileEntity_Hatch_AirIntake { + + public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final int aID, final String aName, final String aNameRegional, final int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + + public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_AirIntake_Extreme(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public int getAmountOfFluidToGenerate() { + return 8000; + } + + @Override + public int getCapacity() { + return 256000; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java new file mode 100644 index 0000000000..d4b8b3a064 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java @@ -0,0 +1,252 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import java.lang.reflect.Field; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.random.XSTR; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTileEntity_Hatch_Input { + + protected static XSTR floatGen = new XSTR(); + public int mProgresstime = 0, mMaxProgresstime = 0; + + public GT_MetaTileEntity_Hatch_FluidGenerator(final int aID, final String aName, final String aNameRegional, final int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_Hatch_FluidGenerator(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + private static String[] S; + private static Field F; + + public abstract String[] getCustomTooltip(); + + public abstract Fluid getFluidToGenerate(); + + public abstract int getAmountOfFluidToGenerate(); + + public abstract int getMaxTickTime(); + + public synchronized String[] getDescription() { + try { + if (F == null || S == null) { + Field t = ReflectionUtils.getField(this.getClass(), "mDescriptionArray"); + if (t != null) { + F = t; + } + else { + F = ReflectionUtils.getField(this.getClass(), "mDescription"); + } + if (S == null && F != null) { + Object o = F.get(this); + if (o instanceof String[]) { + S = (String[]) o; + } + else if (o instanceof String) { + S = new String[] {(String) o}; + } + } + + } + } + catch (Throwable t) { + Logger.INFO("1"); + t.printStackTrace(); + } + try { + if (S != null) { + String[] aCustomTips = getCustomTooltip(); + final String[] desc = new String[S.length + aCustomTips.length + 1]; + System.arraycopy(S, 0, desc, 0, S.length); + for (int i=0;i<aCustomTips.length;i++) { + desc[S.length + i] = aCustomTips[i]; + } + desc[S.length + aCustomTips.length] = CORE.GT_Tooltip; + return desc; + } + } + catch (Throwable t) { + Logger.INFO("2"); + t.printStackTrace(); + } + + return new String[] {"Broken Tooltip - Report on Github"}; + + } + + public ITexture[] getTexturesActive(final ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)}; + } + + public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)}; + } + + public boolean isSimpleMachine() { + return true; + } + + public boolean isFacingValid(final byte aFacing) { + return true; + } + + public boolean isAccessAllowed(final EntityPlayer aPlayer) { + return true; + } + + public boolean isValidSlot(final int aIndex) { + return false; + } + + public abstract MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity); + + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { + return false; + } + + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { + return false; + } + + public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + + if (!aBaseMetaTileEntity.isAllowedToWork()) { + aBaseMetaTileEntity.setActive(false); + mProgresstime = 0; + mMaxProgresstime = 0; + } + else { + aBaseMetaTileEntity.setActive(true); + mMaxProgresstime = getMaxTickTime(); + if (++mProgresstime >= mMaxProgresstime) { + addFluidToHatch(aTick); + mProgresstime = 0; + } + } + } + + @Override + public int getProgresstime() { + return mProgresstime; + } + + @Override + public int maxProgresstime() { + return mMaxProgresstime; + } + + @Override + public int increaseProgress(int aProgress) { + mProgresstime += aProgress; + return mMaxProgresstime - mProgresstime; + } + + public abstract void generateParticles(final World aWorld, final String name); + + public int getTankPressure() { + return 100; + } + + public abstract int getCapacity(); + + @Override + public boolean canTankBeEmptied() { + return true; + } + + public abstract boolean doesHatchMeetConditionsToGenerate(); + + public boolean addFluidToHatch(long aTick) { + if (!doesHatchMeetConditionsToGenerate()) { + return false; + } + boolean didFill = false; + if (canTankBeFilled()) { + didFill = this.fill(FluidUtils.getFluidStack(getFluidToGenerate(), getAmountOfFluidToGenerate()), true) > 0; + if (didFill) { + this.generateParticles(this.getBaseMetaTileEntity().getWorld(), "cloud"); + } + } + return didFill; + } + + @Override + public boolean canTankBeFilled() { + //Logger.INFO("Total Space: "+this.getCapacity()); + //Logger.INFO("Current capacity: "+this.getFluidAmount()); + //Logger.INFO("To add: "+this.getAmountOfFluidToGenerate()); + //Logger.INFO("Space Free: "+(this.getCapacity()-this.getFluidAmount())); + if (this.mFluid == null || (this.mFluid != null && (this.getCapacity() - this.getFluidAmount() >= this.getAmountOfFluidToGenerate()))) { + return true; + } + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean doesFillContainers() { + return true; + } + + @Override + public int fill(FluidStack aFluid, boolean doFill) { + return super.fill(aFluid, doFill); + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) { + return false; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return 0; + } + + @Override + public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + return 0; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mProgresstime", mProgresstime); + aNBT.setInteger("mMaxProgresstime", mMaxProgresstime); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mProgresstime = aNBT.getInteger("mProgresstime"); + mMaxProgresstime = aNBT.getInteger("mMaxProgresstime"); + super.loadNBTData(aNBT); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java new file mode 100644 index 0000000000..75c5dbb9ee --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java @@ -0,0 +1,123 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_FluidGenerator { + + private static Block sBlock_EIO; + private static Block sBlock_RIO; + + public GT_MetaTileEntity_Hatch_Reservoir(final int aID, final String aName, final String aNameRegional, final int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_Hatch_Reservoir(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + + public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Reservoir(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public String[] getCustomTooltip() { + String[] aTooltip = new String[3]; + aTooltip[0] = "Requires a Block of water facing the intake"; + aTooltip[1] = "Infinite water supply hatch"; + aTooltip[2] = "Creates 8000L of Water every 4 ticks"; + return aTooltip; + } + + @Override + public Fluid getFluidToGenerate() { + return FluidRegistry.WATER; + } + + @Override + public int getAmountOfFluidToGenerate() { + return 8000; + } + + @Override + public int getMaxTickTime() { + return 4; + } + + @Override + public int getCapacity() { + return 256000; + } + + private static void setCrossModData() { + if (LoadedMods.EnderIO && sBlock_EIO == null) { + sBlock_EIO = GameRegistry.findBlock("EnderIO", "blockReservoir"); + } + if (LoadedMods.RemoteIO && sBlock_RIO == null) { + sBlock_RIO = GameRegistry.findBlock("RIO", "machine"); + } + } + + public static boolean isTileValid(TileEntity aTile) { + if (aTile != null) { + if (aTile instanceof IFluidHandler) { + IFluidHandler aFluidHandler = (IFluidHandler) aTile; + return aFluidHandler.canDrain(ForgeDirection.UNKNOWN, FluidRegistry.WATER); + } + } + return false; + } + + @Override + public boolean doesHatchMeetConditionsToGenerate() { + Block aWater = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getFrontFacing()); + if (aWater != null && aWater != Blocks.air) { + if (!this.canTankBeFilled()) { + return false; + } + setCrossModData(); + if (LoadedMods.EnderIO) { + if (aWater == sBlock_EIO) { + return isTileValid(this.getBaseMetaTileEntity().getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing())); + } + } + if (LoadedMods.RemoteIO) { + if (aWater == sBlock_RIO && this.getBaseMetaTileEntity().getMetaIDAtSide(this.getBaseMetaTileEntity().getFrontFacing()) == 0) { + return isTileValid(this.getBaseMetaTileEntity().getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing())); + } + } + return aWater == Blocks.water || aWater == Blocks.flowing_water; + } + return false; + } + + @Override + public void generateParticles(World aWorld, String name) { + + } + + public ITexture[] getTexturesActive(final ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, + new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)}; + } + + public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, + new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)}; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index 8cd6dd0ca8..76bd57b3fa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -46,6 +46,10 @@ extends GregtechMetaCasingBlocksAbstract { public GregtechMetaCasingBlocks3() { super(GregtechMetaCasingItemBlocks3.class, "gtplusplus.blockcasings.3", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { + // Free up Redox casing in TAE + if (i >= 4 && i <= 8) { + continue; + } TAE.registerTexture(2, i, new GT_CopiedBlockTexture(this, 6, i)); } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Aquatic Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 841ea582ad..fe247e24a4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -18,7 +18,8 @@ import net.minecraft.world.IBlockAccess; public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract { - //Free Indexes within TAE: 90, 91, 92, 94, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127 + // Free Indexes within TAE: 91, 92, 94, 100, 101, 102, 103, 104, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127 + // 19 Free Indexes private static final TexturesGrinderMultiblock mGrinderOverlayHandler = new TexturesGrinderMultiblock(); public GregtechMetaCasingBlocks5() { @@ -31,7 +32,8 @@ extends GregtechMetaCasingBlocksAbstract { TAE.registerTexture(0, 3, new GT_CopiedBlockTexture(this, 6, 3)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing TAE.registerTexture(0, 4, new GT_CopiedBlockTexture(this, 6, 4)); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Sturdy Printer Casing"); // Unused + TAE.registerTexture(1, 10, new GT_CopiedBlockTexture(this, 6, 5)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer Casing TAE.registerTexture(1, 11, new GT_CopiedBlockTexture(this, 6, 6)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused @@ -49,6 +51,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_IsaMill_Gearbox.set(new ItemStack(this, 1, 2)); GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3)); GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_IndustrialAutoChisel.set(new ItemStack(this, 1, 5)); GregtechItemList.Casing_IndustrialForgeHammer.set(new ItemStack(this, 1, 6)); } @@ -71,6 +74,8 @@ extends GregtechMetaCasingBlocksAbstract { return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon(); case 4: return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon(); + case 5: + return TexturesGtBlock.Casing_Machine_Metal_Sheet_I.getIcon(); case 6: return TexturesGtBlock.TEXTURE_TECH_PANEL_H.getIcon(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 5642baa32d..e6ccc419e0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -538,6 +538,8 @@ public class TexturesGtBlock { private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil"); public static final CustomIcon Overlay_Oil = Internal_Overlay_Oil; + private static final CustomIcon Internal_Overlay_Water = new CustomIcon("TileEntities/adv_machine_water"); + public static final CustomIcon Overlay_Water = Internal_Overlay_Water; private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon("TileEntities/adv_machine_uum"); public static final CustomIcon Overlay_UU_Matter = Internal_Overlay_UU_Matter; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java index a88fbc0d66..072cf78c90 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java @@ -76,7 +76,7 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { if (aCoverVariable <= 0) { aCoverVariable = mMaxTransferRate; } - GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L")); + GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); return aCoverVariable; } @@ -95,7 +95,7 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { if (aCoverVariable <= 0) { aCoverVariable = mMaxTransferRate; } - GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L")); + GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); return true; } @@ -183,11 +183,11 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { @Override public void drawExtras(int mouseX, int mouseY, float parTicks) { super.drawExtras(mouseX, mouseY, parTicks); - this.getFontRenderer().drawString(trans("010", "L"), startX + spaceX * 4, 4 + startY + spaceY * 0 + 8, 0xFF555555); + this.getFontRenderer().drawString(trans("323", "L"), startX + spaceX * 4, 4 + startY + spaceY * 0 + 8, 0xFF555555); if (warn) - this.getFontRenderer().drawString(trans("011","Max")+": "+coverVariable+"/"+mMaxTransferRate+" "+trans("010", "L"), startX + spaceX * 0, 4 + startY + spaceY * 1 + 6, 0xffff0000); + this.getFontRenderer().drawString(trans("325","Max")+": "+coverVariable+"/"+mMaxTransferRate+" "+trans("323", "L"), startX + spaceX * 0, 4 + startY + spaceY * 1 + 6, 0xffff0000); else - this.getFontRenderer().drawString(trans("011","Now")+": "+coverVariable+"/"+mMaxTransferRate+" "+trans("010", "L"), startX + spaceX * 0, 4 + startY + spaceY * 1 + 6, 0xFF555555); + this.getFontRenderer().drawString(trans("324","Now")+": "+coverVariable+"/"+mMaxTransferRate+" "+trans("323", "L"), startX + spaceX * 0, 4 + startY + spaceY * 1 + 6, 0xFF555555); } @Override public void onMouseWheel(int x, int y, int delta) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java new file mode 100644 index 0000000000..f2fc0cce7a --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java @@ -0,0 +1,155 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; + +import java.util.List; + +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import team.chisel.carving.Carving; + +public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMachine { + + private ItemStack mInputCache; + private ItemStack mOutputCache; + + public GregtechMetaTileEntity_AutoChisel(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, "Chisels things, Gregtech style", 1, 1, "Compressor.png", "", + new ITexture[]{ + new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB), + new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), + new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB) + }); + } + + public GregtechMetaTileEntity_AutoChisel(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_AutoChisel(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + } + + @Override + public String[] getDescription() { + String[] A = new String[]{ + this.mDescription, + "What you want to chisel goes in slot 1", + "What you want to get goes in the special slot (bottom right)", + "If special slot is empty, first chisel result is used" + }; + return A; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return null; + } + + private boolean hasValidCache(ItemStack aStack, ItemStack aSpecialSlot, boolean aClearOnFailure) { + if (mInputCache != null && mOutputCache != null) { + if (GT_Utility.areStacksEqual(aStack, mInputCache) && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) { + return true; + } + } + // clear cache if it was invalid + if (aClearOnFailure) { + mInputCache = null; + mOutputCache = null; + } + return false; + } + + private void cacheItem(ItemStack mInputItem, ItemStack mOutputItem) { + mOutputCache = mOutputItem.copy(); + mInputCache = mInputItem.copy(); + } + + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return hasValidCache(aStack, this.getSpecialSlot(), false) ? true : super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && hasChiselResults(aStack); + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private static boolean canBeMadeFrom(ItemStack from, ItemStack to) { + List<ItemStack> results = getItemsForChiseling(from); + for (ItemStack s : results) { + if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) { + return true; + } + } + return false; + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private static boolean hasChiselResults(ItemStack from) { + List<ItemStack> results = getItemsForChiseling(from); + return results.size() > 0; + } + + private static List<ItemStack> getItemsForChiseling(ItemStack aStack){ + return Carving.chisel.getItemsForChiseling(aStack); + } + + private static ItemStack getChiselOutput(ItemStack aInput, ItemStack aTarget) { + ItemStack tOutput = null; + if (aTarget != null && canBeMadeFrom(aInput, aTarget)) { + tOutput = aTarget; + } + else if (aTarget != null && !canBeMadeFrom(aInput, aTarget)) { + tOutput = null; + } + else { + tOutput = getItemsForChiseling(aInput).get(0); + } + return tOutput; + } + + @Override + public int checkRecipe() { + ItemStack tOutput = null; + ItemStack aInput = getInputAt(0); + ItemStack aTarget = getSpecialSlot(); + boolean tIsCached = hasValidCache(aInput, aTarget, true); + if (aInput != null && hasChiselResults(aInput) && aInput.stackSize > 0) { + tOutput = tIsCached ? mOutputCache.copy() : getChiselOutput(aInput, aTarget); + if (tOutput != null) { + tOutput = tOutput.copy(); + tOutput.stackSize = 1; + // We can chisel this + if (canOutput(tOutput)) { + getInputAt(0).stackSize -= 1; + calculateOverclockedNess(16, 20); + //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; + } + if (!tIsCached) { + cacheItem(ItemUtils.getSimpleStack(aInput, 1), ItemUtils.getSimpleStack(tOutput, 1)); + } + this.mOutputItems[0] = tOutput.copy(); + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + else { + mOutputBlocked++; + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + } + } + return DID_NOT_FIND_RECIPE; + } + +}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java new file mode 100644 index 0000000000..b59bf61301 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java @@ -0,0 +1,474 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.ArrayUtils; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import team.chisel.carving.Carving; + +public class GregtechMetaTileEntity_IndustrialChisel extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialChisel> { + + private int mCasing; + private IStructureDefinition<GregtechMetaTileEntity_IndustrialChisel> STRUCTURE_DEFINITION = null; + private ItemStack mInputCache; + private ItemStack mOutputCache; + private GTPP_Recipe mCachedRecipe; + + public GregtechMetaTileEntity_IndustrialChisel(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialChisel(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialChisel(this.mName); + } + + @Override + public String getMachineType() { + return "Chisel"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Auto Chisel") + .addInfo("Target block goes in GUI slot") + .addInfo("If no target provided, firdt chisel result is used") + .addInfo("Speed: 200% | Eu Usage: 75% | Parallel: Tier x 16") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Sturdy Printer Casing", 10) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public IStructureDefinition<GregtechMetaTileEntity_IndustrialChisel> getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialChisel>builder() + .addShape(mName, transpose(new String[][]{ + {"CCC", "CCC", "CCC"}, + {"C~C", "C-C", "CCC"}, + {"CCC", "CCC", "CCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialChisel::addAdvChiselList, 90, 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings5Misc, 5 + ) + ) + ) + ) + .build(); + } + return STRUCTURE_DEFINITION; + } + + public final boolean addAdvChiselList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName, stackSize, hintsOnly, 1, 1, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch(); + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(90), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(90)}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "ImplosionCompressor"; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + private boolean hasValidCache(ItemStack aStack, ItemStack aSpecialSlot, boolean aClearOnFailure) { + if (mInputCache != null && mOutputCache != null && mCachedRecipe != null) { + if (GT_Utility.areStacksEqual(aStack, mInputCache) && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) { + return true; + } + } + // clear cache if it was invalid + if (aClearOnFailure) { + mInputCache = null; + mOutputCache = null; + mCachedRecipe = null; + } + return false; + } + + private void cacheItem(ItemStack aInputItem, ItemStack aOutputItem, GTPP_Recipe aRecipe) { + mInputCache = aInputItem.copy(); + mOutputCache = aOutputItem.copy(); + mCachedRecipe = aRecipe; + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private static boolean canBeMadeFrom(ItemStack from, ItemStack to) { + List<ItemStack> results = getItemsForChiseling(from); + for (ItemStack s : results) { + if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) { + return true; + } + } + return false; + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private static boolean hasChiselResults(ItemStack from) { + List<ItemStack> results = getItemsForChiseling(from); + return results.size() > 0; + } + + private static List<ItemStack> getItemsForChiseling(ItemStack aStack){ + return Carving.chisel.getItemsForChiseling(aStack); + } + + private static ItemStack getChiselOutput(ItemStack aInput, ItemStack aTarget) { + ItemStack tOutput = null; + if (aTarget != null && canBeMadeFrom(aInput, aTarget)) { + tOutput = aTarget; + } + else if (aTarget != null && !canBeMadeFrom(aInput, aTarget)) { + tOutput = null; + } + else { + tOutput = getItemsForChiseling(aInput).get(0); + } + return tOutput; + } + + private GTPP_Recipe generateChiselRecipe(ItemStack aInput, ItemStack aTarget) { + boolean tIsCached = hasValidCache(aInput, aTarget, true); + if (tIsCached || aInput != null && hasChiselResults(aInput)) { + ItemStack tOutput = tIsCached ? mOutputCache.copy() : getChiselOutput(aInput, aTarget); + if (tOutput != null) { + if (mCachedRecipe != null && GT_Utility.areStacksEqual(aInput, mInputCache) && GT_Utility.areStacksEqual(tOutput, mOutputCache)) { + return mCachedRecipe; + } + // We can chisel this + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {ItemUtils.getSimpleStack(aInput, 1)}, + new ItemStack[] {ItemUtils.getSimpleStack(tOutput, 1)}, + null, + new int[] {10000}, + new FluidStack[] {}, + new FluidStack[] {}, + 20, + 16, + 0); + + // Cache it + cacheItem(aInput, tOutput, aRecipe); + return aRecipe; + } + } + return null; + } + + public boolean checkRecipe(final ItemStack aStack) { + ArrayList<ItemStack> aItems = this.getStoredInputs(); + if (!aItems.isEmpty()) { + + GT_Recipe tRecipe = generateChiselRecipe(aItems.get(0), this.getGUIItemStack()); + + if (tRecipe == null) { + log("BAD RETURN - 0"); + return false; + } + + // Based on the Processing Array. A bit overkill, but very flexible. + ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]); + FluidStack[] aFluidInputs = new FluidStack[] {}; + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); + log("Running checkRecipeGeneric(0)"); + + log("Running checkRecipeGeneric(1)"); + // Remember last recipe - an optimization for findRecipe() + this.mLastRecipe = tRecipe; + + int aMaxParallelRecipes = getMaxParallelRecipes(); + int aEUPercent = getEuDiscountForParallelism(); + int aSpeedBonusPercent = 200; + + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { + log("BAD RETURN - 2"); + return false; + } + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + + int parallelRecipes = 0; + + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + log("Broke at "+parallelRecipes+"."); + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + + if (parallelRecipes == 0) { + log("BAD RETURN - 3"); + return false; + } + + // -- Try not to fail after this point - inputs have already been consumed! -- + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); + + + // Convert speed bonus to duration multiplier + // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. + aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); + float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); + this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor); + + this.mEUt = (int)Math.ceil(tTotalEUt); + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + // Overclock + if (this.mEUt <= 16) { + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); + } else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + // Collect fluid outputs + FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { + if (tRecipe.getFluidOutput(h) != null) { + tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); + tOutputFluids[h].amount *= parallelRecipes; + } + } + + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOutputItems[h] = tRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + + // Set output item stack sizes (taking output chance into account) + for (int f = 0; f < tOutputItems.length; f++) { + if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + for (int g = 0; g < parallelRecipes; g++) { + if (getBaseMetaTileEntity().getRandomNumber(10000) <= tRecipe.getOutputChance(f)) + tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + + tOutputItems = removeNulls(tOutputItems); + + // Sanitize item stack size, splitting any stacks greater than max stack size + List<ItemStack> splitStacks = new ArrayList<ItemStack>(); + for (ItemStack tItem : tOutputItems) { + while (tItem.getMaxStackSize() < tItem.stackSize) { + ItemStack tmp = tItem.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + splitStacks.add(tmp); + } + } + + if (splitStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[splitStacks.size()]; + tmp = splitStacks.toArray(tmp); + tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); + } + + // Strip empty stacks + List<ItemStack> tSList = new ArrayList<ItemStack>(); + for (ItemStack tS : tOutputItems) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + + // Commit outputs + this.mOutputItems = tOutputItems; + this.mOutputFluids = tOutputFluids; + updateSlots(); + + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + log("GOOD RETURN - 1"); + return true; + } + + return false; + } + + @Override + public int getMaxParallelRecipes() { + return (16 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + + @Override + public int getEuDiscountForParallelism() { + return 75; + } + + private static String sChiselSound = null; + + private static final String getChiselSound() { + if (sChiselSound == null) { + sChiselSound = Carving.chisel.getVariationSound(Blocks.stone, 0); + } + return sChiselSound; + } + + @Override + public String getSound() { + return getChiselSound(); + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerSecond(ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialChisel; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + +}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java index cf73dc1e75..e86f98ef66 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java @@ -579,7 +579,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< } else { while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; - this.mMaxProgresstime /= 2; + this.mMaxProgresstime /= 4; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java index e0e2c769a0..055c591047 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -36,7 +36,6 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_DistillationTower> { - private short mControllerY = 0; private byte mMode = 0; private boolean mUpgraded = false; private IStructureDefinition<GregtechMetaTileEntity_Adv_DistillationTower> STRUCTURE_DEFINITION = null; @@ -157,7 +156,7 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M .addMaintenanceHatch("Bottom Casing", 1) .addEnergyHatch("Bottom Casing", 1) .addOutputHatch("One per layer except bottom", 2) - .addMufflerHatch("Top Center Casing", 3) + .addMufflerHatch("Top Casing", 3) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -259,13 +258,17 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M return false; } + private short getControllerY() { + return getBaseMetaTileEntity().getYCoord(); + } + @Override public boolean addOutput(FluidStack aLiquid) { if (aLiquid == null) return false; FluidStack tLiquid = aLiquid.copy(); for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) { - if (tHatch.getBaseMetaTileEntity().getYCoord() == this.mControllerY + 1) { + if (tHatch.getBaseMetaTileEntity().getYCoord() == getControllerY() + 1) { int tAmount = tHatch.fill(tLiquid, false); if (tAmount >= tLiquid.amount) { return tHatch.fill(tLiquid, true) >= tLiquid.amount; @@ -282,7 +285,7 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M protected void addFluidOutputs(FluidStack[] mOutputFluids2) { for (int i = 0; i < mOutputFluids2.length; i++) { if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) { - if (mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() == this.mControllerY + 1 + i) { + if (mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() == getControllerY() + 1 + i) { mOutputHatches.get(i).fill(mOutputFluids2[i], true); } } @@ -477,5 +480,4 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M aNBT.setBoolean("mUpgraded", mUpgraded); super.setItemNBT(aNBT); } - }
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index 1a215ecae2..715ef30697 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -348,7 +348,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< } else { while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; - this.mMaxProgresstime /= 2; + this.mMaxProgresstime /= 4; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java new file mode 100644 index 0000000000..1b8835f289 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java @@ -0,0 +1,559 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import org.apache.commons.lang3.ArrayUtils; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map_Microwave; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialRockBreaker> { + + private int mCasing; + private IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> STRUCTURE_DEFINITION = null; + + + public GregtechMetaTileEntity_IndustrialRockBreaker(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialRockBreaker(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialRockBreaker(this.mName); + } + + @Override + public String getMachineType() { + return "Rock Breaker"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Rock Breaker") + .addInfo("Speed: 200% | Eu Usage: 75% | Parallel: Tier x 8") + .addInfo("Circuit goes in the Input Bus or GUI slot") + .addInfo("1 = cobble, 2 = stone, 3 = obsidian") + .addInfo("Supply Water/Lava") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Bottom Center") + .addCasingInfo("Thermal Processing Casing", 9) + .addCasingInfo("Thermal Containment Casing", 16) + .addInputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialRockBreaker>builder() + .addShape(mName, transpose(new String[][]{ + {"CCC", "CCC", "CCC"}, + {"HHH", "H-H", "HHH"}, + {"HHH", "H-H", "HHH"}, + {"C~C", "CCC", "CCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialRockBreaker::addRockBreakerList, TAE.GTPP_INDEX(16), 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings2Misc, 0 + ) + ) + ) + ) + .addElement( + 'H', + ofBlock( + ModBlocks.blockCasings2Misc, 11 + ) + ) + .build(); + } + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName , stackSize, hintsOnly, 1, 3, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + boolean aCheckPiece = checkPiece(mName, 1, 3, 0); + boolean aCasingCount = mCasing >= 9; + boolean aCheckHatch = checkHatch(); + log(""+aCheckPiece+", "+aCasingCount+", "+aCheckHatch); + return aCheckPiece && aCasingCount && aCheckHatch; + } + + public final boolean addRockBreakerList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(Integer.valueOf(208)); + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(16)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(16))}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "ElectricBlastFurnace"; + } + + private static final GT_Recipe_Map sFakeRecipeMap = new GT_Recipe_Map(new HashSet<>(0), "gt.recipe.fakerockbreaker", "Rock Breaker", "smelting", RES_PATH_GUI + "basicmachines/E_Furnace", 1, 1, 0, 0, 1, E, 1, E, true, false); + + private static void generateRecipeMap() { + if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) { + generateRecipes(); + } + FluidStack[] aInputFluids = new FluidStack[] {FluidUtils.getWater(1000), FluidUtils.getLava(1000)}; + GT_Recipe aTemp = sRecipe_Cobblestone.copy(); + aTemp.mFluidInputs = aInputFluids; + sFakeRecipeMap.add(aTemp); + aTemp = sRecipe_SmoothStone.copy(); + aTemp.mFluidInputs = aInputFluids; + sFakeRecipeMap.add(aTemp); + aTemp = sRecipe_Redstone.copy(); + aTemp.mFluidInputs = aInputFluids; + sFakeRecipeMap.add(aTemp); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + if (sFakeRecipeMap.mRecipeList.isEmpty()) { + generateRecipeMap(); + } + return sFakeRecipeMap; + } + + @Override + public boolean isCorrectMachinePart(final ItemStack aStack) { + return true; + } + + private static GT_Recipe sRecipe_Cobblestone; + private static GT_Recipe sRecipe_SmoothStone; + private static GT_Recipe sRecipe_Redstone; + + private static final void generateRecipes() { + sRecipe_Cobblestone = new GTPP_Recipe( + false, + new ItemStack[] { + CI.getNumberedCircuit(1) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(Blocks.cobblestone) + }, + null, + new int[] {10000}, + null, + null, + 16, + 32, + 0); + sRecipe_SmoothStone = new GTPP_Recipe( + false, + new ItemStack[] { + CI.getNumberedCircuit(2) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(Blocks.stone) + }, + null, + new int[] {10000}, + null, + null, + 16, + 32, + 0); + sRecipe_Redstone = new GTPP_Recipe( + false, + new ItemStack[] { + CI.getNumberedCircuit(3), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(Blocks.obsidian) + }, + null, + new int[] {10000}, + null, + null, + 128, + 32, + 0); + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + ArrayList<FluidStack> aFluids = this.getStoredFluids(); + if (!aFluids.isEmpty()) { + boolean aHasWater = false; + boolean aHasLava = false; + for (FluidStack aFluid : aFluids) { + if (aFluid.getFluid() == FluidRegistry.WATER) { + aHasWater = true; + } + else if (aFluid.getFluid() == FluidRegistry.LAVA) { + aHasLava = true; + } + } + ArrayList<ItemStack> aItems = this.getStoredInputs(); + boolean aHasRedstone = false; + if (!aItems.isEmpty()) { + for (ItemStack aItem : aItems) { + if (GT_Utility.areStacksEqual(aItem, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { + aHasRedstone = true; + break; + } + } + } + + if (!aHasWater || !aHasLava) { + log("BAD RETURN - 0-1"); + return false; + } + ItemStack aGuiCircuit = this.getGUIItemStack(); + if (aGuiCircuit == null || !ItemUtils.isControlCircuit(aGuiCircuit)) { + log("BAD RETURN - 0-2"); + return false; + } + + if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) { + generateRecipes(); + } + + int aCircuit = aGuiCircuit.getItemDamage(); + + GT_Recipe tRecipe = null; + switch (aCircuit) { + case 1: + tRecipe = sRecipe_Cobblestone; + break; + case 2: + tRecipe = sRecipe_SmoothStone; + break; + case 3: + if (aHasRedstone) { + tRecipe = sRecipe_Redstone; + } + break; + } + + if (tRecipe == null) { + log("BAD RETURN - 0-3"); + return false; + } + + // Based on the Processing Array. A bit overkill, but very flexible. + ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]); + FluidStack[] aFluidInputs = new FluidStack[] {}; + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); + log("Running checkRecipeGeneric(0)"); + + log("Running checkRecipeGeneric(1)"); + // Remember last recipe - an optimization for findRecipe() + this.mLastRecipe = tRecipe; + + int aMaxParallelRecipes = getMaxParallelRecipes(); + int aEUPercent = getEuDiscountForParallelism(); + int aSpeedBonusPercent = 200; + + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { + log("BAD RETURN - 2"); + return false; + } + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + + int parallelRecipes = 0; + + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); + + if (aItems.size() > 0 && aCircuit == 3) { + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!this.depleteInput(tRecipe.mInputs[1])) { + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + } + else if (aCircuit >= 1 && aCircuit <= 2) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + } + + log("Broke at "+parallelRecipes+"."); + if (parallelRecipes == 0) { + log("BAD RETURN - 3"); + return false; + } + + // -- Try not to fail after this point - inputs have already been consumed! -- + + + + // Convert speed bonus to duration multiplier + // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. + aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); + float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); + this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor); + + this.mEUt = (int)Math.ceil(tTotalEUt); + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + // Overclock + if (this.mEUt <= 16) { + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); + } else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + // Collect fluid outputs + FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { + if (tRecipe.getFluidOutput(h) != null) { + tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); + tOutputFluids[h].amount *= parallelRecipes; + } + } + + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOutputItems[h] = tRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + + // Set output item stack sizes (taking output chance into account) + for (int f = 0; f < tOutputItems.length; f++) { + if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + for (int g = 0; g < parallelRecipes; g++) { + if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) + tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + + tOutputItems = removeNulls(tOutputItems); + + // Sanitize item stack size, splitting any stacks greater than max stack size + List<ItemStack> splitStacks = new ArrayList<ItemStack>(); + for (ItemStack tItem : tOutputItems) { + while (tItem.getMaxStackSize() < tItem.stackSize) { + ItemStack tmp = tItem.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + splitStacks.add(tmp); + } + } + + if (splitStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[splitStacks.size()]; + tmp = splitStacks.toArray(tmp); + tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); + } + + // Strip empty stacks + List<ItemStack> tSList = new ArrayList<ItemStack>(); + for (ItemStack tS : tOutputItems) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + + // Commit outputs + this.mOutputItems = tOutputItems; + this.mOutputFluids = tOutputFluids; + updateSlots(); + + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + log("GOOD RETURN - 1"); + return true; + } + + return false; + } + + @Override + public int getMaxParallelRecipes() { + return (8 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + + @Override + public int getEuDiscountForParallelism() { + return 75; + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialRockBreaker; + } + + @Override + public int getDamageToComponent(final ItemStack aStack) { + return 0; + } + + @Override + public int getAmountOfOutputs() { + return 2; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + @Override + public ArrayList<ItemStack> getStoredInputs() { + ArrayList<ItemStack> aInputs = super.getStoredInputs(); + if (this.hasSlotInGUI() && this.getGUIItemStack() != null) { + aInputs.add(this.getGUIItemStack()); + } + return aInputs; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index d0d4b7fdb6..daad2f50da 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -568,10 +568,18 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt } @Override - public boolean checkRecipe(final ItemStack aStack) { + public boolean checkRecipe(final ItemStack aStack) { return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), getSpeedBonus()); } + @Override + public boolean checkRecipeGeneric(int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { + ArrayList<ItemStack> tItems = getStoredInputs(); + ArrayList<FluidStack> tFluids = getStoredFluids(); + ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); + FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); + return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); + } @Override public boolean checkRecipeGeneric( @@ -586,7 +594,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt this.mMaxProgresstime = 0; this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new FluidStack[]{}; - + long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); long tEnergy = getMaxInputEnergy(); @@ -1040,12 +1048,18 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt @Override public ArrayList<ItemStack> getStoredInputs() { ArrayList<ItemStack> tItems = super.getStoredInputs(); + if (this.hasSlotInGUI() && this.getGUIItemStack() != null) { + tItems.add(this.getGUIItemStack()); + } for (GT_MetaTileEntity_Hatch_Catalysts tHatch : mCatalystBuses) { tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch)) { - tItems.addAll(tHatch.getContentUsageSlots()); + if (isValidMetaTileEntity(tHatch)) { + AutoMap<ItemStack> aHatchContent = tHatch.getContentUsageSlots(); + if (!aHatchContent.isEmpty()) { + tItems.addAll(aHatchContent); + } } - } + } return tItems; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index c7e652023b..2b8a110b09 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -659,14 +659,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { return false; } - if ((aOutput1 != null) - && ((aDuration = GregTech_API.sRecipeFile.get("advancedmixer", aOutput1, aDuration)) <= 0)) { - return false; - } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("advancedmixer", - aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { - return false; - } GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( true, new ItemStack[] { aInput1, aInput2, aInput3, aInput4 }, @@ -679,17 +671,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { Math.max(1, aEUt), 0); - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.add(aSpecialRecipe); - aSize = GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size(); - - /*GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.addRecipe(true, - new ItemStack[] { aInput1, aInput2, aInput3, aInput4 }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, null, null, - new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0);*/ - - return aSize > aSize2; + int aSize = GT_Recipe_Map.sMixerRecipes.mRecipeList.size(); + GT_Recipe_Map.sMixerRecipes.add(aSpecialRecipe); + return GT_Recipe_Map.sMixerRecipes.mRecipeList.size() > aSize; } // Machine Component Assembler @@ -1473,18 +1457,18 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu) { + public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu) { // Generate Special Laser Recipe GT_Recipe u = new GTPP_Recipe( false, new ItemStack[] { aInput1, - aInput2, + GregtechItemList.Laser_Lens_WoodsGlass.get(1), }, new ItemStack[] { aOutput }, - GregtechItemList.Laser_Lens_WoodsGlass.get(1), + null, new int[] { 10000 }, @@ -1497,8 +1481,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu) { - return addUvLaserRecipe(aInput1, aInput2, aOutput, time, eu); + public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu) { + return addUvLaserRecipe(aInput1, aOutput, time, eu); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java index 64e77393bd..b93933d088 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java @@ -68,7 +68,12 @@ public class GregtechCustomHatches { // Multiblock Air Intake Hatch GregtechItemList.Hatch_Air_Intake.set(new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5).getStackForm(1L)); + GregtechItemList.Hatch_Air_Intake_Extreme.set(new GT_MetaTileEntity_Hatch_AirIntake_Extreme(31070, "hatch.air.intake.tier.01", "Extreme Air Intake Hatch", 6).getStackForm(1L)); + // Multiblock Reservoir Hatch + GregtechItemList.Hatch_Reservoir.set(new GT_MetaTileEntity_Hatch_Reservoir(31071, "hatch.water.intake.tier.00", "Reservoir Hatch", 6).getStackForm(1L)); + + // Steam Hatch GregtechItemList.Hatch_Input_Steam .set(new GT_MetaTileEntity_Hatch_CustomFluidBase(FluidUtils.getSteam(1).getFluid(), // Fluid diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java new file mode 100644 index 0000000000..2027e6b190 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java @@ -0,0 +1,25 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_AutoChisel; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialChisel; + +public class GregtechIndustrialChisel { + + public static void run() { + GregtechItemList.GT_Chisel_LV.set(new GregtechMetaTileEntity_AutoChisel(31066, + "chisel.tier.01", "Basic Auto-Chisel", 1).getStackForm(1L)); + GregtechItemList.GT_Chisel_MV.set(new GregtechMetaTileEntity_AutoChisel(31067, + "chisel.tier.02", "Advanced Auto-Chisel", 2).getStackForm(1L)); + GregtechItemList.GT_Chisel_HV.set(new GregtechMetaTileEntity_AutoChisel(31068, + "chisel.tier.03", "Precision Auto-Chisel", 3).getStackForm(1L)); + + GregtechItemList.Controller_IndustrialAutoChisel.set( + new GregtechMetaTileEntity_IndustrialChisel(31069, + "multimachine.adv.chisel", + "Industrial 3D Copying Machine").getStackForm(1L)); + + + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java new file mode 100644 index 0000000000..562693ee3e --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java @@ -0,0 +1,13 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_IndustrialRockBreaker; + +public class GregtechIndustrialRockBreaker { + + public static void run() { + GregtechItemList.Controller_IndustrialRockBreaker.set(new GregtechMetaTileEntity_IndustrialRockBreaker(31065, + "industrialrockcrusher.controller.tier.single", "Boldarnator").getStackForm(1L)); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java index 15bf42c9d4..8fa4cb6cb1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java @@ -18,7 +18,6 @@ public class GregtechIndustrialSifter { } private static void run1() { - // Industrial Maceration Stack Multiblock GregtechItemList.Industrial_Sifter.set(new GregtechMetaTileEntity_IndustrialSifter(840, "industrialsifter.controller.tier.single", "Large Sifter Control Block").getStackForm(1L)); diff --git a/src/main/resources/assets/miscutils/lang/en_US.lang b/src/main/resources/assets/miscutils/lang/en_US.lang index a4b2b8c5a3..b0e0741159 100644 --- a/src/main/resources/assets/miscutils/lang/en_US.lang +++ b/src/main/resources/assets/miscutils/lang/en_US.lang @@ -3371,5 +3371,9 @@ item.itemCellPraseodymium.name=Praseodymium Cell item.milledMonazite.name=Milled Monazite item.FrothMonaziteflotation.name=Monazite Flotation Froth Cell +//Added 18/12/21 +item.BasicGenericChemItem.13.name=Formaldehyde Catalyst +item.hydrogenchloridemix.name=Hydrogen Chlorine Mix + //Added 19/01/22 -item.SunnariumBit.name=Sunnarium Bit +item.SunnariumBit.name=Sunnarium Bit
\ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_water.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_water.png Binary files differnew file mode 100644 index 0000000000..3351f5d0a6 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_water.png diff --git a/src/main/resources/assets/miscutils/textures/items/science/general/MetaItem1/13.png b/src/main/resources/assets/miscutils/textures/items/science/general/MetaItem1/13.png Binary files differnew file mode 100644 index 0000000000..475f8dadfb --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/items/science/general/MetaItem1/13.png |