From b5cbe510e959ae0fe8803b5df1031f2752c50e30 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Mon, 30 Mar 2020 15:56:40 +0100 Subject: + Added IsaMill. + Added repackaged Sun classes. + Added Milled ores. + Added Milling Balls. $ Disabled Hand-pump pumping from non-GT tile entities. > Maybe did other things, but in a hurry to commit. --- .../core/item/base/ore/BaseItemMilledOre.java | 25 +++++++++++ .../core/item/base/ore/BaseOreComponent.java | 48 +++++++++++++--------- 2 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java new file mode 100644 index 0000000000..4edf4ae75d --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemMilledOre.java @@ -0,0 +1,25 @@ +package gtPlusPlus.core.item.base.ore; + +import gregtech.api.enums.Materials; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.minecraft.MaterialUtils; +import net.minecraft.item.Item; + +public class BaseItemMilledOre extends BaseOreComponent{ + + public BaseItemMilledOre(final Material material, int aMaterialEU) { + super(material, BaseOreComponent.ComponentTypes.MILLED); + CORE.RA.addMillingRecipe(material, aMaterialEU); + } + + public static Item generate(Materials aMat, int aMaterialEU) { + return generate(MaterialUtils.generateMaterialFromGtENUM(aMat), aMaterialEU); + } + + public static Item generate(Material aMat, int aMaterialEU) { + return new BaseItemMilledOre(aMat, aMaterialEU); + } + + +} diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index c5b7191ddd..24c87c3334 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -48,7 +48,6 @@ public class BaseOreComponent extends Item{ this.setCreativeTab(AddToCreativeTab.tabMisc); this.setUnlocalizedName(this.unlocalName); this.setMaxStackSize(64); - //this.setTextureName(this.getCorrectTextures()); this.componentColour = material.getRgbAsHex(); GameRegistry.registerItem(this, this.unlocalName); registerComponent(); @@ -59,9 +58,9 @@ public class BaseOreComponent extends Item{ //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel); } } - + } - + public boolean registerComponent() { Logger.MATERIALS("Attempting to register "+this.getUnlocalizedName()+"."); if (this.componentMaterial == null) { @@ -92,7 +91,10 @@ public class BaseOreComponent extends Item{ else if (componentType == ComponentTypes.DUSTPURE) { aKey = OrePrefixes.dustPure.name(); } - + else if (componentType == ComponentTypes.MILLED) { + aKey = "milled"; + } + ItemStack x = aMap.get(aKey); if (x == null) { aMap.put(aKey, ItemUtils.getSimpleStack(this)); @@ -107,13 +109,6 @@ public class BaseOreComponent extends Item{ } } - public String getCorrectTextures(){ - if (!CORE.ConfigSwitches.useGregtechTextures){ - return CORE.MODID + ":" + "item"+this.componentType.COMPONENT_NAME; - } - return "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME; - } - /*@Override public String getItemStackDisplayName(final ItemStack p_77653_1_) { return (this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME); @@ -181,7 +176,13 @@ public class BaseOreComponent extends Item{ @Override @SideOnly(Side.CLIENT) public void registerIcons(final IIconRegister par1IconRegister){ - if (CORE.ConfigSwitches.useGregtechTextures){ + if (this.componentType == ComponentTypes.MILLED) { + this.base = par1IconRegister.registerIcon(CORE.MODID + ":" + "processing/MilledOre/"+this.componentType.getComponent()); + if (this.componentType.hasOverlay()){ + this.overlay = par1IconRegister.registerIcon(CORE.MODID + ":" + "processing/MilledOre/"+this.componentType.getComponent()+"_Overlay"); + } + } + else if (CORE.ConfigSwitches.useGregtechTextures){ //Logger.MATERIALS(this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME+" is using `"+"gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"' as the layer 0 texture path."); this.base = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME); if (this.componentType.hasOverlay()){ @@ -199,13 +200,21 @@ public class BaseOreComponent extends Item{ @Override public int getColorFromItemStack(final ItemStack stack, final int renderPass) { - if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){ + if (this.componentType == ComponentTypes.MILLED) { + if (renderPass == 1){ + return Utils.rgbtoHexValue(230, 230, 230); + } return this.componentColour; } - if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){ - return Utils.rgbtoHexValue(230, 230, 230); - } - return this.componentColour; + else { + if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){ + return this.componentColour; + } + if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){ + return Utils.rgbtoHexValue(230, 230, 230); + } + return this.componentColour; + } } @@ -226,7 +235,8 @@ public class BaseOreComponent extends Item{ DUSTPURE("dustPure", "Purified ", " Dust", true), CRUSHED("crushed", "Crushed ", " Ore", true), CRUSHEDCENTRIFUGED("crushedCentrifuged", "Centrifuged Crushed "," Ore", true), - CRUSHEDPURIFIED("crushedPurified", "Purified Crushed ", " Ore", true); + CRUSHEDPURIFIED("crushedPurified", "Purified Crushed ", " Ore", true), + MILLED("milled", "Milled ", " Ore", true); private String COMPONENT_NAME; private String PREFIX; @@ -252,7 +262,7 @@ public class BaseOreComponent extends Item{ public boolean hasOverlay(){ return this.HAS_OVERLAY; } - + public String getPrefix(){ return this.PREFIX; } -- cgit From 75ea33600537047847091b55a46f5b88c3c75dbb Mon Sep 17 00:00:00 2001 From: Alkalus Date: Tue, 31 Mar 2020 01:25:58 +0100 Subject: + Added Custom NEI Handler for IsaMIll. + Added Death by IsaMIll. % Moved debug mode switch to AsmConfig. $ Fixed handling of custom OrePrefixes. $ Fixed OreDict registration of MetaFoodItems. $ Improved handling of Core Classes being static initialised too early. $ Fixed client-side bug in Distillus which would cause an infinite loop. $ Fixed bug in ForgeEnumHelper. $ Fixed bug in setField methods from ReflectionUtils. --- src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index 24c87c3334..356fdac24e 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -18,6 +18,7 @@ import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.enums.CustomOrePrefix; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -92,7 +93,7 @@ public class BaseOreComponent extends Item{ aKey = OrePrefixes.dustPure.name(); } else if (componentType == ComponentTypes.MILLED) { - aKey = "milled"; + aKey = CustomOrePrefix.milled.get().name(); } ItemStack x = aMap.get(aKey); -- cgit