Colorable Drills~

This commit is contained in:
Ellpeck 2015-12-01 18:27:40 +01:00
parent f62b1ede79
commit b57c8f03b9
6 changed files with 37 additions and 52 deletions

View file

@ -131,7 +131,7 @@ public class InitBooklet{
new BookletChapter("potionRings", entryItemsNonRF, new ItemStack(InitItems.itemPotionRing), potionRingPages.toArray(new BookletPage[potionRingPages.size()])); new BookletChapter("potionRings", entryItemsNonRF, new ItemStack(InitItems.itemPotionRing), potionRingPages.toArray(new BookletPage[potionRingPages.size()]));
//RF Using Items //RF Using Items
new BookletChapter("drill", entryItemsRF, new ItemStack(InitItems.itemDrill), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill, ItemCrafting.recipeDrillEmerald, ItemCrafting.recipeDrillPurple).setPageStacksWildcard(), new PageCrafting(3, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(4, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); new BookletChapter("drill", entryItemsRF, new ItemStack(InitItems.itemDrill), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(3, ItemCrafting.recipesDrillColoring).setPageStacksWildcard(), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial();
new BookletChapter("staff", entryItemsRF, new ItemStack(InitItems.itemTeleStaff), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeStaff).setNoText()).setImportant(); new BookletChapter("staff", entryItemsRF, new ItemStack(InitItems.itemTeleStaff), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeStaff).setNoText()).setImportant();
new BookletChapter("magnetRing", entryItemsRF, new ItemStack(InitItems.itemMagnetRing), new PageCrafting(1, ItemCrafting.recipeMagnetRing)); new BookletChapter("magnetRing", entryItemsRF, new ItemStack(InitItems.itemMagnetRing), new PageCrafting(1, ItemCrafting.recipeMagnetRing));
new BookletChapter("growthRing", entryItemsRF, new ItemStack(InitItems.itemGrowthRing), new PageCrafting(1, ItemCrafting.recipeGrowthRing)); new BookletChapter("growthRing", entryItemsRF, new ItemStack(InitItems.itemGrowthRing), new PageCrafting(1, ItemCrafting.recipeGrowthRing));

View file

@ -12,6 +12,7 @@ package ellpeck.actuallyadditions.crafting;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.blocks.metalists.TheColoredLampColors;
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
import ellpeck.actuallyadditions.config.ConfigValues; import ellpeck.actuallyadditions.config.ConfigValues;
import ellpeck.actuallyadditions.config.values.ConfigCrafting; import ellpeck.actuallyadditions.config.values.ConfigCrafting;
@ -42,8 +43,7 @@ public class ItemCrafting{
public static IRecipe recipeTinyChar; public static IRecipe recipeTinyChar;
public static ArrayList<IRecipe> recipesMashedFood = new ArrayList<IRecipe>(); public static ArrayList<IRecipe> recipesMashedFood = new ArrayList<IRecipe>();
public static IRecipe recipeDrill; public static IRecipe recipeDrill;
public static IRecipe recipeDrillEmerald; public static IRecipe[] recipesDrillColoring = new IRecipe[16];
public static IRecipe recipeDrillPurple;
public static IRecipe recipeDrillSpeedI; public static IRecipe recipeDrillSpeedI;
public static IRecipe recipeDrillSpeedII; public static IRecipe recipeDrillSpeedII;
public static IRecipe recipeDrillSpeedIII; public static IRecipe recipeDrillSpeedIII;
@ -146,7 +146,8 @@ public class ItemCrafting{
//Drill //Drill
if(ConfigCrafting.DRILL.isEnabled()){ if(ConfigCrafting.DRILL.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrill), ItemStack lightBlueDrill = new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal());
GameRegistry.addRecipe(new ShapedOreRecipe(lightBlueDrill.copy(),
"DDD", "CRC", "III", "DDD", "CRC", "III",
'D', "crystalLightBlue", 'D', "crystalLightBlue",
'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()),
@ -154,22 +155,10 @@ public class ItemCrafting{
'I', "blockCrystalWhite")); 'I', "blockCrystalWhite"));
recipeDrill = Util.GetRecipes.lastIRecipe(); recipeDrill = Util.GetRecipes.lastIRecipe();
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrill, 1, 1), for(int i = 0; i < recipesDrillColoring.length; i++){
"DDD", "CRC", "III", GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemDrill, 1, i), lightBlueDrill.copy(), "dye"+TheColoredLampColors.values()[i].name));
'D', "crystalGreen", recipesDrillColoring[i] = Util.GetRecipes.lastIRecipe();
'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), }
'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()),
'I', "blockCrystalWhite"));
recipeDrillEmerald = Util.GetRecipes.lastIRecipe();
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrill, 1, 2),
"DFD", "CRC", "III",
'F', "blockCrystalRed",
'D', "crystalLightBlue",
'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()),
'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()),
'I', "blockCrystalWhite"));
recipeDrillPurple = Util.GetRecipes.lastIRecipe();
} }
//Drill Core //Drill Core

View file

@ -51,21 +51,20 @@ import java.util.Set;
public class ItemDrill extends ItemEnergy{ public class ItemDrill extends ItemEnergy{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private IIcon emeraldIcon; private IIcon[] allDemDamnIconsMaan;
@SideOnly(Side.CLIENT)
private IIcon purpleIcon;
private static final int ENERGY_USE = 100; private static final int ENERGY_USE = 100;
public ItemDrill(){ public ItemDrill(){
super(500000, 5000); super(500000, 5000);
this.setMaxDamage(0); this.setMaxDamage(0);
this.setHasSubtypes(true);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1){ public IIcon getIconFromDamage(int par1){
return par1 == 0 ? this.itemIcon : (par1 == 2 ? this.purpleIcon : this.emeraldIcon); return par1 >= this.allDemDamnIconsMaan.length ? null : this.allDemDamnIconsMaan[par1];
} }
@Override @Override
@ -77,10 +76,9 @@ public class ItemDrill extends ItemEnergy{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list){ public void getSubItems(Item item, CreativeTabs tabs, List list){
super.getSubItems(item, tabs, list); for(int i = 0; i < this.allDemDamnIconsMaan.length; i++){
this.addDrillStack(list, i);
this.addDrillStack(list, 1); }
this.addDrillStack(list, 2);
} }
private void addDrillStack(List list, int meta){ private void addDrillStack(List list, int meta){
@ -232,9 +230,10 @@ public class ItemDrill extends ItemEnergy{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){ public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); this.allDemDamnIconsMaan = new IIcon[16];
this.emeraldIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Emerald"); for(int i = 0; i < this.allDemDamnIconsMaan.length; i++){
this.purpleIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Purple"); this.allDemDamnIconsMaan[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+(i+1));
}
} }
@Override @Override

View file

@ -12,7 +12,6 @@ package ellpeck.actuallyadditions.recipe;
import ellpeck.actuallyadditions.blocks.metalists.TheColoredLampColors; import ellpeck.actuallyadditions.blocks.metalists.TheColoredLampColors;
import ellpeck.actuallyadditions.config.values.ConfigCrafting; import ellpeck.actuallyadditions.config.values.ConfigCrafting;
import ellpeck.actuallyadditions.util.AssetUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -178,7 +177,7 @@ public class ReconstructorRecipeHandler{
public float[] getColor(){ public float[] getColor(){
if(this == COLOR){ if(this == COLOR){
float[] colors = AssetUtil.RGB_WOOL_COLORS[Util.RANDOM.nextInt(AssetUtil.RGB_WOOL_COLORS.length)]; float[] colors = possibleColorLensColors[Util.RANDOM.nextInt(possibleColorLensColors.length)];
return new float[]{colors[0]/255F, colors[1]/255F, colors[2]/255F}; return new float[]{colors[0]/255F, colors[1]/255F, colors[2]/255F};
} }
else if(this == DETONATION){ else if(this == DETONATION){
@ -197,6 +196,22 @@ public class ReconstructorRecipeHandler{
public int getDistance(){ public int getDistance(){
return this == DETONATION ? 30 : (this == JUST_DAMAGE ? 15 : 10); return this == DETONATION ? 30 : (this == JUST_DAMAGE ? 15 : 10);
} }
//Thanks to xdjackiexd for this, as I couldn't be bothered
private static final float[][] possibleColorLensColors = {
{158F, 43F, 39F}, //Red
{234F, 126F, 53F}, //Orange
{194F, 181F, 28F}, //Yellow
{57F, 186F, 46F}, //Lime Green
{54F, 75F, 24F}, //Green
{99F, 135F, 210F}, //Light Blue
{38F, 113F, 145F}, //Cyan
{37F, 49F, 147F}, //Blue
{126F, 52F, 191F}, //Purple
{190F, 73F, 201F}, //Magenta
{217F, 129F, 153F}, //Pink
{86F, 51F, 28F}, //Brown
};
} }
} }

View file

@ -38,24 +38,6 @@ public class AssetUtil{
public static int laserRelayRenderId; public static int laserRelayRenderId;
public static int bookletStandRenderId; public static int bookletStandRenderId;
/**
* Thanks to xdjackiexd for this, as I couldn't be bothered
*/
public static final float[][] RGB_WOOL_COLORS = {
{158F, 43F, 39F}, //Red
{234F, 126F, 53F}, //Orange
{194F, 181F, 28F}, //Yellow
{57F, 186F, 46F}, //Lime Green
{54F, 75F, 24F}, //Green
{99F, 135F, 210F}, //Light Blue
{38F, 113F, 145F}, //Cyan
{37F, 49F, 147F}, //Blue
{126F, 52F, 191F}, //Purple
{190F, 73F, 201F}, //Magenta
{217F, 129F, 153F}, //Pink
{86F, 51F, 28F}, //Brown
};
public static ResourceLocation getGuiLocation(String file){ public static ResourceLocation getGuiLocation(String file){
return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/"+file+".png"); return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/"+file+".png");
} }

View file

@ -560,7 +560,7 @@ booklet.actuallyadditions.chapter.potionRings.text.1=The <item>Potion Rings<r> h
booklet.actuallyadditions.chapter.drill.name=Drills booklet.actuallyadditions.chapter.drill.name=Drills
booklet.actuallyadditions.chapter.drill.text.1=The <item>Drill<r> works like a Pickaxe and a Shovel. It uses <imp>RF<r> per block. It can be <imp>charged in an Energizer<r> and upgraded by <imp>right-clicking<r> with it in your hand. There is <imp>a lot of upgrades<r>, but here is an explanation of some of them: <n>The <item>Mining Uprgades<r> enlarge the hole which the Drill digs. <n>The <item>Placement Upgrade<r>, after you right-click it in any slot of your hotbar, will make the Drill able to <imp>place a block from that slot by right-clicking<r>. You can also put a <item>Battery<r> inside the Drill to give it more charge. booklet.actuallyadditions.chapter.drill.text.1=The <item>Drill<r> works like a Pickaxe and a Shovel. It uses <imp>RF<r> per block. It can be <imp>charged in an Energizer<r> and upgraded by <imp>right-clicking<r> with it in your hand. There is <imp>a lot of upgrades<r>, but here is an explanation of some of them: <n>The <item>Mining Uprgades<r> enlarge the hole which the Drill digs. <n>The <item>Placement Upgrade<r>, after you right-click it in any slot of your hotbar, will make the Drill able to <imp>place a block from that slot by right-clicking<r>. You can also put a <item>Battery<r> inside the Drill to give it more charge.
booklet.actuallyadditions.chapter.drill.text.2=The <item>Drill<r> can be crafted from either <imp>Diamond<r>, <imp>Emerald<r> or <imp>Redstone and Diamond<r>. Its color will change accordingly. booklet.actuallyadditions.chapter.drill.text.3=The <item>Drill<r> can also be <imp>dyed<r> in Minecraft's 16 colors. <n>It's only cosmetic and won't have any effect other than it looking different, however.
booklet.actuallyadditions.chapter.staff.name=Staff booklet.actuallyadditions.chapter.staff.name=Staff
booklet.actuallyadditions.chapter.staff.text.1=The <item>Teleport Staff<r>, when charged in an Energizer, can be <imp>right-clicked<r> to <imp>teleport you to where you're looking<r>. When you are looking at a block, it will teleport you there, however, when you aren't looking at a block, you can only be looking upwards up to <imp>5 degrees<r>, otherwise the teleport will fail. booklet.actuallyadditions.chapter.staff.text.1=The <item>Teleport Staff<r>, when charged in an Energizer, can be <imp>right-clicked<r> to <imp>teleport you to where you're looking<r>. When you are looking at a block, it will teleport you there, however, when you aren't looking at a block, you can only be looking upwards up to <imp>5 degrees<r>, otherwise the teleport will fail.