-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
160 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/co/q64/exgregilo/links/gregtech/render/ItemTextures.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package co.q64.exgregilo.links.gregtech.render; | ||
|
||
import gregtech.api.GregTech_API; | ||
import gregtech.api.interfaces.IIconContainer; | ||
import net.minecraft.client.renderer.texture.TextureMap; | ||
import net.minecraft.util.IIcon; | ||
import net.minecraft.util.ResourceLocation; | ||
import co.q64.exgregilo.data.ModData; | ||
|
||
public enum ItemTextures implements IIconContainer, Runnable { | ||
WIRE_MESH("WIRE_MESH"); | ||
|
||
private static final String BLANK_OVERLAY = "BLANK"; | ||
private String textureName; | ||
private String overlayName; | ||
private IIcon mIcon; | ||
private IIcon mOverlay; | ||
|
||
private ItemTextures(String textureName) { | ||
this(textureName, BLANK_OVERLAY); | ||
} | ||
|
||
private ItemTextures(String textureName, String overlayName) { | ||
this.textureName = textureName; | ||
this.overlayName = overlayName; | ||
GregTech_API.sGTItemIconload.add(this); | ||
} | ||
|
||
@Override | ||
public IIcon getIcon() { | ||
return mIcon; | ||
} | ||
|
||
@Override | ||
public IIcon getOverlayIcon() { | ||
return mOverlay; | ||
} | ||
|
||
@Override | ||
public ResourceLocation getTextureFile() { | ||
return TextureMap.locationItemsTexture; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
mIcon = GregTech_API.sItemIcons.registerIcon(ModData.ITEM_ICON_TEX_PATH + textureName); | ||
mOverlay = GregTech_API.sItemIcons.registerIcon(ModData.ITEM_ICON_TEX_PATH + overlayName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/co/q64/exgregilo/links/gregtech/tools/MetaGeneratedTools.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package co.q64.exgregilo.links.gregtech.tools; | ||
|
||
import gregtech.api.items.GT_MetaGenerated_Tool; | ||
import co.q64.exgregilo.links.gregtech.crafting.OreDictAddons; | ||
|
||
public class MetaGeneratedTools extends GT_MetaGenerated_Tool { | ||
public static final int WIRE_MESH_ID = 0; | ||
|
||
public MetaGeneratedTools() { | ||
super("exgregilo.metatool.01"); | ||
addTool(WIRE_MESH_ID, "Wire Mesh", "Place in an Advanced Sieve", new WireMesh(), new Object[] { OreDictAddons.WIRE_MESH }); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/co/q64/exgregilo/links/gregtech/tools/ToolCrafting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package co.q64.exgregilo.links.gregtech.tools; | ||
|
||
import gregtech.api.enums.Materials; | ||
import gregtech.api.enums.OrePrefixes; | ||
import gregtech.api.enums.SubTag; | ||
import gregtech.api.interfaces.IOreRecipeRegistrator; | ||
import gregtech.api.util.GT_ModHandler; | ||
import net.minecraft.item.ItemStack; | ||
import co.q64.exgregilo.api.ExGregiloAPI; | ||
import co.q64.exgregilo.links.gregtech.GregTech; | ||
|
||
public class ToolCrafting implements IOreRecipeRegistrator { | ||
|
||
@Override | ||
public void registerOre(OrePrefixes prefix, Materials material, String oreDictName, String modName, ItemStack stack) { | ||
if ((!material.contains(SubTag.WOOD)) && (!material.contains(SubTag.BOUNCY)) && (!material.contains(SubTag.NO_SMASHING))) { | ||
//formatter:off | ||
GT_ModHandler.addCraftingRecipe(ExGregiloAPI.getLinkManager().getLink(GregTech.class).getTools().getToolWithStats(MetaGeneratedTools.WIRE_MESH_ID, 1, material, material.mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{ | ||
"WWW", | ||
"WGW", | ||
"WWW", | ||
Character.valueOf('W'), OrePrefixes.wireGt01.get(material), | ||
Character.valueOf('G'), OrePrefixes.gearGtSmall.get(material.mHandleMaterial)}); | ||
//formatter:on | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/co/q64/exgregilo/links/gregtech/tools/WireMesh.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package co.q64.exgregilo.links.gregtech.tools; | ||
|
||
import co.q64.exgregilo.links.gregtech.render.ItemTextures; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.ItemStack; | ||
import gregtech.api.interfaces.IIconContainer; | ||
import gregtech.api.items.GT_MetaGenerated_Tool; | ||
import gregtech.common.tools.GT_Tool; | ||
|
||
public class WireMesh extends GT_Tool { | ||
|
||
@Override | ||
public float getBaseDamage() { | ||
return 1.0f; | ||
} | ||
|
||
@Override | ||
public boolean isMinableBlock(Block block, byte metaData) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public IIconContainer getIcon(boolean isToolHead, ItemStack stack) { | ||
return ItemTextures.WIRE_MESH; | ||
} | ||
|
||
@Override | ||
public float getMaxDurabilityMultiplier() { | ||
return 0.1F; | ||
} | ||
|
||
@Override | ||
public short[] getRGBa(boolean isToolHead, ItemStack stack) { | ||
return isToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(stack).mRGBa : null; | ||
} | ||
} |