From 37f912cb6de013c30411adeef9704b99dda9edc7 Mon Sep 17 00:00:00 2001 From: Sen Date: Thu, 31 Jul 2025 16:13:40 +0200 Subject: [PATCH] change tools --- client/src/main/java/client/Client.java | 12 +- .../resources/textures/items/diamond_hoe.png | Bin 5226 -> 0 bytes .../resources/textures/items/gold_hoe.png | Bin 4826 -> 0 bytes .../resources/textures/items/gyriyn_hoe.png | Bin 4798 -> 0 bytes .../textures/items/{stone_hoe.png => hoe.png} | Bin .../resources/textures/items/iron_hoe.png | Bin 4699 -> 0 bytes .../resources/textures/items/nichun_hoe.png | Bin 4663 -> 0 bytes .../resources/textures/items/thetium_hoe.png | Bin 4785 -> 0 bytes .../resources/textures/items/wood_hoe.png | Bin 4872 -> 0 bytes common/src/main/java/common/block/Block.java | 58 ++----- .../src/main/java/common/block/Material.java | 35 ++-- .../java/common/enchantment/Enchantment.java | 11 -- .../java/common/entity/npc/EntityNPC.java | 9 +- .../main/java/common/init/BlockRegistry.java | 77 +++++---- .../java/common/init/CraftingRegistry.java | 8 +- .../main/java/common/init/ItemRegistry.java | 2 +- common/src/main/java/common/init/Items.java | 9 +- .../main/java/common/item/tool/ItemAxe.java | 13 +- .../main/java/common/item/tool/ItemHoe.java | 37 +---- .../java/common/item/tool/ItemPickaxe.java | 25 +-- .../java/common/item/tool/ItemShears.java | 63 +------ .../java/common/item/tool/ItemShovel.java | 13 +- .../main/java/common/item/tool/ItemTool.java | 42 ++++- .../java/common/item/weapon/ItemSword.java | 155 +----------------- .../common/tileentity/TileEntityFurnace.java | 7 +- .../main/java/common/util/HarvestTool.java | 53 ++++++ 26 files changed, 194 insertions(+), 435 deletions(-) delete mode 100755 client/src/main/resources/textures/items/diamond_hoe.png delete mode 100755 client/src/main/resources/textures/items/gold_hoe.png delete mode 100755 client/src/main/resources/textures/items/gyriyn_hoe.png rename client/src/main/resources/textures/items/{stone_hoe.png => hoe.png} (100%) delete mode 100755 client/src/main/resources/textures/items/iron_hoe.png delete mode 100755 client/src/main/resources/textures/items/nichun_hoe.png delete mode 100755 client/src/main/resources/textures/items/thetium_hoe.png delete mode 100755 client/src/main/resources/textures/items/wood_hoe.png create mode 100644 common/src/main/java/common/util/HarvestTool.java diff --git a/client/src/main/java/client/Client.java b/client/src/main/java/client/Client.java index f05e9ae4..9f951d81 100755 --- a/client/src/main/java/client/Client.java +++ b/client/src/main/java/client/Client.java @@ -1176,16 +1176,8 @@ public class Client implements IThreadListener { Block block = state.getBlock(); if(block != Blocks.air) { desc = block.getDisplay(); - if(block.getMiningLevel() >= 0) - line2 = "Werkzeug: Spitzhacke Level " + (block.getMiningLevel() + 1); - else if(block.canAxeHarvest()) - line2 = "Werkzeug: Axt"; - else if(block.canShovelHarvest()) - line2 = "Werkzeug: Schaufel"; - else if(block.canShearsHarvest()) - line2 = "Werkzeug: Schere"; - else if(block.canSwordHarvest()) - line2 = "Werkzeug: Schwert"; + if(block.getMiningTool() != null) + line2 = "Werkzeug: " + block.getMiningTool().getDisplay() + (block.getMiningTool().isLevelled() ? "Level " + (block.getMiningLevel() + 1) : ""); } } else if(this.pointed != null && this.pointed.type == ObjectType.ENTITY && this.pointed.entity != null) { diff --git a/client/src/main/resources/textures/items/diamond_hoe.png b/client/src/main/resources/textures/items/diamond_hoe.png deleted file mode 100755 index d7ef1aee533333532d94a6236ba3dd00393f0684..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5226 zcmeHKc~lcu7mqChf>;zQ7D3a1ipXT0EHh0iNLV5yP@onUsxy-bjASzzAVg8IvPe-7 z0dXm)RMb{Mtyoc7+fq>qqNvr@YAcExpBqw+vS}v)5l?&0cRb(M|I9g)ym{|;fA8Mk zz3-m9)e(wdCkHnN8ja>83z0@rzs{D&-j@2F)bR|V(QIPO(J^Esl1$edbSgrP)5#P) zPRC7zibgYCs@jlHblrPo`m?XH=e&_`%DVAT9GApyD0Qq;94~}pci%r0K5`wtxY^Et zb}xT6s^hIuhw9yKm1T@wdAub*bW8IGOWadp>yIQ}S#bB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syT6)fRkTC3=6i>Ub$t}^Y zvU&WLj#-m-2pr$rEcj709BT~8x1nt<_+koe1^KAtbj`@#ue*ok?prOd80#_3qO>ef KA+4CXaOGe6X}iGy diff --git a/client/src/main/resources/textures/items/gold_hoe.png b/client/src/main/resources/textures/items/gold_hoe.png deleted file mode 100755 index 5dba370c32483a0fb5bd8ae02692477eefa5040a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4826 zcmeHLX;c$g7LKR^S=13l+^ZulfJrJFSp*p%2#kg$WCRtJqN)-CWa%W304|LnN)I|L zwxS}qAx#g^D4YPfd-u>?P?)~0< z_v9tT-`C5^e6l%-M6&Yn7K*|5SmHJ#gU=aVJqU?3VrrZuSSLpGkXoaX%A;^d7pul0 z+#r{dNQPhPgCaA!=32hLZ2!{C+a21H7%O>d_40M2?YSM!)dd)HdHF$;;Lw5q3%8J- zhn@F6oIG{6VWh}Ln>yXE_6x1sx%Y8(D>KK$uc>;y=;6YSOT&`Af2xZsH(ac#J>L|* zZ+*_%0PKZrgVI#Pd)~O4vU2lcVQJH7&o};dRpdwh{x=SO zhX&-|l$v%qWn~?#cU$#*l}BWp4X(TWf_Ub801Z!mg_v>ssHk(0%(> z#HWepk3a4S7m++n$j2wAi0yK-tp7Gu4t+}!ENZs0OmpCV)dGz>VHGoO@qYtH?1%jm0RQo9t(YiR4qpwyGr82@8pv2 zDtcymuK8E|_ldJs#T3+(nS{wyj!T{fWIEQE6sS7P-G01|Ya!%Sh-1;sZD-nBt&^HF zUfPh~Os^9+tCuvbCIS z`+DE@+wYX!_pfieaiR9sy+`xwZys^iZ>3FGKJV%9GtVrJ-`-etRI^77b)TH$yv$h{ zZ1FZN#B_#RL#b7TraLL(mHn%6+cnu`ig`hX5R-}bH+y78j#zEl5_M{uG262!Ziscc096WN?hkQuQ|NVb*35d?He>N+*hZYzN*mM zm>l&eaZDP&&c?i>G&Drm>^oyx@fkOt;Was@a*lNDmLxc~(A=4M6HNbG*15J-_kQJ- z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Cooyyx$wO;FodZz5|t`WNHK;)Hd>A@i}B+m zgD^-0VK7cg2U&bNhYxZkpevun1fC~oDIl!+4qm3j?Gxm%R84GB?(nMeajA=5s-S8aVyzpK~8*PRoni<>9@Aw(n zi{H@$PCen|lk}aCYeKG1Qs9%o6V){#*C#3PN#Kd<`oGC#_3=6dEAf9pI{dO!xQ+ZH ze$gUEFZC0du3Usc@5*F+G*#`tN=qP69gWW<{ZWque9{sN5c^m@wse@~w%{Ae-M`^e z837_M3AbJvRY0P5<*?*~pULyzUiaVsukOW$*}*Ri@`&r^*J{$TdQxQxMB;p3Vp{LK z>5Jv_LzCZUc2TsshUsM$2G@qJ_r?D>(x1O=a%F74nVp^8-@}m&_g~If+o%EekPa+r z4$3IYnJKGn3tFC1w6Hd-c-8XY{hJy~n{6M&=926`U*_6CC}oA25l)5*Eq_krUNGho M;1eu5y(B92zug@c$p8QV diff --git a/client/src/main/resources/textures/items/stone_hoe.png b/client/src/main/resources/textures/items/hoe.png similarity index 100% rename from client/src/main/resources/textures/items/stone_hoe.png rename to client/src/main/resources/textures/items/hoe.png diff --git a/client/src/main/resources/textures/items/iron_hoe.png b/client/src/main/resources/textures/items/iron_hoe.png deleted file mode 100755 index 39585a822953f964cce9a1f218545c458898b755..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4699 zcmeHLc~BEs8V?8v5d_5n#H)?qh}cQzB6OArm~c50h`=BWrPAr{Kr1;&8VKOQp&}zV zsH}sEuE$`ZuI%820?MKTUL3oQIEaeJtj?%4f{PTo9_&j%#G0wvvTEl)QkCTO_kQ2+ zec$hW@2k8ND8fS=nC?slgW(VsDvJc)PNui54fveVJAg45V>&XUW9djN9n$HwDk_G|a7h_v`XWPGN^UAdHnCWz(AwiXyH@)5w&k}|6-W-gQR)=eb|B`<%tU%94v zYkif>ddq4)k-98atWH`Fb$%HP0u7ogSoS72#>+XcGCarqlgGz3csX-J z&f*JpmIm_1Z282*%DbC93WIlTB`9S=Re0yRheqY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h8%hJ?u#!yYCH5-GLL>;=UB07+A-_hNkz zn`y?J&d5N3`!MeZ=y$oB!2l(fi)C6o)f8TsOu{m)FDA4&MTpHq5$?mq1w0YV_u+A2 z0YPH0FNtBW4LFr+~oh0df&b z^(01X_0d{wvV>&{05W+FPs_n^A}|`0VKfOy5uQ+th{QZJ8bQQd9vFBdJTWo?uO%o| z#{WW_4iDrvxaFag0j!^4HVvMrC^BX6Y49&WjG{iExOgb4;`2p>038%>nBAaN(dn3; z3`_(%0F80%Mljd9ortC0TV6^X*^5O=&^8xl&WQWUwso;N%OONUckKEsV2=CQj z^oDMqwNlzpEwhikj<2b$%qXn-w)rVL>?_-#wW~?5g4&J$T5K7>C~?_5DeTOv&90@} zEflg1#M^0%Qv*M>*BgDt?!F$!h*tOl?xJb{|oG?*jE4m diff --git a/client/src/main/resources/textures/items/nichun_hoe.png b/client/src/main/resources/textures/items/nichun_hoe.png deleted file mode 100755 index 5cf61f28fe7e6f45f8f115e543fd1268b0709e39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4663 zcmeHLc~BE+7SEK*Rp5Z)G0I?UM5VNo?sP(u9ug435hTE1#A8IZ)7^oVTqJE0Ks?x8 zhVg<@D>b^fuF9yO3+utS9_Xl`tIRAi!+0Q~GhDjkwJVC~p!+2tV$D=-S+(;Ysp@q1 z``-J#_kQ1dukz)yveP7j0)+fS>9Vc&@m~U%8h-}$7>!GcgJze$beSgFGn#vatt2*E@@DCz^TVJae|} z{i)y+v3B3{Gt>|0abZkpnL7?dl`{9T8dg0p{h~HDkWvJr#F8}7#qXnrUej~1OzlhoD z_N1mt?YGNp3*aIP9QjE6?b>lIactBp@;N zj*iZy`NaBT@4z)SD zSN+%2d>_#jwWV#kPgm??_{g=C`t5jpdDhVfd3O%({j+<#zGyP8d*&Atz_hPxKKs0~ zCSt>QQL9o_XZrYDrpI2-Z5KXMX*uT;J!{V?Ru^<$)U7MKw7G@)GWdKY5>pboRkW=( zBKf0(KKOO1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QwyCKj9qFJrc)?>; z;D`XhF#rnDSv&~l(Yay>;z3}|^o8g=Xpp{IDwn1GFKyG|AqMo7JXEd&{?p8&z7rLV zE$(~kdsWEIM~O%@9||6V_NAahQZT7GPJq?7g(e`XcnnOB{&syYm;XsCu(?v0!(`LQ z5*dt=nOqi&ERnKcGLs1-Tqc6hX-FS=1L!)n3{OS0SYSNh5pV_C)65mo+gzwAAIFlK zfSIZQ2qQx<`HzHA`xB;`X2$!B1E_!CB*3gNXvhG&J{cHZU=~sbhG9QvAl|?7(_f3f z(gl$?lCH}|AJD%WvMpx3Ir}% z!zAG$0`rxN@G_`sDOlNSLSuCV0>#txSm<|6O94V#JWLd9`@q(HjEyyX+CK=0^1=jx zV$S7V1xBZ{kfZgjQzHt5xmG`Bd3wc_MenkyPOSXznD6N4O0@+(gx%$K&Z$I?adpqt z<0F$B)YYG_;TAnS8fvq^WojaQM+jwO@5f}>=!h0(&RjII<5LV-ANuJB+@P}JfR zhW2rtJb!TMoaocJs@UV?#q%T7mpgOrCv~4LJ>|5r-Kq=`xF1arZ8PN&791hiKmE(B F-vL9S26+Gg diff --git a/client/src/main/resources/textures/items/wood_hoe.png b/client/src/main/resources/textures/items/wood_hoe.png deleted file mode 100755 index a1855b0512a861eb31dcde86b93defeb24e2236c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4872 zcmeHKcTiJV7k}y!6hU1T1#32_sFCB$xRDZ zPH=J<6E%Pj?FV9^TvvL(q4E#L#e31)He`qaG(T7?n&gU{uUP;1FcF zTQW_X`(%{khihX`emA1evij$un?uPr5|_<`-4mX9p7x(lMN$lKXTy_)SA zc~=H8r$`+NYF}P)FAXj~;4yr1?ng`0z`0}BFE9;`Bt?P8X7M%e4sUx}*bj>~HU>T! zHo9U_-La(kh6|I9Z@gY!8NW8q?NZFbyyVk+FzF48Z_17Jn#LgV9`18`*3AWptA0G# zqgL3^bUDI%OS4B8fu7Bfrde_)u{P7aVoxUKaiNzEdn@g{xOn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1oggSSNt0JInhQ!QGJ&Lp--Xf|9iSX;$R8r5b(#z<)4ieRc# zZ^WoP29Lp_`&)>34$a4b>TN`Eu}T)u4guaIv}lqvh?z{Y*~~C=8G2(BlPwa7m@E#H z!=VEUx+y_N!WO#DJX$9-qfy ztNGjxP;#A#gmnmJg#zFV0^lGV5rVO~0ydpHcV$DFn|*BaJmpj*mPXrDfATK7{s`JxCVv{(oUTiIj__*?;x%V&u^ z`JN)S=NF@Cn9&3}(Td4tF}OUN##$CJNCprKTl*9M*yJD=vDApcq}~{+*J~s+Ye-b9 z=V!G7948beVHr$f0F=eyi&+9OM-<9piTOgX@L+MotPb{il)w}Im$miqP`%qq9!QwL z{s}fw+ldOnV%y%@UNwa6C{d}lLm`HdwiHZoJcioh1XyhalO89{uo3f%0z3k)KzrJ_qK>u| zYD{Nqb2MhH0w9bIy6o?SG20VnT4%}P$tKpC4|fY6?lEBx&r*$){Y9@>*U zaR!J=~e=6P}FCo*=ITTr!%d6bx=PxWpn?>M diff --git a/common/src/main/java/common/block/Block.java b/common/src/main/java/common/block/Block.java index 6d16815c..d5e37f67 100755 --- a/common/src/main/java/common/block/Block.java +++ b/common/src/main/java/common/block/Block.java @@ -46,6 +46,7 @@ import common.util.BlockPos; import common.util.BoundingBox; import common.util.Clientside; import common.util.Facing; +import common.util.HarvestTool; import common.util.HitPosition; import common.util.Vec3; import common.util.HitPosition.ObjectType; @@ -174,10 +175,6 @@ public class Block { private boolean fullBlock; private boolean sumBrightness; - private boolean axeHarvest; - private boolean shovelHarvest; - private boolean shearsHarvest; - private boolean swordHarvest; private boolean ticked; private int opacity; private int light; @@ -198,6 +195,7 @@ public class Block { private String display; private CheatTab tab; private SoundType sound; + private HarvestTool miningTool; private Item item; private static Iterable> cartesianProduct(Iterable> sets) { @@ -362,11 +360,8 @@ public class Block { } public Block(Material material) { - this.miningLevel = (material == Material.SOLID || material == Material.HEAVY) ? 0 : -1; - this.axeHarvest = material == Material.WOOD || material == Material.PLANT || material == Material.BUSH || material == Material.SOFT; - this.shovelHarvest = material == Material.POWDER || material == Material.DIGGABLE; - this.shearsHarvest = material == Material.LEAVES; - this.swordHarvest = material == Material.FLUFF; + this.miningTool = material.getTool(); + this.miningLevel = material.getTool() != null && material.getTool().isLevelled() ? 0 : -1; this.sound = SoundType.STONE; this.slipperiness = 0.6F; this.material = material; @@ -430,28 +425,19 @@ public class Block { return this; } - public final Block setMiningLevel(int level) { + public final Block setMiningTool(HarvestTool tool, int level) { + if(!tool.isLevelled()) + throw new IllegalArgumentException("Abbauwerkzeug " + tool.getDisplay() + " muss Levels besitzen"); + this.miningTool = tool; this.miningLevel = level; return this; } - public final Block setAxeHarvestable() { - this.axeHarvest = true; - return this; - } - - public final Block setShovelHarvestable() { - this.shovelHarvest = true; - return this; - } - - public final Block setShearsHarvestable() { - this.shearsHarvest = true; - return this; - } - - public final Block setSwordHarvestable() { - this.swordHarvest = true; + public final Block setMiningTool(HarvestTool tool) { + if(tool.isLevelled()) + throw new IllegalArgumentException("Abbauwerkzeug " + tool.getDisplay() + " darf keine Levels besitzen"); + this.miningTool = tool; + this.miningLevel = -1; return this; } @@ -592,21 +578,9 @@ public class Block { public final int getMiningLevel() { return this.miningLevel; } - - public final boolean canAxeHarvest() { - return this.axeHarvest; - } - - public final boolean canShovelHarvest() { - return this.shovelHarvest; - } - - public final boolean canShearsHarvest() { - return this.shearsHarvest; - } - - public final boolean canSwordHarvest() { - return this.swordHarvest; + + public final HarvestTool getMiningTool() { + return this.miningTool; } public final float getRadiation() { diff --git a/common/src/main/java/common/block/Material.java b/common/src/main/java/common/block/Material.java index 167bcb3a..28ab24c6 100755 --- a/common/src/main/java/common/block/Material.java +++ b/common/src/main/java/common/block/Material.java @@ -1,5 +1,7 @@ package common.block; +import common.util.HarvestTool; + public enum Material { NONE {{ this.setNonSolid().setReplaceable(); @@ -8,13 +10,13 @@ public enum Material { ; }}, WOOD {{ - this.setBurning(); + this.setBurning().setTool(HarvestTool.AXE); }}, SOLID {{ - this.setRequiresTool(); + this.setRequiredTool(HarvestTool.PICKAXE); }}, DIGGABLE {{ // can harvest with shovel - this.setRequiresTool(); + this.setRequiredTool(HarvestTool.SHOVEL); }}, TRANSLUCENT {{ this.setTranslucent(); @@ -23,16 +25,16 @@ public enum Material { this.setBurning(); }}, SOFT {{ // can break faster with sword, can't connect to fences+walls - this.setNoPushMobility(); + this.setNoPushMobility().setTool(HarvestTool.AXE); }}, PISTON {{ this.setImmovableMobility(); }}, HEAVY {{ - this.setRequiresTool().setImmovableMobility(); + this.setRequiredTool(HarvestTool.PICKAXE).setImmovableMobility(); }}, PLANT {{ // can break faster with sword - this.setNonSolid().setNoPushMobility(); + this.setNonSolid().setNoPushMobility().setTool(HarvestTool.AXE); }}, SMALL {{ // can be placed more easily this.setNonSolid().setNoPushMobility(); @@ -62,19 +64,19 @@ public enum Material { this.setLiquid(true).setReplaceable().setNoPushMobility(); }}, LEAVES {{ // can break faster with sword, precipitation block, special treatment in some worldgen - this.setBurning().setTranslucent().setNoPushMobility(); + this.setBurning().setTranslucent().setNoPushMobility().setTool(HarvestTool.SHEARS); }}, BUSH {{ // can break faster with sword, can be replaced by small tree leaves - this.setNonSolid().setBurning().setNoPushMobility().setReplaceable(); + this.setNonSolid().setBurning().setNoPushMobility().setReplaceable().setTool(HarvestTool.AXE); }}, FIRE {{ this.setNonSolid().setReplaceable().setNoPushMobility(); }}, POWDER {{ // can harvest with shovel, precipitation block - this.setNonSolid().setReplaceable().setRequiresTool().setNoPushMobility(); + this.setNonSolid().setReplaceable().setRequiredTool(HarvestTool.SHOVEL).setNoPushMobility(); }}, FLUFF {{ // can harvest with shears - this.setPassable().setRequiresTool().setNoPushMobility(); + this.setPassable().setRequiredTool(HarvestTool.SWORD).setNoPushMobility(); }}; private boolean solid = true; @@ -89,6 +91,7 @@ public enum Material { private boolean requiresTool; // 0 - normal; 1 - can't push other blocks; 2 - can't be pushed private int mobility; + private HarvestTool tool; protected Material setTranslucent() { this.opaque = false; @@ -121,8 +124,14 @@ public enum Material { return this; } - protected Material setRequiresTool() { + protected Material setRequiredTool(HarvestTool tool) { this.requiresTool = true; + this.tool = tool; + return this; + } + + protected Material setTool(HarvestTool tool) { + this.tool = tool; return this; } @@ -189,4 +198,8 @@ public enum Material { public int getMobility() { return this.mobility; } + + public HarvestTool getTool() { + return this.tool; + } } diff --git a/common/src/main/java/common/enchantment/Enchantment.java b/common/src/main/java/common/enchantment/Enchantment.java index 36df99fd..40d5b38a 100755 --- a/common/src/main/java/common/enchantment/Enchantment.java +++ b/common/src/main/java/common/enchantment/Enchantment.java @@ -8,7 +8,6 @@ import common.entity.types.EntityLiving; import common.item.ItemStack; import common.item.material.ItemArmor; import common.item.tool.ItemAxe; -import common.item.tool.ItemShears; import common.rng.Random; import common.util.Displayable; import common.util.ExtMath; @@ -313,11 +312,6 @@ public enum Enchantment implements Displayable, Identifyable { return 5; } - - public boolean canApply(ItemStack stack) - { - return stack.getItem() instanceof ItemShears ? true : super.canApply(stack); - } }, SILK_TOUCH("silk_touch", 1, EnchantmentType.DIGGER, "Behutsamkeit") { public int getMinEnchantability(int enchantmentLevel) @@ -339,11 +333,6 @@ public enum Enchantment implements Displayable, Identifyable { return super.canApplyTogether(ench) && ench != FORTUNE; } - - public boolean canApply(ItemStack stack) - { - return stack.getItem() instanceof ItemShears ? true : super.canApply(stack); - } }, UNBREAKING("unbreaking", 5, EnchantmentType.BREAKABLE, "Haltbarkeit") { public int getMinEnchantability(int enchantmentLevel) diff --git a/common/src/main/java/common/entity/npc/EntityNPC.java b/common/src/main/java/common/entity/npc/EntityNPC.java index 37f8ffd7..715b98ca 100755 --- a/common/src/main/java/common/entity/npc/EntityNPC.java +++ b/common/src/main/java/common/entity/npc/EntityNPC.java @@ -63,9 +63,7 @@ import common.item.ItemAction; import common.item.ItemStack; import common.item.consumable.ItemPotion; import common.item.material.ItemArmor; -import common.item.tool.ItemHoe; import common.item.tool.ItemKey; -import common.item.tool.ItemShears; import common.item.tool.ItemTool; import common.item.weapon.ItemBow; import common.item.weapon.ItemGunBase; @@ -630,8 +628,7 @@ public abstract class EntityNPC extends EntityLiving public boolean interact(EntityNPC player) { ItemStack stack = player.inventory.getCurrentItem(); - boolean flag = stack != null && !(stack.getItem() instanceof ItemTool || stack.getItem() instanceof ItemSword || - stack.getItem() instanceof ItemHoe || stack.getItem() instanceof ItemShears); + boolean flag = stack != null && !(stack.getItem() instanceof ItemTool); if (stack != null && !this.isPlayer() && this.isBreedingItem(stack) && this.getGrowingAge() == 0 && !this.isMating()) { @@ -1324,8 +1321,8 @@ public abstract class EntityNPC extends EntityLiving ItemSword itemsword = (ItemSword)stack.getItem(); ItemSword itemsword1 = (ItemSword)old.getItem(); - if(itemsword.getDamageVsEntity() != itemsword1.getDamageVsEntity()) { - flag = itemsword.getDamageVsEntity() > itemsword1.getDamageVsEntity(); + if(itemsword.getAttackDamageBonus() != itemsword1.getAttackDamageBonus()) { + flag = itemsword.getAttackDamageBonus() > itemsword1.getAttackDamageBonus(); } else { flag = stack.getItemDamage() > old.getItemDamage() || stack.isItemEnchanted() && !old.isItemEnchanted(); diff --git a/common/src/main/java/common/init/BlockRegistry.java b/common/src/main/java/common/init/BlockRegistry.java index ffc5c1b2..ebcaa33c 100755 --- a/common/src/main/java/common/init/BlockRegistry.java +++ b/common/src/main/java/common/init/BlockRegistry.java @@ -135,6 +135,7 @@ import common.model.TextureAnimation; import common.properties.Property; import common.util.PortalType; import common.util.Color; +import common.util.HarvestTool; import common.util.Util; import common.world.State; @@ -243,7 +244,7 @@ public abstract class BlockRegistry { Block stone = (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setSound(SoundType.STONE).setDisplay("Stein"); register("stone", stone); register("bedrock", (new BlockBedrock()).setHardness(1000.0F).setResistance(100000.0F).setSound(SoundType.STONE) - .setDisplay("Grundgestein").setTab(CheatTab.ROCK).setMiningLevel(6)); + .setDisplay("Grundgestein").setTab(CheatTab.ROCK).setMiningTool(HarvestTool.PICKAXE, 6)); register("rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Felsen").setTab(CheatTab.ROCK)); register("smooth_rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Glatter Felsen").setTab(CheatTab.ROCK)); register("hellrock", (new BlockHellRock()).setHardness(0.4F).setSound(SoundType.STONE).setDisplay("Höllenstein")); @@ -262,8 +263,8 @@ public abstract class BlockRegistry { register("smooth_sandstone", (new BlockSandStone("smooth")).setSound(SoundType.STONE).setHardness(0.8F).setDisplay("Glatter Sandstein")); register("carved_sandstone", (new BlockSandStone("carved")).setSound(SoundType.STONE).setHardness(0.8F).setDisplay("Gemeißelter Sandstein")); register("obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F).setSound(SoundType.STONE) - .setDisplay("Obsidian").setMiningLevel(3)); - register("clay", (new BlockClay()).setHardness(0.6F).setSound(SoundType.GRAVEL).setDisplay("Ton").setShovelHarvestable()); + .setDisplay("Obsidian").setMiningTool(HarvestTool.PICKAXE, 3)); + register("clay", (new BlockClay()).setHardness(0.6F).setSound(SoundType.GRAVEL).setDisplay("Ton").setMiningTool(HarvestTool.SHOVEL)); register("hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setSound(SoundType.STONE).setDisplay("Gebrannter Ton")); for(Color color : Color.values()) { register(color.getName() + "_clay", (new BlockColoredClay(color)).setHardness(1.25F).setResistance(7.0F) @@ -271,17 +272,16 @@ public abstract class BlockRegistry { } register("coal_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) .setSound(SoundType.STONE).setDisplay("Kohleblock").setTab(CheatTab.NATURE).setFlammable(5, 5)); - register("sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.SAND).setDisplay("Sand").setShovelHarvestable().setTab(CheatTab.NATURE)); - register("red_sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.SAND).setDisplay("Roter Sand").setShovelHarvestable().setTab(CheatTab.NATURE)); - register("gravel", (new BlockGravel()).setHardness(0.6F).setSound(SoundType.GRAVEL).setDisplay("Kies").setShovelHarvestable()); + register("sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.SAND).setDisplay("Sand").setMiningTool(HarvestTool.SHOVEL).setTab(CheatTab.NATURE)); + register("red_sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.SAND).setDisplay("Roter Sand").setMiningTool(HarvestTool.SHOVEL).setTab(CheatTab.NATURE)); + register("gravel", (new BlockGravel()).setHardness(0.6F).setSound(SoundType.GRAVEL).setDisplay("Kies").setMiningTool(HarvestTool.SHOVEL)); register("ash", (new BlockFalling(Material.LOOSE)).setHardness(0.2F).setSound(SoundType.SAND).setDisplay("Asche") - .setTab(CheatTab.NATURE).setShovelHarvestable()); - register("snow_layer", (new BlockSnow()).setHardness(0.1F).setSound(SoundType.SNOW).setDisplay("Schnee").setOpacity(0) - .setShovelHarvestable()); - register("snow", (new BlockSnowBlock()).setHardness(0.2F).setSound(SoundType.SNOW).setDisplay("Schnee").setShovelHarvestable()); - register("ice", (new BlockIce()).setHardness(0.5F).setOpacity(3).setSound(SoundType.GLASS).setDisplay("Eis").setMiningLevel(0)); - register("packed_ice", (new BlockPackedIce()).setHardness(0.5F).setSound(SoundType.GLASS).setDisplay("Packeis").setMiningLevel(0)); - register("soul_sand", (new BlockSoulSand()).setHardness(0.5F).setSound(SoundType.SAND).setDisplay("Seelensand").setShovelHarvestable()); + .setTab(CheatTab.NATURE).setMiningTool(HarvestTool.SHOVEL)); + register("snow_layer", (new BlockSnow()).setHardness(0.1F).setSound(SoundType.SNOW).setDisplay("Schnee").setOpacity(0).setMiningTool(HarvestTool.SHOVEL)); + register("snow", (new BlockSnowBlock()).setHardness(0.2F).setSound(SoundType.SNOW).setDisplay("Schnee").setMiningTool(HarvestTool.SHOVEL)); + register("ice", (new BlockIce()).setHardness(0.5F).setOpacity(3).setSound(SoundType.GLASS).setDisplay("Eis").setMiningTool(HarvestTool.PICKAXE, 0)); + register("packed_ice", (new BlockPackedIce()).setHardness(0.5F).setSound(SoundType.GLASS).setDisplay("Packeis").setMiningTool(HarvestTool.PICKAXE, 0)); + register("soul_sand", (new BlockSoulSand()).setHardness(0.5F).setSound(SoundType.SAND).setDisplay("Seelensand").setMiningTool(HarvestTool.SHOVEL)); register("glowstone", (new BlockGlowstone(Material.TRANSLUCENT)).setHardness(0.3F).setSound(SoundType.GLASS).setLight(1.0F) .setDisplay("Glowstone")); register("blackened_stone", (new BlockBlackenedStone()).setHardness(1.5F).setResistance(10.0F).setSound(SoundType.STONE).setDisplay("Schwarzstein")); @@ -307,35 +307,35 @@ public abstract class BlockRegistry { register("coal_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setSound(SoundType.STONE).setDisplay("Steinkohle")); register("lapis_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setSound(SoundType.STONE) - .setDisplay("Lapislazulierz").setMiningLevel(1)); + .setDisplay("Lapislazulierz").setMiningTool(HarvestTool.PICKAXE, 1)); register("emerald_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setSound(SoundType.STONE) - .setDisplay("Smaragderz").setMiningLevel(2)); + .setDisplay("Smaragderz").setMiningTool(HarvestTool.PICKAXE, 2)); register("quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setSound(SoundType.STONE) .setDisplay("Quarzerz")); register("black_quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setSound(SoundType.STONE) .setDisplay("Schwarzes Quarzerz")); register("charge_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setSound(SoundType.STONE) - .setDisplay("Geladenes Erz").setMiningLevel(2)); + .setDisplay("Geladenes Erz").setMiningTool(HarvestTool.PICKAXE, 2)); for(MetalType metal : MetalType.values()) { // String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1); register(metal.name + "_ore", (new BlockMetalOre(metal)).setHardness(3.0F).setResistance(5.0F) - .setDisplay(metal.display + "erz").setMiningLevel(1)); + .setDisplay(metal.display + "erz").setMiningTool(HarvestTool.PICKAXE, 1)); } for(OreType ore : OreType.values()) { // String loc = ore.name.substring(0, 1).toUpperCase() + ore.name.substring(1); register(ore.name + "_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setSound(SoundType.STONE) - .setDisplay(ore.display + "erz").setMiningLevel(ore.material.getHarvestLevel() - 1)); + .setDisplay(ore.display + "erz").setMiningTool(HarvestTool.PICKAXE, ore.material.getHarvestLevel() - 1)); } - register("dirt", (new Block(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Erde").setShovelHarvestable().setTab(CheatTab.NATURE)); - register("grass", (new BlockGrass()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Gras").setShovelHarvestable()); - register("coarse_dirt", (new Block(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Grobe Erde").setShovelHarvestable().setTab(CheatTab.NATURE)); - register("podzol", (new BlockPodzol()).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Podsol").setShovelHarvestable()); - register("mycelium", (new BlockMycelium()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Myzel").setShovelHarvestable()); + register("dirt", (new Block(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Erde").setMiningTool(HarvestTool.SHOVEL).setTab(CheatTab.NATURE)); + register("grass", (new BlockGrass()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Gras").setMiningTool(HarvestTool.SHOVEL)); + register("coarse_dirt", (new Block(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Grobe Erde").setMiningTool(HarvestTool.SHOVEL).setTab(CheatTab.NATURE)); + register("podzol", (new BlockPodzol()).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Podsol").setMiningTool(HarvestTool.SHOVEL)); + register("mycelium", (new BlockMycelium()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Myzel").setMiningTool(HarvestTool.SHOVEL)); register("tian", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE) .setDisplay("Tian").setTab(CheatTab.NATURE)); register("tian_soil", (new BlockTianSoil()).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE) @@ -343,15 +343,15 @@ public abstract class BlockRegistry { register("moon_cheese", (new BlockTreasure(Material.SOFT)).setHardness(1.5F).setResistance(5.0F) .setSound(SoundType.CLOTH).setDisplay("Mondkäse").setTab(CheatTab.NATURE)); register("slime_block", (new BlockSlime()).setDisplay("Schleimblock").setSound(SoundType.SLIME)); - register("blackened_dirt", (new BlockBlackenedDirt()).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Schwarzerde").setShovelHarvestable()); - register("blackened_soil", (new BlockBlackenedSoil()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Schwarzgrund").setShovelHarvestable()); - register("swamp", (new BlockSwamp()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Sumpf").setShovelHarvestable()); + register("blackened_dirt", (new BlockBlackenedDirt()).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Schwarzerde").setMiningTool(HarvestTool.SHOVEL)); + register("blackened_soil", (new BlockBlackenedSoil()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Schwarzgrund").setMiningTool(HarvestTool.SHOVEL)); + register("swamp", (new BlockSwamp()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Sumpf").setMiningTool(HarvestTool.SHOVEL)); for(BlockTallGrass.EnumType type : BlockTallGrass.EnumType.values()) { - register(type.getName(), (new BlockTallGrass(type)).setHardness(0.0F).setSound(SoundType.GRASS).setDisplay(type.getDisplay()).setShearsHarvestable()); + register(type.getName(), (new BlockTallGrass(type)).setHardness(0.0F).setSound(SoundType.GRASS).setDisplay(type.getDisplay()).setMiningTool(HarvestTool.SHEARS)); } register("deadbush", (new BlockDeadBush()).setHardness(0.0F).setSound(SoundType.GRASS).setDisplay("Toter Busch")); for(BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) { @@ -363,8 +363,8 @@ public abstract class BlockRegistry { Block cactus = (new BlockCactus()).setHardness(0.4F).setSound(SoundType.CLOTH).setDisplay("Kaktus"); register("cactus", cactus); register("reeds", (new BlockReed()).setHardness(0.0F).setSound(SoundType.GRASS).setDisplay("Zuckerrohr").setTab(CheatTab.PLANTS)); - register("vine", (new BlockVine(false)).setHardness(0.2F).setSound(SoundType.GRASS).setDisplay("Ranken").setShearsHarvestable()); - register("swamp_vine", (new BlockVine(true)).setHardness(0.2F).setSound(SoundType.GRASS).setDisplay("Sumpfranken").setShearsHarvestable()); + register("vine", (new BlockVine(false)).setHardness(0.2F).setSound(SoundType.GRASS).setDisplay("Ranken").setMiningTool(HarvestTool.SHEARS)); + register("swamp_vine", (new BlockVine(true)).setHardness(0.2F).setSound(SoundType.GRASS).setDisplay("Sumpfranken").setMiningTool(HarvestTool.SHEARS)); register("waterlily", (new BlockLilyPad()).setHardness(0.0F).setSound(SoundType.GRASS).setDisplay("Seerosenblatt")); @@ -407,9 +407,9 @@ public abstract class BlockRegistry { register("lapis_block", (new Block(Material.SOLID)).setHardness(3.0F).setResistance(5.0F) - .setSound(SoundType.STONE).setDisplay("Lapislazuliblock").setTab(CheatTab.GEMS).setMiningLevel(1)); + .setSound(SoundType.STONE).setDisplay("Lapislazuliblock").setTab(CheatTab.GEMS).setMiningTool(HarvestTool.PICKAXE, 1)); register("emerald_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) - .setSound(SoundType.STONE).setDisplay("Smaragdblock").setTab(CheatTab.GEMS).setMiningLevel(2)); + .setSound(SoundType.STONE).setDisplay("Smaragdblock").setTab(CheatTab.GEMS).setMiningTool(HarvestTool.PICKAXE, 2)); register("charged_block", (new BlockMagnetic(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) .setSound(SoundType.STONE).setDisplay("Geladener Block").setTab(CheatTab.GEMS)); @@ -424,8 +424,7 @@ public abstract class BlockRegistry { for(Color color : Color.values()) { - register(color.getName() + "_wool", (new BlockWool(color)).setHardness(0.8F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(-1) + " Wolle") - .setShearsHarvestable()); + register(color.getName() + "_wool", (new BlockWool(color)).setHardness(0.8F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(-1) + " Wolle").setMiningTool(HarvestTool.SHEARS)); } for(Color color : Color.values()) { register(color.getName() + "_carpet", (new BlockCarpet(color)).setHardness(0.1F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(1) + " Teppich").setOpacity(0)); @@ -434,7 +433,7 @@ public abstract class BlockRegistry { register(color.getName() + "_bed", (new BlockBed(color)).setSound(SoundType.WOOD).setHardness(0.2F).setDisplay(color.getSubject(0) + " Bett")); } - register("ladder", (new BlockLadder()).setHardness(0.4F).setSound(SoundType.LADDER).setDisplay("Leiter").setAxeHarvestable()); + register("ladder", (new BlockLadder()).setHardness(0.4F).setSound(SoundType.LADDER).setDisplay("Leiter").setMiningTool(HarvestTool.AXE)); register("bookshelf", (new BlockBookshelf()).setHardness(1.5F).setSound(SoundType.WOOD).setDisplay("Bücherregal")); register("cake", (new BlockCake()).setHardness(0.5F).setSound(SoundType.CLOTH).setDisplay("Kuchen").setTab(CheatTab.DECORATION)); register("dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setSound(SoundType.STONE) @@ -467,8 +466,7 @@ public abstract class BlockRegistry { register("portal_frame", (new BlockPortalFrame()).setSound(SoundType.GLASS).setLight(0.125F).setHardness(5.0F) .setDisplay("Portalrahmen").setResistance(2000.0F).setTab(CheatTab.TECHNOLOGY)); - register("farmland", (new BlockFarmland()).setHardness(0.6F).setSound(SoundType.GRAVEL).setDisplay("Ackerboden") - .setShovelHarvestable().setTab(CheatTab.PLANTS)); + register("farmland", (new BlockFarmland()).setHardness(0.6F).setSound(SoundType.GRAVEL).setDisplay("Ackerboden").setMiningTool(HarvestTool.SHOVEL).setTab(CheatTab.PLANTS)); register("wheats", (new BlockCrops()).setDisplay("Getreide")); register("carrots", (new BlockCarrot()).setDisplay("Karotten")); register("potatoes", (new BlockPotato()).setDisplay("Kartoffeln")); @@ -480,13 +478,12 @@ public abstract class BlockRegistry { for(MetalType metal : MetalType.values()) { // String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1); register(metal.name + "_block", (new BlockMetalBlock(metal)).setHardness(5.0F).setResistance(10.0F) - .setDisplay(metal.display + "block").setMiningLevel(1)); + .setDisplay(metal.display + "block").setMiningTool(HarvestTool.PICKAXE, 1)); } for(OreType ore : OreType.values()) { // String loc = ore.name.substring(0, 1).toUpperCase() + ore.name.substring(1); register(ore.name + "_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F).setSound(SoundType.STONE) - .setDisplay(ore.display + "block").setTab(CheatTab.GEMS) - .setMiningLevel(ore.material.getHarvestLevel() - 1)); + .setDisplay(ore.display + "block").setTab(CheatTab.GEMS).setMiningTool(HarvestTool.PICKAXE, ore.material.getHarvestLevel() - 1)); } @@ -639,7 +636,7 @@ public abstract class BlockRegistry { register("hopper", (new BlockHopper()).setHardness(3.0F).setResistance(8.0F).setSound(SoundType.STONE).setDisplay("Trichter")); register("tian_reactor", (new BlockTianReactor()).setHardness(3.0F).setResistance(8.0F).setSound(SoundType.STONE).setDisplay("Tianreaktor")); - register("rail", (new BlockRail()).setHardness(0.7F).setSound(SoundType.STONE).setDisplay("Schiene").setMiningLevel(0)); + register("rail", (new BlockRail()).setHardness(0.7F).setSound(SoundType.STONE).setDisplay("Schiene").setMiningTool(HarvestTool.PICKAXE, 0)); register("lever", (new BlockLever()).setHardness(0.5F).setSound(SoundType.WOOD).setDisplay("Hebel")); diff --git a/common/src/main/java/common/init/CraftingRegistry.java b/common/src/main/java/common/init/CraftingRegistry.java index 3e1d6cbc..0b83cf87 100755 --- a/common/src/main/java/common/init/CraftingRegistry.java +++ b/common/src/main/java/common/init/CraftingRegistry.java @@ -23,7 +23,7 @@ import common.util.Color; public abstract class CraftingRegistry { private static final String[][] TOOLS = new String[][] { - {"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"} + {"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"} }; private static final String[][] WEAPONS = new String[][] {{"X", "X", "#"}}; private static final String[][] ARMOR = new String[][] { @@ -49,7 +49,6 @@ public abstract class CraftingRegistry add(new ItemStack(ItemRegistry.byName(ore.name + "_pickaxe")), TOOLS[0], '#', Items.stick, 'X', item); add(new ItemStack(ItemRegistry.byName(ore.name + "_shovel")), TOOLS[1], '#', Items.stick, 'X', item); add(new ItemStack(ItemRegistry.byName(ore.name + "_axe")), TOOLS[2], '#', Items.stick, 'X', item); - add(new ItemStack(ItemRegistry.byName(ore.name + "_hoe")), TOOLS[3], '#', Items.stick, 'X', item); } if(ore.material.hasExtras()) { add(new ItemStack(ItemRegistry.byName(ore.name + "_shears")), " #", "# ", '#', item); @@ -75,7 +74,6 @@ public abstract class CraftingRegistry add(new ItemStack(ItemRegistry.byName(metal.name + "_pickaxe")), TOOLS[0], '#', Items.stick, 'X', item); add(new ItemStack(ItemRegistry.byName(metal.name + "_shovel")), TOOLS[1], '#', Items.stick, 'X', item); add(new ItemStack(ItemRegistry.byName(metal.name + "_axe")), TOOLS[2], '#', Items.stick, 'X', item); - add(new ItemStack(ItemRegistry.byName(metal.name + "_hoe")), TOOLS[3], '#', Items.stick, 'X', item); } if(metal.material != null && metal.material.hasExtras()) { add(new ItemStack(ItemRegistry.byName(metal.name + "_shears")), " #", "# ", '#', item); @@ -101,7 +99,6 @@ public abstract class CraftingRegistry add(new ItemStack(ItemRegistry.byName(tool.name + "_pickaxe")), TOOLS[0], '#', Items.stick, 'X', item); add(new ItemStack(ItemRegistry.byName(tool.name + "_shovel")), TOOLS[1], '#', Items.stick, 'X', item); add(new ItemStack(ItemRegistry.byName(tool.name + "_axe")), TOOLS[2], '#', Items.stick, 'X', item); - add(new ItemStack(ItemRegistry.byName(tool.name + "_hoe")), TOOLS[3], '#', Items.stick, 'X', item); } if(tool.material.hasExtras()) { add(new ItemStack(ItemRegistry.byName(tool.name + "_shears")), " #", "# ", '#', item); @@ -117,7 +114,8 @@ public abstract class CraftingRegistry } } } - + + add(new ItemStack(Items.hoe), "XX", " #", " #", '#', Items.stick, 'X', Items.cobblestone); add(new ItemStack(Items.bow, 1), " #X", "# X", " #X", 'X', Items.string, '#', Items.stick); add(new ItemStack(Items.arrow, 4), "X", "#", "Y", 'Y', Items.feather, 'X', Items.flint, '#', Items.stick); diff --git a/common/src/main/java/common/init/ItemRegistry.java b/common/src/main/java/common/init/ItemRegistry.java index 66ce1083..3201b0fc 100755 --- a/common/src/main/java/common/init/ItemRegistry.java +++ b/common/src/main/java/common/init/ItemRegistry.java @@ -134,7 +134,6 @@ public abstract class ItemRegistry { register(name + "_shovel", (new ItemShovel(material)).setDisplay(prefix + "schaufel")); register(name + "_pickaxe", (new ItemPickaxe(material)).setDisplay(prefix + "spitzhacke")); register(name + "_axe", (new ItemAxe(material)).setDisplay(prefix + "axt")); - register(name + "_hoe", (new ItemHoe(material)).setDisplay(prefix + "hacke")); } if(material.hasExtras()) { register(name + "_shears", (new ItemShears(material)).setDisplay(prefix + "schere")); @@ -219,6 +218,7 @@ public abstract class ItemRegistry { register("lighter", (new ItemFire(Blocks.fire)).setDisplay("Feuerzeug")); register("burning_soul", (new ItemFire(Blocks.soul_fire)).setDisplay("Brennende Seele")); register("dark_lighter", (new ItemFire(Blocks.black_fire)).setDisplay("Verdunkelndes Feuerzeug")); + register("hoe", (new ItemHoe()).setDisplay("Hacke")); register("apple", (new ItemFood(4, false)).setDisplay("Apfel").setMaxAmount(StackSize.L)); register("bow", (new ItemBow()).setDisplay("Bogen")); register("boltgun", (new ItemBoltgun()).setDisplay("Bolter")); diff --git a/common/src/main/java/common/init/Items.java b/common/src/main/java/common/init/Items.java index 0432e5c0..82c333f4 100755 --- a/common/src/main/java/common/init/Items.java +++ b/common/src/main/java/common/init/Items.java @@ -306,7 +306,6 @@ public abstract class Items { public static final ItemArmor diamond_boots = get("diamond_boots"); public static final ItemArmor diamond_chestplate = get("diamond_chestplate"); public static final ItemArmor diamond_helmet = get("diamond_helmet"); - public static final ItemHoe diamond_hoe = get("diamond_hoe"); public static final ItemHorseArmor diamond_horse_armor = get("diamond_horse_armor"); public static final ItemArmor diamond_leggings = get("diamond_leggings"); public static final Item diamond_ore = get("diamond_ore"); @@ -363,7 +362,6 @@ public abstract class Items { public static final ItemArmor gold_boots = get("gold_boots"); public static final ItemArmor gold_chestplate = get("gold_chestplate"); public static final ItemArmor gold_helmet = get("gold_helmet"); - public static final ItemHoe gold_hoe = get("gold_hoe"); public static final ItemHorseArmor gold_horse_armor = get("gold_horse_armor"); public static final ItemMetal gold_ingot = get("gold_ingot"); public static final ItemArmor gold_leggings = get("gold_leggings"); @@ -392,7 +390,6 @@ public abstract class Items { public static final Item gunpowder = get("gunpowder"); public static final ItemAxe gyriyn_axe = get("gyriyn_axe"); public static final Item gyriyn_block = get("gyriyn_block"); - public static final ItemHoe gyriyn_hoe = get("gyriyn_hoe"); public static final Item gyriyn_ore = get("gyriyn_ore"); public static final ItemPickaxe gyriyn_pickaxe = get("gyriyn_pickaxe"); public static final ItemShovel gyriyn_shovel = get("gyriyn_shovel"); @@ -415,7 +412,6 @@ public abstract class Items { public static final ItemArmor iron_chestplate = get("iron_chestplate"); public static final Item iron_door = get("iron_door"); public static final ItemArmor iron_helmet = get("iron_helmet"); - public static final ItemHoe iron_hoe = get("iron_hoe"); public static final ItemHorseArmor iron_horse_armor = get("iron_horse_armor"); public static final ItemMetal iron_ingot = get("iron_ingot"); public static final ItemArmor iron_leggings = get("iron_leggings"); @@ -518,7 +514,6 @@ public abstract class Items { public static final ItemArmor nichun_boots = get("nichun_boots"); public static final ItemArmor nichun_chestplate = get("nichun_chestplate"); public static final ItemArmor nichun_helmet = get("nichun_helmet"); - public static final ItemHoe nichun_hoe = get("nichun_hoe"); public static final ItemArmor nichun_leggings = get("nichun_leggings"); public static final Item nichun_ore = get("nichun_ore"); public static final ItemPickaxe nichun_pickaxe = get("nichun_pickaxe"); @@ -690,7 +685,6 @@ public abstract class Items { public static final Item stone = get("stone"); public static final ItemAxe stone_axe = get("stone_axe"); public static final Item stone_button = get("stone_button"); - public static final ItemHoe stone_hoe = get("stone_hoe"); public static final ItemPickaxe stone_pickaxe = get("stone_pickaxe"); public static final Item stone_pressure_plate = get("stone_pressure_plate"); public static final ItemShovel stone_shovel = get("stone_shovel"); @@ -713,7 +707,6 @@ public abstract class Items { public static final ItemArmor thetium_boots = get("thetium_boots"); public static final ItemArmor thetium_chestplate = get("thetium_chestplate"); public static final ItemArmor thetium_helmet = get("thetium_helmet"); - public static final ItemHoe thetium_hoe = get("thetium_hoe"); public static final ItemArmor thetium_leggings = get("thetium_leggings"); public static final Item thetium_ore = get("thetium_ore"); public static final ItemPickaxe thetium_pickaxe = get("thetium_pickaxe"); @@ -794,7 +787,6 @@ public abstract class Items { public static final Item white_tulip = get("white_tulip"); public static final Item white_wool = get("white_wool"); public static final ItemAxe wood_axe = get("wood_axe"); - public static final ItemHoe wood_hoe = get("wood_hoe"); public static final ItemPickaxe wood_pickaxe = get("wood_pickaxe"); public static final ItemShovel wood_shovel = get("wood_shovel"); public static final ItemSword wood_sword = get("wood_sword"); @@ -1072,6 +1064,7 @@ public abstract class Items { public static final Item cocoa_powder = get("cocoa_powder"); public static final Item ink_sack = get("ink_sack"); public static final Item lapis_lazuli = get("lapis_lazuli"); + public static final ItemHoe hoe = get("hoe"); private static T get(String id) { T item = (T)ItemRegistry.byName(id); diff --git a/common/src/main/java/common/item/tool/ItemAxe.java b/common/src/main/java/common/item/tool/ItemAxe.java index c5cf1798..2ed4db30 100755 --- a/common/src/main/java/common/item/tool/ItemAxe.java +++ b/common/src/main/java/common/item/tool/ItemAxe.java @@ -1,19 +1,10 @@ package common.item.tool; -import common.block.Block; import common.init.ToolMaterial; -import common.item.ItemStack; +import common.util.HarvestTool; public class ItemAxe extends ItemTool { public ItemAxe(ToolMaterial material) { - super(3, material); - } - - public boolean canUseOn(ItemStack stack, Block block) { - return block.canAxeHarvest(); - } - - public boolean canHarvestBlock(Block block) { - return block.canAxeHarvest(); + super(material, HarvestTool.AXE); } } diff --git a/common/src/main/java/common/item/tool/ItemHoe.java b/common/src/main/java/common/item/tool/ItemHoe.java index 6bec9648..68735d4b 100755 --- a/common/src/main/java/common/item/tool/ItemHoe.java +++ b/common/src/main/java/common/item/tool/ItemHoe.java @@ -3,7 +3,6 @@ package common.item.tool; import common.block.Block; import common.entity.npc.EntityNPC; import common.init.Blocks; -import common.init.ToolMaterial; import common.item.CheatTab; import common.item.Item; import common.item.ItemStack; @@ -15,22 +14,12 @@ import common.world.World; public class ItemHoe extends Item { - protected ToolMaterial theToolMaterial; - - public ItemHoe(ToolMaterial material) + public ItemHoe() { - this.theToolMaterial = material; - this.setMaxDamage(material.getDurability()); + this.setMaxDamage(131); this.setTab(CheatTab.TOOLS); - if(this.theToolMaterial.isMagnetic()) - this.setMagnetic(); } - - - /** - * Called when a Block is right-clicked with this Item - */ public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ) { if (!playerIn.canPlayerEdit(pos.offset(side), side, stack)) @@ -80,28 +69,6 @@ public class ItemHoe extends Item return true; } } - -// /** -// * Returns True is the item is renderer in full 3D when hold. -// */ -// public boolean isFull3D() -// { -// return true; -// } - -// /** -// * Returns the name of the material this tool is made from as it is declared in EnumToolMaterial (meaning diamond -// * would return "EMERALD") -// */ -// public String getMaterialName() -// { -// return this.theToolMaterial.toString(); -// } - - public ToolMaterial getToolMaterial() - { - return this.theToolMaterial; - } public WieldType getWieldType() { return WieldType.TOOL; diff --git a/common/src/main/java/common/item/tool/ItemPickaxe.java b/common/src/main/java/common/item/tool/ItemPickaxe.java index 0501cccf..5c30fe45 100755 --- a/common/src/main/java/common/item/tool/ItemPickaxe.java +++ b/common/src/main/java/common/item/tool/ItemPickaxe.java @@ -1,31 +1,10 @@ package common.item.tool; -import java.util.List; - -import common.block.Block; -import common.entity.npc.EntityNPC; import common.init.ToolMaterial; -import common.item.ItemStack; -import common.util.Clientside; -import common.util.Color; +import common.util.HarvestTool; public class ItemPickaxe extends ItemTool { public ItemPickaxe(ToolMaterial material) { - super(2, material); + super(material, HarvestTool.PICKAXE); } - - public boolean canHarvestBlock(Block block) { - return block.getMiningLevel() >= 0 && this.getToolMaterial().getHarvestLevel() >= block.getMiningLevel(); - } - - public boolean canUseOn(ItemStack stack, Block block) { - return block.getMiningLevel() >= 0; - } - - @Clientside - public void addInformation(ItemStack stack, EntityNPC playerIn, List tooltip) - { - tooltip.add(Color.VIOLET + "Level " + (this.getToolMaterial().getHarvestLevel() + 1)); - super.addInformation(stack, playerIn, tooltip); - } } diff --git a/common/src/main/java/common/item/tool/ItemShears.java b/common/src/main/java/common/item/tool/ItemShears.java index 6f77a66f..64f85ec6 100755 --- a/common/src/main/java/common/item/tool/ItemShears.java +++ b/common/src/main/java/common/item/tool/ItemShears.java @@ -1,63 +1,10 @@ package common.item.tool; -import java.util.List; - -import common.block.Block; -import common.entity.npc.EntityNPC; -import common.entity.types.EntityLiving; import common.init.ToolMaterial; -import common.item.CheatTab; -import common.item.Item; -import common.item.ItemStack; -import common.item.WieldType; -import common.util.BlockPos; -import common.util.Clientside; -import common.util.Color; -import common.world.World; +import common.util.HarvestTool; -public class ItemShears extends Item -{ - private final ToolMaterial material; - - public ItemShears(ToolMaterial material) - { - this.setMaxDamage(material.getDurability() - 12); - this.setTab(CheatTab.TOOLS); - this.material = material; - if(this.material.isMagnetic()) - this.setMagnetic(); - } - - public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLiving playerIn) - { - if (!blockIn.canShearsHarvest()) - return super.onBlockDestroyed(stack, worldIn, blockIn, pos, playerIn); - stack.damage(1, playerIn); - return true; - } - - public boolean canHarvestBlock(Block blockIn) - { - return blockIn.canShearsHarvest(); - } - - public float getStrVsBlock(ItemStack stack, Block state) - { - return !state.canShearsHarvest() ? 1.0F : (float)this.material.getEfficiency(); - } - - @Clientside - public void addInformation(ItemStack stack, EntityNPC playerIn, List tooltip) - { - tooltip.add(Color.DARK_GREEN + "+ " + (this.material.getEfficiency() - 1) + " Abbaueffizienz"); - } - - public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) - { - return this.material.isRepairItem(repair.getItem()); - } - - public WieldType getWieldType() { - return WieldType.TOOL; - } +public class ItemShears extends ItemTool { + public ItemShears(ToolMaterial material) { + super(material, HarvestTool.SHEARS); + } } diff --git a/common/src/main/java/common/item/tool/ItemShovel.java b/common/src/main/java/common/item/tool/ItemShovel.java index 7b7de0cb..13140853 100755 --- a/common/src/main/java/common/item/tool/ItemShovel.java +++ b/common/src/main/java/common/item/tool/ItemShovel.java @@ -1,19 +1,10 @@ package common.item.tool; -import common.block.Block; import common.init.ToolMaterial; -import common.item.ItemStack; +import common.util.HarvestTool; public class ItemShovel extends ItemTool { public ItemShovel(ToolMaterial material) { - super(1, material); - } - - public boolean canUseOn(ItemStack stack, Block block) { - return block.canShovelHarvest(); - } - - public boolean canHarvestBlock(Block block) { - return block.canShovelHarvest(); + super(material, HarvestTool.SHOVEL); } } diff --git a/common/src/main/java/common/item/tool/ItemTool.java b/common/src/main/java/common/item/tool/ItemTool.java index bee2a93c..26bf20b2 100755 --- a/common/src/main/java/common/item/tool/ItemTool.java +++ b/common/src/main/java/common/item/tool/ItemTool.java @@ -8,40 +8,46 @@ import common.entity.types.EntityLiving; import common.init.ToolMaterial; import common.item.CheatTab; import common.item.Item; +import common.item.ItemAction; import common.item.ItemStack; import common.item.WieldType; import common.util.BlockPos; import common.util.Clientside; import common.util.Color; +import common.util.HarvestTool; import common.world.World; public abstract class ItemTool extends Item { - private final int damage; private final ToolMaterial material; + private final HarvestTool type; - public ItemTool(int damage, ToolMaterial material) { + public ItemTool(ToolMaterial material, HarvestTool type) { this.material = material; + this.type = type; this.setMaxDamage(material.getDurability()); - this.damage = damage + material.getDamage(); - this.setTab(CheatTab.TOOLS); + this.setTab(this.type.isMelee() ? CheatTab.WEAPONS : CheatTab.TOOLS); if(this.material.isMagnetic()) this.setMagnetic(); } - public abstract boolean canUseOn(ItemStack stack, Block block); + public boolean canHarvestBlock(Block block) { + return block.getMiningTool() == this.type && (!this.type.isLevelled() || this.getToolMaterial().getHarvestLevel() >= block.getMiningLevel()); + } public float getStrVsBlock(ItemStack stack, Block block) { - return !this.canUseOn(stack, block) ? 1.0F : (float)this.material.getEfficiency(); + return block.getMiningTool() == this.type ? (float)this.material.getEfficiency() : 1.0f; } @Clientside public void addInformation(ItemStack stack, EntityNPC playerIn, List tooltip) { + if(this.type.isLevelled()) + tooltip.add(Color.VIOLET + "Level " + (this.getToolMaterial().getHarvestLevel() + 1)); tooltip.add(Color.DARK_GREEN + "+ " + (this.material.getEfficiency() - 1) + " Abbaueffizienz"); } public boolean hitEntity(ItemStack stack, EntityLiving target, EntityLiving attacker) { - stack.damage(2, attacker); + stack.damage(this.type.isMelee() ? 1 : 2, attacker); return true; } @@ -55,19 +61,37 @@ public abstract class ItemTool extends Item { return this.material; } + public HarvestTool getToolType() { + return this.type; + } + public int getItemEnchantability() { return this.material.getEnchantability(); } public boolean getIsRepairable(ItemStack stack, ItemStack repair) { - return this.material.isRepairItem(repair.getItem()) ? true : super.getIsRepairable(stack, repair); + return this.material.isRepairItem(repair.getItem()); } public int getAttackDamageBonus() { - return this.damage; + return this.type.getDamage() >= 0 ? this.material.getDamage() + this.type.getDamage() : 0; } public WieldType getWieldType() { return WieldType.TOOL; } + + public ItemAction getItemUseAction() { + return this.type.isMelee() ? ItemAction.BLOCK : super.getItemUseAction(); + } + + public int getMaxItemUseDuration(ItemStack stack) { + return this.type.isMelee() ? 72000 : super.getMaxItemUseDuration(stack); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn) { + if(this.type.isMelee()) + playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + return itemStackIn; + } } diff --git a/common/src/main/java/common/item/weapon/ItemSword.java b/common/src/main/java/common/item/weapon/ItemSword.java index abc4ddc2..232ef976 100755 --- a/common/src/main/java/common/item/weapon/ItemSword.java +++ b/common/src/main/java/common/item/weapon/ItemSword.java @@ -1,154 +1,11 @@ package common.item.weapon; -import java.util.List; - -import common.block.Block; -import common.entity.npc.EntityNPC; -import common.entity.types.EntityLiving; import common.init.ToolMaterial; -import common.item.CheatTab; -import common.item.Item; -import common.item.ItemAction; -import common.item.ItemStack; -import common.item.WieldType; -import common.util.BlockPos; -import common.util.Clientside; -import common.util.Color; -import common.world.World; +import common.item.tool.ItemTool; +import common.util.HarvestTool; -public class ItemSword extends Item -{ - private int attackDamage; - private final ToolMaterial material; - - public ItemSword(ToolMaterial material) - { - this.material = material; - this.setMaxDamage(material.getDurability()); - this.setTab(CheatTab.WEAPONS); - this.attackDamage = 4 + material.getDamage(); - if(this.material.isMagnetic()) - this.setMagnetic(); - } - - /** - * Returns the amount of damage this item will deal. One heart of damage is equal to 2 damage points. - */ - public int getDamageVsEntity() - { - return this.material.getDamage(); - } - - public ToolMaterial getToolMaterial() - { - return this.material; - } - - public float getStrVsBlock(ItemStack stack, Block state) - { - return state.canSwordHarvest() ? (float)this.material.getEfficiency() : 1.0f; - } - - public boolean canHarvestBlock(Block blockIn) - { - return blockIn.canSwordHarvest(); - } - - @Clientside - public void addInformation(ItemStack stack, EntityNPC playerIn, List tooltip) - { - tooltip.add(Color.DARK_GREEN + "+ " + (this.material.getEfficiency() - 1) + " Abbaueffizienz"); - } - - /** - * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise - * the damage on the stack. - */ - public boolean hitEntity(ItemStack stack, EntityLiving target, EntityLiving attacker) - { - stack.damage(1, attacker); - return true; - } - - /** - * Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic. - */ - public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLiving playerIn) - { - if ((double)blockIn.getHardness(worldIn, pos) != 0.0D) - { - stack.damage(2, playerIn); - } - - return true; - } - -// /** -// * Returns True is the item is renderer in full 3D when hold. -// */ -// public boolean isFull3D() -// { -// return true; -// } - - /** - * returns the action that specifies what animation to play when the items is being used - */ - public ItemAction getItemUseAction() - { - return ItemAction.BLOCK; - } - - /** - * How long it takes to use or consume an item - */ - public int getMaxItemUseDuration(ItemStack stack) - { - return 72000; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn) - { - playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); - return itemStackIn; - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() - { - return this.material.getEnchantability(); - } - -// /** -// * Return the name for this tool's material. -// */ -// public String getToolMaterialName() -// { -// return this.material.toString(); -// } - - /** - * Return whether this item is repairable in an anvil. - */ - public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) - { - return this.material.isRepairItem(repair.getItem()) ? true : super.getIsRepairable(toRepair, repair); - } - - public int getAttackDamageBonus() { - return this.attackDamage; - } - -// public boolean canBreakBlocks() { -// return false; -// } - - public WieldType getWieldType() { - return WieldType.TOOL; - } +public class ItemSword extends ItemTool { + public ItemSword(ToolMaterial material) { + super(material, HarvestTool.SWORD); + } } diff --git a/common/src/main/java/common/tileentity/TileEntityFurnace.java b/common/src/main/java/common/tileentity/TileEntityFurnace.java index 250c95a1..a675cb21 100755 --- a/common/src/main/java/common/tileentity/TileEntityFurnace.java +++ b/common/src/main/java/common/tileentity/TileEntityFurnace.java @@ -20,9 +20,7 @@ import common.inventory.SlotFurnaceFuel; import common.item.Item; import common.item.ItemStack; import common.item.material.ItemBucket; -import common.item.tool.ItemHoe; import common.item.tool.ItemTool; -import common.item.weapon.ItemSword; import common.tags.TagObject; import java.util.List; import common.util.ExtMath; @@ -362,14 +360,13 @@ public class TileEntityFurnace extends TileEntityInventory implements ITickable, } return item instanceof ItemTool && ((ItemTool)item).getToolMaterial() == ToolType.WOOD.material ? 200 : - (item instanceof ItemSword && ((ItemSword)item).getToolMaterial() == ToolType.WOOD.material ? 200 : - (item instanceof ItemHoe && ((ItemHoe)item).getToolMaterial() == ToolType.WOOD.material ? 200 : + (item == Items.hoe ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.charcoal ? 1200 : (item instanceof ItemBucket && ((ItemBucket)item).getLiquid() != null && ((ItemBucket)item).getLiquid().getMaterial() == Material.LAVA ? 20000 : - (item == Items.demon_rod ? 2400 : 0))))))); + (item == Items.demon_rod ? 2400 : 0)))))); } } diff --git a/common/src/main/java/common/util/HarvestTool.java b/common/src/main/java/common/util/HarvestTool.java new file mode 100644 index 00000000..abd3831f --- /dev/null +++ b/common/src/main/java/common/util/HarvestTool.java @@ -0,0 +1,53 @@ +package common.util; + +public enum HarvestTool implements Displayable { + PICKAXE("Spitzhacke", true, 2), + AXE("Axt", 3), + SHOVEL("Schaufel", 1), + SHEARS("Schere"), + SWORD("Schwert", 4, true); + + private final String display; + private final boolean levelled; + private final boolean melee; + private final int damage; + + private HarvestTool(String display, boolean levelled, int damage, boolean melee) { + this.display = display; + this.levelled = levelled; + this.damage = damage; + this.melee = melee; + } + + private HarvestTool(String display, boolean levelled, int damage) { + this(display, levelled, damage, false); + } + + private HarvestTool(String display, int damage, boolean melee) { + this(display, false, damage, melee); + } + + private HarvestTool(String display, int damage) { + this(display, false, damage, false); + } + + private HarvestTool(String display) { + this(display, false, -1, false); + } + + public String getDisplay() { + return this.display; + } + + public boolean isLevelled() { + return this.levelled; + } + + public boolean isMelee() { + return this.melee; + } + + public int getDamage() { + return this.damage; + } +}