From a719a1c56322280e49c170d9bb0cf391a0e10671 Mon Sep 17 00:00:00 2001 From: Prospector Date: Sun, 5 Jun 2016 01:33:40 -0700 Subject: [PATCH 1/5] Holy huge commit with unhelpful name batman! -Added TRNoDestroy (for items that do not use JSONDestroyer) -Batteries now use item overrides to display different texture when empty -Fixed diamond nugget unity texture -Removed new fluid sources from JEI -Fixed empty cell lang entry --- .../textures/items/nuggets/diamondNugget.png | Bin 650 -> 661 bytes .../textures/items/tool/energyCrystal.png | Bin 688 -> 794 bytes .../items/tool/energyCrystalEmpty.png | Bin 0 -> 799 bytes .../textures/items/tool/lapotronCrystal.png | Bin 687 -> 785 bytes .../items/tool/lapotronCrystalEmpty.png | Bin 0 -> 767 bytes .../techreborn/client/RegisterItemJsons.java | 33 +++++++++++++-- .../compat/jei/TechRebornJeiPlugin.java | 9 ++++ .../techreborn/items/ItemTRNoDestroy.java | 15 +++++++ .../techreborn/items/battery/ItemBattery.java | 39 ++++++++++-------- .../items/battery/ItemReBattery.java | 6 ++- .../java/techreborn/proxies/ClientProxy.java | 2 +- .../assets/techreborn/lang/en_US.lang | 39 +----------------- .../techreborn/models/item/energyCrystal.json | 14 +++++++ .../models/item/energyCrystalEmpty.json | 6 +++ .../models/item/lapotronCrystal.json | 14 +++++++ .../models/item/lapotronCrystalEmpty.json | 6 +++ .../models/item/lithiumBattery.json | 14 +++++++ .../models/item/lithiumBatteryEmpty.json | 6 +++ .../techreborn/models/item/reBattery.json | 14 +++++++ .../models/item/reBatteryEmpty.json | 6 +++ .../models/item/techrebornItem.json | 3 ++ 21 files changed, 163 insertions(+), 63 deletions(-) create mode 100644 run/resourcepacks/unity/assets/techreborn/textures/items/tool/energyCrystalEmpty.png create mode 100644 run/resourcepacks/unity/assets/techreborn/textures/items/tool/lapotronCrystalEmpty.png create mode 100644 src/main/java/techreborn/items/ItemTRNoDestroy.java create mode 100644 src/main/resources/assets/techreborn/models/item/energyCrystal.json create mode 100644 src/main/resources/assets/techreborn/models/item/energyCrystalEmpty.json create mode 100644 src/main/resources/assets/techreborn/models/item/lapotronCrystal.json create mode 100644 src/main/resources/assets/techreborn/models/item/lapotronCrystalEmpty.json create mode 100644 src/main/resources/assets/techreborn/models/item/lithiumBattery.json create mode 100644 src/main/resources/assets/techreborn/models/item/lithiumBatteryEmpty.json create mode 100644 src/main/resources/assets/techreborn/models/item/reBattery.json create mode 100644 src/main/resources/assets/techreborn/models/item/reBatteryEmpty.json create mode 100644 src/main/resources/assets/techreborn/models/item/techrebornItem.json diff --git a/run/resourcepacks/unity/assets/techreborn/textures/items/nuggets/diamondNugget.png b/run/resourcepacks/unity/assets/techreborn/textures/items/nuggets/diamondNugget.png index cf3c314dc08a0d75c541e7de4142a4a9791168d9..1250f5366f25a5b07f0e1dc733482d97c3f253eb 100644 GIT binary patch delta 562 zcmV-20?qx31(gMmB#|)~3K0MR3lRZ-WM7eyQ#pSE07*naR5(w4lfO?>Q546|pW)=- ze_-P7=E7#8iLryDiJPl&@((bEL1}8KEkiA-h6q9=!3q==mZ?MeIam+W+YN;?Q-dv9Nw2OUYjn;ifMB7@%XNgQ+>MP4VT zr~VrsAc(-)emeo+V2(#FXk}}AM4SQRoST7cwf2${xY>mBTK${cE95lwDyw&M8I8`) zyqyw#Ij#&c$jrV^GT>$af6vb)m3yg+L7;z|7Z+M}dYI4a@|O({KmZy)4hALAVJm@~ z0NlxCb;$+JI~AiyC%RotIS781#pdpA0>EeuLpL)MT5`d8r*Q{()M)5fHtPY_Oy7gy z5|Cv;Ik$^NeG-QH*y(yYtsmFcy$|EIQNADp9t=bd41{htzysHZ`~ALNot#ul9Wj3i zGKc{fhXH(FD-`rrtEFSLnqF}LY?gk#{XGHjG&!_j1JU)%4syu_lRiEs0E-)6WxQM- zErBr_02^YDow`ZgZU^wJG!6E_gZYOjuUIQZ%7X{pree)WOo001X`8XOVb zX6EcaH+N*E(ex`B#DM>aMh)xv+Zh@kIMB5G1HRjfD_IQ`%-6o${Ava;X@n2=c5QCdi7tu$5^lxiqILS>NPk_Cz25+Gz;STqVO*(GFQW!FKS z&EfyF{Der^86;y9k$;E}= zr$yh6wm}6G3m>xz$P57Ul$ut;&~05^xr*wgu4w@P0#G|@^?zF6gslZK0T?Zp-I^Lp zs_7(gucOF4Q3!EX#n%3Q24K?;3=J!wpyoHK5d}Q0)!g9fst4F%`ZLJ4fUE-AdAzyl zp2x9!rWz=fTULefX1CH2H$ep{fXzIB^?mL6 zL8IaBRjaN~0e|dS`Mb^U8GxtBM>89U;JXUBb7Rg6z{=NeGEywwZh>nw0DFiz`}9re zmL0&Wf&%z4xKmygL1e(lXs?bjZ+`J^MuO_DAHC5601(7aLm=X`xpU@U>U*+YtNW1( nQo#SjLFF|%H}8!-&B!&^ewFoy<-8040000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc00(qQO+^Rb1RV}7 z0H@dQMF0Q*7<5HgbW?9;ba!ELWdLwtX>N2bZe?^JG%heMIczh2P5=M`cu7P-R9HvN z)KN%NVH5}O@1X+a5)L1Nq!wwgHNnm4FxmHbkq@B{QTny>cjvOrOCh-32EXy0bMLoxnmro({o~&Y{=^vo|3LO3Z9@PHiFwk0U=0n~BD39DQ=%|xq&GkFy!1Cc01eX$^ zUXSzwt<~mw6f6J_QtR|X#DkY-J_FZ$KM!^UI-z^fqYDNqZSd{Kk{|}} z1eCS6KxJ$cl$+;)_Ea|~`UglKkE+2r;C|d%CrP+=6%SrMeF>(IH^JlGCYUg6hp8_~ zLB#DSC@qbUIWw!!KS26;*a9&~Se=saXa2}Z2v;41-whWbxT_jwO#2`?6^E$U3gU7^ zkkl4yWEHvvpyNRJc+~jDAZBw)!Vlf(u?9#SsE0nI5kBp4z`)*Wm>+)w5ut!+3<#1t zoZw6M0L*d!88p9>FjnJ|gdG@H5y zVCD;caNQe*-W?`Mk`@;{*jWx;WvhIt5X9IT5=7LyL2GZO*<`v0U?rzIplwr;B(c&8 z@Q5uCGMd0AN+9?5f1}yVrF(!}*TrT@xb~!8HiYZ-&}{yT?g2KEX0wnqn}wv=EF3BR Y0BpbTOrAz*Q2+n{07*qoM6N<$f>6y=TL1t6 literal 688 zcmV;h0#E&kP)deF?fnaVmK>4SC(49VCoUq^x}18?7RIL5$^{ueB4PZ8$a;b8!c z-ds*zc_~rzE~XSvN55c?(~ut@&u#lN4n}Jk(ELD|bmK+^?{vhrG`@yTzBN19bL2R# zC36q!tvToNid5jioJQ*R+%0?V@e(e(_tHWcGqZ zhPR|iBeCMDI46x86UA`D0VP)=)TxMswZg8mH`%-`nUk%Tq;yjfT|PIzf)I4MX{)v> z<71;pPs1v8uF`u#Sv@t{SaBrolsaOh-Iyv@NszVtv8Hj(6D=Y_9Xk1!!6GR9Py7LV WA+9#jQWFsX0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc00(qQO+^Rb1RV}7 z0H@dQMF0Q*7<5HgbW?9;ba!ELWdLwtX>N2bZe?^JG%heMIczh2P5=M`eMv+?R9HvN z)89*zQ5XmC_fM#_U1(Bv5t^?~Q_>je=4zRKf;dAfjV5UnSeSuS z&{m0%T@_svt)M6eUIo=3us`Co=Nr#>H{Phg?R4=O@AI6)dA^Kulz2RzF=gjEf$O^Y z8PM)YDYl#Z0KFYB{^kX6-?p*<^qp*GLdF6d9vcF`#Ue=hy0Om%?(i}^-TDl?e)Q@D z(08)=FR~VZ2XW1phzEcF5(BPzKM!u62*7IW1MoSO-T|QRWK)l{06d86mf#|A%>zH) zUj=`i8F;;6JOn(L@nvMCJejaB+Vc`A^>j^>p=0t!59=tK^gL~cmFlamklf^2${}fY* zIyeW#t*1ddGo_FofS-pWxCD1?c0m$r@W9mrK9d!mdq%-ytcJx}8*E0Sa529S4zvXn zqMgN33TXl8IS_sxO{23AvNj09m+nft8&(|c(5tGjV5$di;sTQB+B)+ck+^gfV%chkt`ZeGib{Zk9O=5CkUeH6=$*}Un@oBDR&>%04Y>wE zrqwEF+?5NSvPx*q$pgJJen+>NPI`cJ$9Cih!nJ*;K@jbpzopy!6X^lAlWsGcbeq|v d2q7dA%1@e`JS+`PLx}(Y002ovPDHLkV1n`2TZjMv literal 0 HcmV?d00001 diff --git a/run/resourcepacks/unity/assets/techreborn/textures/items/tool/lapotronCrystal.png b/run/resourcepacks/unity/assets/techreborn/textures/items/tool/lapotronCrystal.png index 4e4f302e1ff1448a3e5178ae30b67842b392592b..6d80c3cc29be344f5bdd00fc286375b06eb146c1 100644 GIT binary patch literal 785 zcmV+s1Md8ZP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc00(qQO+^Rb1RV}6 zG4B%IJ^%m!7<5HgbW?9;ba!ELWdLwtX>N2bZe?^JG%heMIczh2P5=M`Z%IT!R9HvN z(_KhYVHgMS_oA!VMWc%@q>L!g6fDf$L_q{zNCa6y3TeYW2o<5)thuxgTNkyJY|w{J zq#4yDK|{!(JM9Y&Qf3Gil;K3nz-Tv7y`AU3J%_X7p%C28gdd#eIrIGg9L_7Glxbu0 zHh?xi>ID67Qii2weSxNWD4Tl?+Wut^(6zQqhqM*2-SmK?v0IV__gfA_!J7f-h{r&? zA8iA=)|QKru>u^V&B>35gOxc6JoE24*b(xI!J;#3r=vrHvv8(_G@mw5wDhbaV z*#1F6u`2?6KmXdGBpl56V`Mf@b(R&-9}luA^i~q%tLC})^B-s)9EZY_UGU|59PHQz63V0Fu&(Yl>=>Ab(T_7A z&JKaCwn`B7k(!jj`U1)0u{oqj!ms+lWI}2GEEJuOz=5G(u=aEZV+ z4okALcM3|}?a-pc;neUqSQQ!rvEK(Ayu88(cE18*?*%aCkOd23c>$Jx)Gx`li#@RV zcpDVlpMf>btB`Z(GKhWZD^}$;ghA}~fbqF{rb}jd0k)!|S(0UCZde&mK0{8I+|2aNDUPcn1O^OQ7BkhpadzVR>HUt7cPRL5)XpQ)0wrDo8 zY$e1jOf#_z{&k2ScaoHL0q2`WVvlEI{yD(RN{HEDEG+%r@>(VlA@fPQoVrv-P(enb zA|N3;+nV{Yy20L!0NI75D5Y@vOaP31vLkJpDI#I8rpz?lVds~w)7D~VaV@~vt3||} z$YI>ShEj@mt*y*@XBg{x9chkC@E56-&t%`B!%XQqiPz3qe~!1QtmYsx{~lM_gH zy=j|-%}BoSNR}7ZNV-^zukQoaV@Gh$%^(iV^zZMz!{U&8M??e)YUO_mwrzrF@dqBo VjaQ&>F>3$-002ovPDHLkV1fkVG`au) diff --git a/run/resourcepacks/unity/assets/techreborn/textures/items/tool/lapotronCrystalEmpty.png b/run/resourcepacks/unity/assets/techreborn/textures/items/tool/lapotronCrystalEmpty.png new file mode 100644 index 0000000000000000000000000000000000000000..8fc0545a9d5df8bb91468dc4943e760e1b98665e GIT binary patch literal 767 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc00(qQO+^Rb1RV}6 zG4B%IJ^%m!7<5HgbW?9;ba!ELWdLwtX>N2bZe?^JG%heMIczh2P5=M`T}ebiR9HvN z)9-6iQ5Xks|B;|ZKSo4Bcw0<21-G2u&E*fA)1eG?*fw!&HM)iwBw@r#Sh1QmqF&s# z6%|EBj(pRbv46n-=H&B*N3M3Gg6Z|e2hQ`H%l$qa&M`F_jjp*8^a0nhvIg33+KS_5 z_yAJiI^_1=0QddHJkYw;?1rulU`s~9J$FNp&V4E9f%xVlQ0oW4`_8pA(7M(9A3Ym@ zgSh5P#KEIvMVCB9bokz{}?zcJ=o>pKilz_vdBd|qR!8+qJk$CALn7uMk zMk|aMJ^(+D@SVqkG<$HbvJb9E3OG3X;w>x{N?`RyAywRlYV8L|p)_2a7&j4ZW?NzS z0Q@`xnSArod=BpUWl*+Mu+PRJaO(jSD=NHt_Zcot#Xy_I+6u!4pyxpN zd3X}5f^cx<<9CQ<6o?l#;i@|XzMBPbgpzQ(^b($_A7Ieoht6=)9|N%IWLglubh+{_ zZ0}cLYwrula|yq4BE{88h|;&2|<$0VAApTEkC%9pD=<7AhDfdiL+&7$U4A%Yb;F2% z9tMUSp!aX4+hm3hz%Dc|4moAE!?lzGCnX1P;5nNNdjI$n-DW4l2k3O-@~9wO4-AhB xqW$Jy={Eny@BxmKZnKwko4sTbLKsMxegPaRNm}W&rilOm002ovPDHLkV1jQ{O3eTO literal 0 HcmV?d00001 diff --git a/src/main/java/techreborn/client/RegisterItemJsons.java b/src/main/java/techreborn/client/RegisterItemJsons.java index 463c0eaf4..3110f829c 100644 --- a/src/main/java/techreborn/client/RegisterItemJsons.java +++ b/src/main/java/techreborn/client/RegisterItemJsons.java @@ -1,9 +1,11 @@ package techreborn.client; -import net.minecraft.client.Minecraft; +import net.minecraft.block.Block; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; +import net.minecraftforge.client.model.ModelLoader; import techreborn.init.ModBlocks; +import techreborn.init.ModItems; public class RegisterItemJsons { @@ -15,12 +17,35 @@ public class RegisterItemJsons private static void registerItems() { + register(ModItems.reBattery, "reBattery"); + register(ModItems.lithiumBattery, "lithiumBattery"); + register(ModItems.energyCrystal, "energyCrystal"); + register(ModItems.lapotronCrystal, "lapotronCrystal"); } private static void registerBlocks() { - Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( - Item.getItemFromBlock(ModBlocks.ironFence), 0, - new ModelResourceLocation("techreborn:ironFence", "inventory")); + register(ModBlocks.ironFence, "ironFence"); + } + + private static void register(Item item, int meta, String name) + { + ModelLoader.setCustomModelResourceLocation(item, meta, + new ModelResourceLocation("techreborn:" + name, "inventory")); + } + + private static void register(Item item, String name) + { + register(item, 0, name); + } + + private static void register(Block block, int meta, String name) + { + register(Item.getItemFromBlock(block), meta, name); + } + + private static void register(Block block, String name) + { + register(Item.getItemFromBlock(block), 0, name); } } diff --git a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java index d42304883..b3c5332cd 100644 --- a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java +++ b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java @@ -111,6 +111,15 @@ import java.util.List; jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodiumpersulfate)); jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidTritium)); jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidWolframium)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSulfur)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSulfuricAcid)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCarbon)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCarbonFiber)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitroCarbon)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodiumSulfide)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidDiesel)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitroDiesel)); + jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidOil)); registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper), new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper), diff --git a/src/main/java/techreborn/items/ItemTRNoDestroy.java b/src/main/java/techreborn/items/ItemTRNoDestroy.java new file mode 100644 index 000000000..766098b50 --- /dev/null +++ b/src/main/java/techreborn/items/ItemTRNoDestroy.java @@ -0,0 +1,15 @@ +package techreborn.items; + +import net.minecraft.item.Item; +import techreborn.client.TechRebornCreativeTab; + +public class ItemTRNoDestroy extends Item +{ + + public ItemTRNoDestroy() + { + setNoRepair(); + setCreativeTab(TechRebornCreativeTab.instance); + } + +} diff --git a/src/main/java/techreborn/items/battery/ItemBattery.java b/src/main/java/techreborn/items/battery/ItemBattery.java index f47805596..6f451dbe9 100644 --- a/src/main/java/techreborn/items/battery/ItemBattery.java +++ b/src/main/java/techreborn/items/battery/ItemBattery.java @@ -1,18 +1,22 @@ package techreborn.items.battery; -import java.util.List; - import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.api.power.IEnergyItemInfo; import reborncore.common.powerSystem.PoweredItem; -import techreborn.client.TechRebornCreativeTab; -import techreborn.items.ItemTextureBase; +import techreborn.items.ItemTRNoDestroy; -public class ItemBattery extends ItemTextureBase implements IEnergyItemInfo +import javax.annotation.Nullable; +import java.util.List; + +public class ItemBattery extends ItemTRNoDestroy implements IEnergyItemInfo { String name = "null"; @@ -30,7 +34,18 @@ public class ItemBattery extends ItemTextureBase implements IEnergyItemInfo this.maxEnergy=maxEnergy; this.maxTransfer=maxTransfer; this.tier=tier; - setCreativeTab(TechRebornCreativeTab.instance); + this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter() + { + @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, + @Nullable EntityLivingBase entityIn) + { + if (stack != null && PoweredItem.getEnergy(stack) == 0.0) + { + return 1.0F; + } + return 0.0F; + } + }); } @SuppressWarnings({ "rawtypes", "unchecked" }) @@ -88,16 +103,4 @@ public class ItemBattery extends ItemTextureBase implements IEnergyItemInfo { return tier; } - - @Override - public String getTextureName(int damage) - { - return "techreborn:items/tool/"+name; - } - - @Override - public int getMaxMeta() - { - return 1; - } } diff --git a/src/main/java/techreborn/items/battery/ItemReBattery.java b/src/main/java/techreborn/items/battery/ItemReBattery.java index 0030458e2..4c8eef762 100644 --- a/src/main/java/techreborn/items/battery/ItemReBattery.java +++ b/src/main/java/techreborn/items/battery/ItemReBattery.java @@ -1,8 +1,10 @@ package techreborn.items.battery; -public class ItemReBattery extends ItemBattery { +public class ItemReBattery extends ItemBattery +{ - public ItemReBattery() { + public ItemReBattery() + { super("rebattery", 10000, 64, 1); } } diff --git a/src/main/java/techreborn/proxies/ClientProxy.java b/src/main/java/techreborn/proxies/ClientProxy.java index 7930f2ba8..eca79dab1 100644 --- a/src/main/java/techreborn/proxies/ClientProxy.java +++ b/src/main/java/techreborn/proxies/ClientProxy.java @@ -79,13 +79,13 @@ public class ClientProxy extends CommonProxy } }); ModelBakery.registerItemVariants(ModItems.dynamicCell, MODEL_DYNAMIC_CELL); + RegisterItemJsons.registerModels(); } @Override public void init(FMLInitializationEvent event) { super.init(event); - RegisterItemJsons.registerModels(); MinecraftForge.EVENT_BUS.register(new IconSupplier()); MinecraftForge.EVENT_BUS.register(new ChargeHud()); //MinecraftForge.EVENT_BUS.register(new VersionCheckerClient()); diff --git a/src/main/resources/assets/techreborn/lang/en_US.lang b/src/main/resources/assets/techreborn/lang/en_US.lang index afc467461..1721947ca 100644 --- a/src/main/resources/assets/techreborn/lang/en_US.lang +++ b/src/main/resources/assets/techreborn/lang/en_US.lang @@ -365,44 +365,7 @@ item.techreborn.dustsmall.andesite.name=Small Pile of Andesite Dust item.techreborn.dustsmall.diorite.name=Small Pile of Diorite Dust item.techreborn.dustsmall.granite.name=Small Pile of Granite Dust -#Cells -item.techreborn.cell.Berylium.name=Beryllium Cell -item.techreborn.cell.biomass.name=Biomass Cell -item.techreborn.cell.calciumCarbonate.name=Calcium Carbonate Cell -item.techreborn.cell.calcium.name=Calcium Cell -item.techreborn.cell.carbon.name=Carbon Cell -item.techreborn.cell.chlorine.name=Chlorine Cell -item.techreborn.cell.deuterium.name=Deuterium Cell -item.techreborn.cell.diesel.name=Diesel Cell -item.techreborn.cell.ethanol.name=Ethanol Cell -item.techreborn.cell.glyceryl.name=Glyceryl Cell -item.techreborn.cell.helium3.name=Helium3 Cell -item.techreborn.cell.helium.name=Helium Cell -item.techreborn.cell.heliumPlasma.name=Helium Plasma Cell -item.techreborn.cell.hydrogen.name=Hydrogen Cell -item.techreborn.cell.ice.name=Ice Cell -item.techreborn.cell.lithium.name=Lithium Cell -item.techreborn.cell.mercury.name=Mercury Cell -item.techreborn.cell.methane.name=Methane Cell -item.techreborn.cell.nitrocarbon.name=Nitrocarbon Cell -item.techreborn.cell.nitroCoalfuel.name=Nitro Coal Fuel Cell -item.techreborn.cell.nitroDiesel.name=Nitro Diesel Cell -item.techreborn.cell.nitrogen.name=Nitrogen Cell -item.techreborn.cell.nitrogenDioxide.name=Nitrogen Dioxide Cell -item.techreborn.cell.oil.name=Oil Cell -item.techreborn.cell.potassium.name=Potassium Cell -item.techreborn.cell.seedOil.name=Seed Oil Cell -item.techreborn.cell.silicon.name=Silicon Cell -item.techreborn.cell.sodium.name=Sodium Cell -item.techreborn.cell.sodiumPersulfate.name=Sodium Persulfate Cell -item.techreborn.cell.sodiumSulfide.name=Sodium Sulfide Cell -item.techreborn.cell.sulfur.name=Sulfur Cell -item.techreborn.cell.sulfuricAcid.name=Sulfuric Acid Cell -item.techreborn.cell.tritium.name=Tritium Cell -item.techreborn.cell.wolframium.name=Wolframium Cell -item.techreborn.cell.empty.name=Empty Cell -item.techreborn.cell.water.name=Water Cell -item.techreborn.cell.lava.name=Lava Cell +item.techreborn.cell.name=Empty Cell item.techreborn.rebattery.name=Battery item.techreborn.lithiumBattery.name=Lithium Battery item.techreborn.energyCrystal.name=Energy Crystal diff --git a/src/main/resources/assets/techreborn/models/item/energyCrystal.json b/src/main/resources/assets/techreborn/models/item/energyCrystal.json new file mode 100644 index 000000000..87a1dc719 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/energyCrystal.json @@ -0,0 +1,14 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/energyCrystal" + }, + "overrides": [ + { + "predicate": { + "techreborn:empty": 1 + }, + "model": "techreborn:item/energyCrystalEmpty" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/energyCrystalEmpty.json b/src/main/resources/assets/techreborn/models/item/energyCrystalEmpty.json new file mode 100644 index 000000000..942cc38cf --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/energyCrystalEmpty.json @@ -0,0 +1,6 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/energyCrystalEmpty" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/lapotronCrystal.json b/src/main/resources/assets/techreborn/models/item/lapotronCrystal.json new file mode 100644 index 000000000..2e3ed8952 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/lapotronCrystal.json @@ -0,0 +1,14 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/lapotronCrystal" + }, + "overrides": [ + { + "predicate": { + "techreborn:empty": 1 + }, + "model": "techreborn:item/lapotronCrystalEmpty" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/lapotronCrystalEmpty.json b/src/main/resources/assets/techreborn/models/item/lapotronCrystalEmpty.json new file mode 100644 index 000000000..aa286dcc3 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/lapotronCrystalEmpty.json @@ -0,0 +1,6 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/lapotronCrystalEmpty" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/lithiumBattery.json b/src/main/resources/assets/techreborn/models/item/lithiumBattery.json new file mode 100644 index 000000000..b446171d8 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/lithiumBattery.json @@ -0,0 +1,14 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/lithiumBattery" + }, + "overrides": [ + { + "predicate": { + "techreborn:empty": 1 + }, + "model": "techreborn:item/lithiumBatteryEmpty" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/lithiumBatteryEmpty.json b/src/main/resources/assets/techreborn/models/item/lithiumBatteryEmpty.json new file mode 100644 index 000000000..5573739c3 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/lithiumBatteryEmpty.json @@ -0,0 +1,6 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/lithiumBatteryEmpty" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/reBattery.json b/src/main/resources/assets/techreborn/models/item/reBattery.json new file mode 100644 index 000000000..008987e13 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/reBattery.json @@ -0,0 +1,14 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/reBattery" + }, + "overrides": [ + { + "predicate": { + "techreborn:empty": 1 + }, + "model": "techreborn:item/reBatteryEmpty" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/reBatteryEmpty.json b/src/main/resources/assets/techreborn/models/item/reBatteryEmpty.json new file mode 100644 index 000000000..a3fe39da4 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/reBatteryEmpty.json @@ -0,0 +1,6 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/reBatteryEmpty" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/techrebornItem.json b/src/main/resources/assets/techreborn/models/item/techrebornItem.json new file mode 100644 index 000000000..9a5d7fc5e --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/techrebornItem.json @@ -0,0 +1,3 @@ +{ + "parent": "item/generated" +} \ No newline at end of file From 4c01fa8864a9d5351cf28b888c1a41956fdf37c0 Mon Sep 17 00:00:00 2001 From: Prospector Date: Sun, 5 Jun 2016 03:57:38 -0700 Subject: [PATCH 2/5] Started work on fixing nanosaber --- .../techreborn/client/RegisterItemJsons.java | 1 + .../techreborn/config/ConfigTechReborn.java | 5 + .../techreborn/items/tools/ItemNanosaber.java | 235 ++++++++++-------- src/main/java/techreborn/lib/MessageIDs.java | 1 + .../assets/techreborn/lang/en_US.lang | 2 + .../techreborn/models/item/nanosaber.json | 14 ++ .../models/item/nanosaberActive.json | 6 + 7 files changed, 156 insertions(+), 108 deletions(-) create mode 100644 src/main/resources/assets/techreborn/models/item/nanosaber.json create mode 100644 src/main/resources/assets/techreborn/models/item/nanosaberActive.json diff --git a/src/main/java/techreborn/client/RegisterItemJsons.java b/src/main/java/techreborn/client/RegisterItemJsons.java index 3110f829c..bb6bc0e1c 100644 --- a/src/main/java/techreborn/client/RegisterItemJsons.java +++ b/src/main/java/techreborn/client/RegisterItemJsons.java @@ -21,6 +21,7 @@ public class RegisterItemJsons register(ModItems.lithiumBattery, "lithiumBattery"); register(ModItems.energyCrystal, "energyCrystal"); register(ModItems.lapotronCrystal, "lapotronCrystal"); + register(ModItems.nanosaber, "nanosaber"); } private static void registerBlocks() diff --git a/src/main/java/techreborn/config/ConfigTechReborn.java b/src/main/java/techreborn/config/ConfigTechReborn.java index 2c5a3e0fa..fe45961b5 100644 --- a/src/main/java/techreborn/config/ConfigTechReborn.java +++ b/src/main/java/techreborn/config/ConfigTechReborn.java @@ -82,6 +82,7 @@ public class ConfigTechReborn public static boolean FreqTransmitterChat; public static boolean FreqTransmitterTooltip; + public static boolean NanosaberChat; // EU/T public static int CloakingDeviceEUTick; // Crafting @@ -373,6 +374,10 @@ public class ConfigTechReborn .get(CATEGORY_FEATURES, "Frequency Transmitter tooltips", true, "Allow Frequency Transmitter to display tooltip info") .getBoolean(true); + NanosaberChat = config + .get(CATEGORY_FEATURES, "Nanosaber Chat messages", true, "Allow Nanosaber chat messages") + .getBoolean(true); + enableGemArmorAndTools = config.get(CATEGORY_FEATURES, "Gem tools and armor", true, "Should the gem tools and armor be added to the game").getBoolean(true); // Crafting diff --git a/src/main/java/techreborn/items/tools/ItemNanosaber.java b/src/main/java/techreborn/items/tools/ItemNanosaber.java index ef77ab79c..f489a07e2 100644 --- a/src/main/java/techreborn/items/tools/ItemNanosaber.java +++ b/src/main/java/techreborn/items/tools/ItemNanosaber.java @@ -1,187 +1,206 @@ package techreborn.items.tools; -import java.util.List; - +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; import me.modmuss50.jsonDestroyer.api.IHandHeld; -import me.modmuss50.jsonDestroyer.api.ITexturedItem; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.translation.I18n; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import reborncore.RebornCore; import reborncore.api.power.IEnergyItemInfo; import reborncore.common.powerSystem.PoweredItem; -import reborncore.common.util.ItemNBTHelper; +import reborncore.common.util.ChatUtils; import techreborn.client.TechRebornCreativeTab; -import techreborn.lib.ModInfo; +import techreborn.config.ConfigTechReborn; +import techreborn.init.ModItems; +import techreborn.lib.MessageIDs; -import net.minecraft.item.Item.ToolMaterial; -public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITexturedItem, IHandHeld +import javax.annotation.Nullable; +import java.util.List; + +public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IHandHeld { - - public static int tier = 1; - public int maxCharge = 1; public int cost = 250; - public float unpoweredSpeed = 2.0F; - public double transferLimit = 100; public ItemNanosaber() { super(ToolMaterial.DIAMOND); setCreativeTab(TechRebornCreativeTab.instance); setMaxStackSize(1); - setMaxDamage(240); + setMaxDamage(1); setUnlocalizedName("techreborn.nanosaber"); - RebornCore.jsonDestroyer.registerObject(this); - this.maxCharge = 1000; - this.tier = 2; - } - - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) - { - PoweredItem.useEnergy(cost, itemstack); - return true; - } - - @Override - public ActionResult onItemRightClick(ItemStack stack, World worldIn, EntityPlayer player, EnumHand hand) - { - if (player.isSneaking()) + this.addPropertyOverride(new ResourceLocation("techreborn:active"), new IItemPropertyGetter() { - changeMode(stack); + @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, + @Nullable EntityLivingBase entityIn) + { + if (stack != null && stack.getTagCompound().getBoolean("isActive")) + { + return 1.0F; + } + return 0.0F; + } + }); + } + + @Override public Multimap getAttributeModifiers(EntityEquipmentSlot slot, + ItemStack stack) + { + Multimap multimap = HashMultimap.create(); + int modifier = 0; + if (stack.getTagCompound().getBoolean("isActive")) + modifier = 9; + + if (slot == EntityEquipmentSlot.MAINHAND) + { + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), + new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double) modifier, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), + new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4000000953674316D, 0)); } - return new ActionResult<>(EnumActionResult.FAIL, stack); + return multimap; } - public void changeMode(ItemStack stack) + @Override public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, + EntityLivingBase entityliving1) { - if (!ItemNBTHelper.verifyExistance(stack, "isActive")) + if (PoweredItem.canUseEnergy(cost, itemstack)) { - ItemNBTHelper.setBoolean(stack, "isActive", true); - } else if (ItemNBTHelper.verifyExistance(stack, "isActive")) + PoweredItem.useEnergy(cost, itemstack); + return true; + } else { - stack.getTagCompound().removeTag("isActive"); + return false; } } - public boolean isItemActive(ItemStack stack) - { - return !ItemNBTHelper.verifyExistance(stack, "isActive"); - } - -// @SideOnly(Side.CLIENT) -// @Override -// public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) -// { -// if (ItemNBTHelper.verifyExistance(stack, "isActive")) -// { -// list.add("Active"); -// } else if (!ItemNBTHelper.verifyExistance(stack, "isActive")) -// { -// list.add("Not Active"); -// } -// super.addInformation(stack, player, list, par4); -// } - - @Override - public boolean isRepairable() + @Override public boolean isRepairable() { return false; } - @Override - public double getMaxPower(ItemStack stack) + @Override public double getMaxPower(ItemStack stack) { - return maxCharge; + return 100000; } - @Override - public boolean canAcceptEnergy(ItemStack stack) + @Override public boolean canAcceptEnergy(ItemStack stack) { return true; } - @Override - public boolean canProvideEnergy(ItemStack stack) + @Override public boolean canProvideEnergy(ItemStack stack) { return false; } - @Override - public double getMaxTransfer(ItemStack stack) + @Override public double getMaxTransfer(ItemStack stack) { - return transferLimit; + return 512; } - @Override - public int getStackTier(ItemStack stack) + @Override public int getStackTier(ItemStack stack) { - return tier; + return 2; } - @SuppressWarnings({ "rawtypes", "unchecked" }) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) public void getSubItems(Item item, + CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - itemList.add(itemStack); + ItemStack inactiveUncharged = new ItemStack(ModItems.nanosaber); + inactiveUncharged.setTagCompound(new NBTTagCompound()); + inactiveUncharged.getTagCompound().setBoolean("isActive", false); + PoweredItem.setEnergy(0, inactiveUncharged); - ItemStack charged = new ItemStack(this, 1); - PoweredItem.setEnergy(getMaxPower(charged), charged); - itemList.add(charged); + ItemStack inactiveCharged = new ItemStack(ModItems.nanosaber); + inactiveCharged.setTagCompound(new NBTTagCompound()); + inactiveCharged.getTagCompound().setBoolean("isActive", false); + PoweredItem.setEnergy(getMaxPower(inactiveCharged), inactiveCharged); + + ItemStack activeUncharged = new ItemStack(ModItems.nanosaber); + activeUncharged.setTagCompound(new NBTTagCompound()); + activeUncharged.getTagCompound().setBoolean("isActive", true); + PoweredItem.setEnergy(0, activeUncharged); + + ItemStack activeCharged = new ItemStack(ModItems.nanosaber); + activeCharged.setTagCompound(new NBTTagCompound()); + activeCharged.getTagCompound().setBoolean("isActive", true); + PoweredItem.setEnergy(getMaxPower(activeCharged), activeCharged); + + itemList.add(inactiveUncharged); + itemList.add(inactiveCharged); + itemList.add(activeUncharged); + itemList.add(activeCharged); } - @Override - public double getDurabilityForDisplay(ItemStack stack) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("isActive")) + { + list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.nanosaberInactive")); + } else + { + list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.nanosaberActive")); + } + } + + @Override public double getDurabilityForDisplay(ItemStack stack) { double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); return 1 - charge; } - @Override - public boolean showDurabilityBar(ItemStack stack) + @Override public boolean showDurabilityBar(ItemStack stack) { return true; } - @Override - public String getTextureName(int damage) + @Override public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, + EnumHand hand) { - if (damage == 1) + if (player.isSneaking()) { - return "techreborn:items/tool/nanosaber_on"; + if (stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("isActive")) + { + stack.setTagCompound(new NBTTagCompound()); + stack.getTagCompound().setBoolean("isActive", true); + if (!world.isRemote && ConfigTechReborn.NanosaberChat) + { + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " " + + TextFormatting.GOLD + I18n + .translateToLocal("techreborn.message.nanosaberActive"))); + } + } else + { + stack.getTagCompound().setBoolean("isActive", false); + if (!world.isRemote && ConfigTechReborn.NanosaberChat) + { + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " " + + TextFormatting.GOLD + I18n + .translateToLocal("techreborn.message.nanosaberInactive"))); + } + } } - return "techreborn:items/tool/nanosaber_off"; - } - - @Override - public int getMaxMeta() - { - return 2; - } - - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) - { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) - { - tooltip.add(TextFormatting.RED + "WIP Coming Soon"); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); } } diff --git a/src/main/java/techreborn/lib/MessageIDs.java b/src/main/java/techreborn/lib/MessageIDs.java index 5cce05555..79cb3feff 100644 --- a/src/main/java/techreborn/lib/MessageIDs.java +++ b/src/main/java/techreborn/lib/MessageIDs.java @@ -8,4 +8,5 @@ public class MessageIDs public static int freqTransmitterID = 0; public static int fluidPipeID = 1; public static int playerDetectorID = 2; + public static int nanosaberID = 3; } diff --git a/src/main/resources/assets/techreborn/lang/en_US.lang b/src/main/resources/assets/techreborn/lang/en_US.lang index 1721947ca..2950c2062 100644 --- a/src/main/resources/assets/techreborn/lang/en_US.lang +++ b/src/main/resources/assets/techreborn/lang/en_US.lang @@ -946,6 +946,8 @@ techreborn.message.detects=Detects techreborn.message.allPlayers=All Players techreborn.message.onlyOtherPlayers=Only Other Players techreborn.message.onlyYou=Only You +techreborn.message.nanosaberActive=Active +techreborn.message.nanosaberInactive=Inactive #Cables Cable.copperCable.name=Copper Cable diff --git a/src/main/resources/assets/techreborn/models/item/nanosaber.json b/src/main/resources/assets/techreborn/models/item/nanosaber.json new file mode 100644 index 000000000..eb15f20ef --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/nanosaber.json @@ -0,0 +1,14 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/nanosaber_off" + }, + "overrides": [ + { + "predicate": { + "techreborn:active": 1 + }, + "model": "techreborn:item/nanosaberActive" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/item/nanosaberActive.json b/src/main/resources/assets/techreborn/models/item/nanosaberActive.json new file mode 100644 index 000000000..d2edeb968 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/nanosaberActive.json @@ -0,0 +1,6 @@ +{ + "parent": "techreborn:item/techrebornItem", + "textures": { + "layer0": "techreborn:items/tool/nanosaber_on" + } +} \ No newline at end of file From 5bf5c4fff3dbcf79e5963db1634d76ca534ba12b Mon Sep 17 00:00:00 2001 From: Yulife Date: Sun, 5 Jun 2016 14:12:02 +0200 Subject: [PATCH 3/5] Energy Armor Textures --- .../techreborn/textures/models/lapotronpack.png | Bin 0 -> 652 bytes .../techreborn/textures/models/lithiumbatpack.png | Bin 0 -> 488 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 run/resourcepacks/unity/assets/techreborn/textures/models/lapotronpack.png create mode 100644 run/resourcepacks/unity/assets/techreborn/textures/models/lithiumbatpack.png diff --git a/run/resourcepacks/unity/assets/techreborn/textures/models/lapotronpack.png b/run/resourcepacks/unity/assets/techreborn/textures/models/lapotronpack.png new file mode 100644 index 0000000000000000000000000000000000000000..fe66596295a16b18eca66af421d5acd60a6e48d0 GIT binary patch literal 652 zcmV;70(1R|P)>Hwmvo$+m;+P+!$-Y{J{$)C zcsw3hmIWe0bTxSaGstI79V?5EZjjuX7BGVxizm3_c7osJY<`|8@_~Udj>Qvvyz2u0 zZv05>DeFF?>OG+S=>eCP7FQlr0UwubJj>WfE#v?I-wWT$;@3{kdhvh7UqJU6y!ICAF&t{vKm zS2Hu1o(MT=`UF(!`mJH!v8@4h+nX`_Itc*SyKg@hKh0xqK8u%+BLDV1Ad~%ow5P)D2vxzn}U3 zZZ6^QtyT-QS`F*<8vFeozV9OpLs*tYlgUKnG67P`)LV5NM|qG^sq}lTX`^xpRu7J!IZ#J8$ z3UFOl`K)L2g?3Shu{#o{;@q`>l#;a1GVaRvDC@UaZae@WRT3T_p0M0_7`vmBaqbe} zIF67~(nqoczRp*`+xshaQK*b_I|F|DAAoWOG#U+Tw_C(`Xux*=6(*ywYdOcLDRTzeWAP6v>PV?CU=Su#sIF2!&&r|W?aKLJ{x}M+BcDqfM eWsxdo89D+xlg4G^&!@`(0000 Date: Sun, 5 Jun 2016 10:41:00 -0700 Subject: [PATCH 4/5] Nanosaber still don't work --- .../techreborn/items/tools/ItemNanosaber.java | 78 +++++++++---------- .../items/tool/nanosaber_on.png.mcmeta | 2 +- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/main/java/techreborn/items/tools/ItemNanosaber.java b/src/main/java/techreborn/items/tools/ItemNanosaber.java index f489a07e2..862ff6054 100644 --- a/src/main/java/techreborn/items/tools/ItemNanosaber.java +++ b/src/main/java/techreborn/items/tools/ItemNanosaber.java @@ -2,7 +2,6 @@ package techreborn.items.tools; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -import me.modmuss50.jsonDestroyer.api.IHandHeld; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -35,13 +34,14 @@ import techreborn.lib.MessageIDs; import javax.annotation.Nullable; import java.util.List; -public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IHandHeld +public class ItemNanosaber extends ItemSword implements IEnergyItemInfo { public int cost = 250; public ItemNanosaber() { super(ToolMaterial.DIAMOND); + setNoRepair(); setCreativeTab(TechRebornCreativeTab.instance); setMaxStackSize(1); setMaxDamage(1); @@ -91,36 +91,6 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IHandHe } } - @Override public boolean isRepairable() - { - return false; - } - - @Override public double getMaxPower(ItemStack stack) - { - return 100000; - } - - @Override public boolean canAcceptEnergy(ItemStack stack) - { - return true; - } - - @Override public boolean canProvideEnergy(ItemStack stack) - { - return false; - } - - @Override public double getMaxTransfer(ItemStack stack) - { - return 512; - } - - @Override public int getStackTier(ItemStack stack) - { - return 2; - } - @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { @@ -161,13 +131,6 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IHandHe } } - @Override public double getDurabilityForDisplay(ItemStack stack) - { - double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); - return 1 - charge; - - } - @Override public boolean showDurabilityBar(ItemStack stack) { return true; @@ -203,4 +166,41 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IHandHe } return new ActionResult<>(EnumActionResult.SUCCESS, stack); } + + @Override public double getDurabilityForDisplay(ItemStack stack) + { + double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); + return 1 - charge; + + } + + @Override public boolean isRepairable() + { + return false; + } + + @Override public double getMaxPower(ItemStack stack) + { + return 100000; + } + + @Override public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } + + @Override public boolean canProvideEnergy(ItemStack stack) + { + return false; + } + + @Override public double getMaxTransfer(ItemStack stack) + { + return 512; + } + + @Override public int getStackTier(ItemStack stack) + { + return 2; + } } diff --git a/src/main/resources/assets/techreborn/textures/items/tool/nanosaber_on.png.mcmeta b/src/main/resources/assets/techreborn/textures/items/tool/nanosaber_on.png.mcmeta index 97596ba81..dfae8cae1 100644 --- a/src/main/resources/assets/techreborn/textures/items/tool/nanosaber_on.png.mcmeta +++ b/src/main/resources/assets/techreborn/textures/items/tool/nanosaber_on.png.mcmeta @@ -1,5 +1,5 @@ { "animation":{ - "frametime":2 + "frametime":1 } } \ No newline at end of file From 223732e4ef796a3cf89a377b93d5537e2cbe1420 Mon Sep 17 00:00:00 2001 From: onVoid Date: Sun, 5 Jun 2016 10:50:30 -0700 Subject: [PATCH 5/5] Textures for andesiteDust, graniteDust, and dioriteDust --- .../textures/items/dust/andesiteDust.png | Bin 0 -> 392 bytes .../textures/items/dust/dioriteDust.png | Bin 0 -> 394 bytes .../textures/items/dust/graniteDust.png | Bin 0 -> 445 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/resources/assets/techreborn/textures/items/dust/andesiteDust.png create mode 100644 src/main/resources/assets/techreborn/textures/items/dust/dioriteDust.png create mode 100644 src/main/resources/assets/techreborn/textures/items/dust/graniteDust.png diff --git a/src/main/resources/assets/techreborn/textures/items/dust/andesiteDust.png b/src/main/resources/assets/techreborn/textures/items/dust/andesiteDust.png new file mode 100644 index 0000000000000000000000000000000000000000..d125c7925c1ba92c9ca855d46f4871834517d7b0 GIT binary patch literal 392 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggq9%*h>E|vFw*MLG2C9V-A!TD(=<%vb93~dIoxyImUHTq<<-ip zx9R%M%ARWPczc3ML!SEMlG%nl%5y%iST)Q2)vl*LD@&%_Z}{%7SETnm+Ih#3zOEY+ z6O%7*IbkHr+#};~fl)N@v{&T2rhS@Ip4I!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggq9wAO~wbs*b7XXDMN?apKg7ec#$`gxH8440J^Gfvc zQcDy}^bGVYbByc!fNH*ax;Tbd_%EFh-F3)8!1eC-9lVKU3UwZFZtCyztT_W6MOttA z`sR5a=@T{lQTXD^TC44f!b-om3}u=n`W$(zpM92R`uj)HkVQcD_~N5UKexH?D8}f8 zdrj(jdi9i~P9^7t8PB^?1z4mn?Rw(0^2n|PMbA&|HFohQOPjX^*q^KGRMk#B@%_54 zqP|q{$J3Ev0W#@NDj9v38?Qd1Ww7i?V(j~$);#r^zVD3=yea!Ft!E+Uzc%9Y>L_Ww z!r1w(%Pc>vStYfTAz{Ikw94JRD>ceOrkU2?@6?fuU}fM|=nDE*Xt6u|x6uZ@^CgES j+)!*w7C3x<;YoY10_L4sPeP1=0l?tt>gTe~DWM4fu3D2+ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/techreborn/textures/items/dust/graniteDust.png b/src/main/resources/assets/techreborn/textures/items/dust/graniteDust.png new file mode 100644 index 0000000000000000000000000000000000000000..ef00f87d759317dc32170a7d1a9399aec10d5d26 GIT binary patch literal 445 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=G^tAk28_ZrvZCAbW|YuPggq9zh-r8UFNQZJ>}uiEBhjaDG}zd16s2LqTF@UWr~_ zYKel0o`Ifaj&YqI0|TRmr;B5Vh5yotj{b)n1X_RgO7Sma%gJsHx)s6_y~xmz#o3@M zglkIDfzrFlDE8>E`%Ut>7i)TEJn(bV8 kX2xQX)eA)a^JU$C@bT~~YsLl6z;I>oboFyt=akR{0D_OO0ssI2 literal 0 HcmV?d00001