From dabef4a3fd401c82f135630262af22a7f6094b41 Mon Sep 17 00:00:00 2001 From: Sen Date: Tue, 15 Jul 2025 03:24:57 +0200 Subject: [PATCH] fixes, burning out torches, remove some redstone --- .../client/gui/ingame/GuiCreateDimension.java | 2 +- .../{redstone_ore.png => charge_ore.png} | Bin .../{redstone_block.png => charged_block.png} | Bin .../main/resources/textures/blocks/lamp.png | Bin 682 -> 616 bytes .../{lit_redstone_lamp.png => lit_lamp.png} | Bin .../textures/blocks/lit_soul_torch.png | Bin 0 -> 4680 bytes .../textures/blocks/lit_tian_torch.png | Bin 0 -> 4651 bytes .../resources/textures/blocks/lit_torch.png | Bin 0 -> 159 bytes .../textures/blocks/redstone_lamp.png | Bin 616 -> 0 bytes .../textures/blocks/redstone_torch.png | Bin 160 -> 0 bytes .../resources/textures/blocks/soul_torch.png | Bin 0 -> 4651 bytes .../resources/textures/blocks/tian_torch.png | Bin 0 -> 4604 bytes .../main/resources/textures/blocks/torch.png | Bin 159 -> 4612 bytes .../textures/blocks/unlit_redstone_torch.png | Bin 155 -> 0 bytes ...redstone_dust_cross.png => wire_cross.png} | Bin ...oss_overlay.png => wire_cross_overlay.png} | Bin .../{redstone_dust_line.png => wire_line.png} | Bin ...line_overlay.png => wire_line_overlay.png} | Bin .../{redstone.png => charged_powder.png} | Bin .../textures/items/chest_minecart.png | Bin 246 -> 0 bytes .../resources/textures/items/comparator.png | Bin 968 -> 0 bytes .../textures/items/furnace_minecart.png | Bin 229 -> 0 bytes .../textures/items/hopper_minecart.png | Bin 396 -> 0 bytes .../textures/items/minecart_command_block.png | Bin 620 -> 0 bytes .../resources/textures/items/repeater.png | Bin 182 -> 0 bytes .../main/resources/textures/items/wire.png | Bin 0 -> 4755 bytes .../artificial/BlockCompressedPowered.java | 33 - .../common/block/artificial/BlockDoor.java | 38 +- .../block/artificial/BlockFenceGate.java | 46 +- .../block/artificial/BlockMagnetic.java | 16 + .../block/artificial/BlockTrapDoor.java | 118 +-- .../block/natural/BlockRedstoneOre.java | 200 ----- .../block/tech/BlockBasePressurePlate.java | 30 +- .../common/block/tech/BlockBrewingStand.java | 2 +- .../java/common/block/tech/BlockCauldron.java | 1 - .../java/common/block/tech/BlockChest.java | 7 +- .../common/block/tech/BlockDispenser.java | 85 +- .../java/common/block/tech/BlockDropper.java | 76 -- .../java/common/block/tech/BlockFurnace.java | 3 +- .../java/common/block/tech/BlockHopper.java | 54 +- .../java/common/block/tech/BlockLitTorch.java | 125 +++ .../java/common/block/tech/BlockMachine.java | 3 +- .../java/common/block/tech/BlockNuke.java | 21 - .../common/block/tech/BlockPistonBase.java | 50 +- .../common/block/tech/BlockPressurePlate.java | 6 +- .../tech/BlockPressurePlateWeighted.java | 6 +- .../java/common/block/tech/BlockRail.java | 695 ++++++++++++++++- .../java/common/block/tech/BlockRailBase.java | 724 ------------------ .../common/block/tech/BlockRailDetector.java | 187 ----- .../common/block/tech/BlockRailPowered.java | 174 ----- .../block/tech/BlockRedstoneComparator.java | 432 ----------- .../common/block/tech/BlockRedstoneDiode.java | 298 ------- .../common/block/tech/BlockRedstoneLight.java | 99 --- .../block/tech/BlockRedstoneRepeater.java | 562 -------------- .../common/block/tech/BlockRedstoneTorch.java | 242 ------ .../main/java/common/block/tech/BlockTNT.java | 1 - .../block/tech/BlockToggleableLight.java | 66 ++ .../java/common/block/tech/BlockTorch.java | 31 +- .../common/block/tech/BlockUnlitTorch.java | 51 ++ ...{BlockRedstoneWire.java => BlockWire.java} | 512 ++++++------- .../java/common/entity/item/EntityCart.java | 91 ++- .../common/entity/item/EntityLeashKnot.java | 42 - .../common/entity/item/EntityTntCart.java | 6 +- .../java/common/entity/npc/EntityNPC.java | 3 +- .../main/java/common/init/BlockRegistry.java | 60 +- common/src/main/java/common/init/Blocks.java | 28 +- .../java/common/init/CraftingRegistry.java | 25 +- .../main/java/common/init/ItemRegistry.java | 25 +- common/src/main/java/common/init/Items.java | 31 +- .../java/common/init/SmeltingRegistry.java | 2 +- .../main/java/common/init/TradeRegistry.java | 2 +- .../java/common/init/UniverseRegistry.java | 2 +- .../main/java/common/inventory/Container.java | 6 +- .../src/main/java/common/item/CheatTab.java | 2 +- .../{ItemRedstone.java => ItemWire.java} | 14 +- .../common/item/spawner/ItemMinecart.java | 14 +- .../java/common/item/tool/ItemChargedOrb.java | 1 - .../java/common/item/tool/ItemShears.java | 3 +- .../common/pathfinding/WalkNodeProcessor.java | 6 +- .../java/common/tileentity/TileEntity.java | 14 +- .../tileentity/TileEntityDispenser.java | 62 +- .../common/tileentity/TileEntityDropper.java | 72 ++ .../common/tileentity/TileEntityHopper.java | 2 +- common/src/main/java/common/vars/Vars.java | 6 +- common/src/main/java/common/world/World.java | 133 ---- .../server/clipboard/ClipboardPlacer.java | 4 +- .../server/clipboard/ReorderRegistry.java | 23 +- .../src/main/java/server/world/Converter.java | 490 +++++------- .../java/server/worldgen/LootConstants.java | 8 +- .../structure/StructureComponent.java | 7 +- .../structure/StructureMineshaft.java | 7 +- .../structure/StructureScattered.java | 105 ++- .../structure/StructureStronghold.java | 36 +- .../worldgen/structure/StructureVillage.java | 24 +- 94 files changed, 1902 insertions(+), 4450 deletions(-) rename client/src/main/resources/textures/blocks/{redstone_ore.png => charge_ore.png} (100%) rename client/src/main/resources/textures/blocks/{redstone_block.png => charged_block.png} (100%) rename client/src/main/resources/textures/blocks/{lit_redstone_lamp.png => lit_lamp.png} (100%) create mode 100755 client/src/main/resources/textures/blocks/lit_soul_torch.png create mode 100755 client/src/main/resources/textures/blocks/lit_tian_torch.png create mode 100755 client/src/main/resources/textures/blocks/lit_torch.png delete mode 100755 client/src/main/resources/textures/blocks/redstone_lamp.png delete mode 100755 client/src/main/resources/textures/blocks/redstone_torch.png create mode 100755 client/src/main/resources/textures/blocks/soul_torch.png create mode 100755 client/src/main/resources/textures/blocks/tian_torch.png delete mode 100755 client/src/main/resources/textures/blocks/unlit_redstone_torch.png rename client/src/main/resources/textures/blocks/{redstone_dust_cross.png => wire_cross.png} (100%) rename client/src/main/resources/textures/blocks/{redstone_dust_cross_overlay.png => wire_cross_overlay.png} (100%) rename client/src/main/resources/textures/blocks/{redstone_dust_line.png => wire_line.png} (100%) rename client/src/main/resources/textures/blocks/{redstone_dust_line_overlay.png => wire_line_overlay.png} (100%) rename client/src/main/resources/textures/items/{redstone.png => charged_powder.png} (100%) delete mode 100755 client/src/main/resources/textures/items/chest_minecart.png delete mode 100755 client/src/main/resources/textures/items/comparator.png delete mode 100755 client/src/main/resources/textures/items/furnace_minecart.png delete mode 100755 client/src/main/resources/textures/items/hopper_minecart.png delete mode 100755 client/src/main/resources/textures/items/minecart_command_block.png delete mode 100755 client/src/main/resources/textures/items/repeater.png create mode 100755 client/src/main/resources/textures/items/wire.png delete mode 100755 common/src/main/java/common/block/artificial/BlockCompressedPowered.java create mode 100755 common/src/main/java/common/block/artificial/BlockMagnetic.java delete mode 100755 common/src/main/java/common/block/natural/BlockRedstoneOre.java create mode 100755 common/src/main/java/common/block/tech/BlockLitTorch.java delete mode 100755 common/src/main/java/common/block/tech/BlockRailBase.java delete mode 100755 common/src/main/java/common/block/tech/BlockRailDetector.java delete mode 100755 common/src/main/java/common/block/tech/BlockRailPowered.java delete mode 100755 common/src/main/java/common/block/tech/BlockRedstoneComparator.java delete mode 100755 common/src/main/java/common/block/tech/BlockRedstoneDiode.java delete mode 100755 common/src/main/java/common/block/tech/BlockRedstoneLight.java delete mode 100755 common/src/main/java/common/block/tech/BlockRedstoneRepeater.java delete mode 100755 common/src/main/java/common/block/tech/BlockRedstoneTorch.java create mode 100755 common/src/main/java/common/block/tech/BlockToggleableLight.java create mode 100644 common/src/main/java/common/block/tech/BlockUnlitTorch.java rename common/src/main/java/common/block/tech/{BlockRedstoneWire.java => BlockWire.java} (59%) rename common/src/main/java/common/item/block/{ItemRedstone.java => ItemWire.java} (85%) diff --git a/client/src/main/java/client/gui/ingame/GuiCreateDimension.java b/client/src/main/java/client/gui/ingame/GuiCreateDimension.java index be4de396..edf3328c 100644 --- a/client/src/main/java/client/gui/ingame/GuiCreateDimension.java +++ b/client/src/main/java/client/gui/ingame/GuiCreateDimension.java @@ -137,7 +137,7 @@ public class GuiCreateDimension extends Gui { addFlatPreset("Wüste", Biome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState()) .enableVillages().enableScattered(); - addFlatPreset("Redstonewelt", Biome.DESERT, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), + addFlatPreset("Sandsteinwelt", Biome.DESERT, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState()); addPreset("Leer", "ClearGenerator:1b"); diff --git a/client/src/main/resources/textures/blocks/redstone_ore.png b/client/src/main/resources/textures/blocks/charge_ore.png similarity index 100% rename from client/src/main/resources/textures/blocks/redstone_ore.png rename to client/src/main/resources/textures/blocks/charge_ore.png diff --git a/client/src/main/resources/textures/blocks/redstone_block.png b/client/src/main/resources/textures/blocks/charged_block.png similarity index 100% rename from client/src/main/resources/textures/blocks/redstone_block.png rename to client/src/main/resources/textures/blocks/charged_block.png diff --git a/client/src/main/resources/textures/blocks/lamp.png b/client/src/main/resources/textures/blocks/lamp.png index 9562ef3e23b5268a9e671781442ec2747b2187a4..522765beb5b1343b8d44a04455f62a7e29584ccf 100755 GIT binary patch delta 591 zcmV-V02Wf1#DtWi5)&2_0rjkmH~JOUW_NdW03h?bY6M3a z5qVQcW^GNv$$u>wr=>;K0_h@ib_SsMQP&0l5;Sr$d{bl0tY;Hwsv&%PT)@Xid9;mH zYfO0Md^{U6rZs(uvXT!kTyMJ+f-@m~CmYHTm?m8MP4mxMFO zdK~>Pa1O1KAH9ak0JX$W1tjY1hEdN*tn}Avm_e*Ttu0KTSz5+n%FO`38WptE;OHt7 zNRrgCfr^eE);av+uw;+;p1&CnRqn^D{_2{;fD*c#U(bW;KL{4p@KrJNJ$ zz$n^_#XcqGoMK9j^s8VNmvIhsr*>m~M2qPzG05dL3*l)M#v#cIU}cnAUFefj>*@ zgFrHh_|{#I&nz$)ij+1HiHWNnJB`ZYr&^F^(k1KPFa=wXgv*ruYb sT6mb^69(8d6>yys6d$JlJLspIyir9??q^|VdpYbi^v!x4KkVx8X^gY z$aEtP;TA$eqgihM9JlzG?{r4bBTw`2$)(v1N9FBqO=S&@-n ztU2FazKUTV|Ivvjo9y$$T+cm7zBJ{E`;C^VNAeCY>1e*S$LKA3=~A_2-;TRCjqQd8 zjJ&egrkAo|U zNTiWTdS^o+Gb(h{%g)BKNxgzeX~8{@Yn!)rN$Su0nYP7T#B%ibMBTX8-h^EPje@+Obp2v3bQO_NgK(_9bp9l<%f@+>ASz^|;I@ z*L~NF?t=$kIp9k$Ws3D$l89eaOC`bxhef1>}g=|vsWWi@<9*4EytfHo$qE|`7# zB~+QpfMmv>oz@R$WC@?SxnjQN$+Mub!|@Ppa{O6Z`c*fmHfOl8FmP$Z_J}z-m_Yk31RpmPYIB*RuT=ZO9&f3DLdk~2HjlnY1rQv zBp&={^7i%i!gb^JoVa1ypR0OO^6I0EXSZXo4lDAnV2FA~_>P)LJe--hp@!Y)R`d91 z)yASCuhzqeplXjx-i4fe>uQdF?pce~6SAe7G&`&fm+Br?`&E@ZXKYz%s!8C{=}V_} zuGQCh*KeBFbf$7oPRn_pRhO;1Z~W_0-NO21r8P~41FWh}mNoSFn!6jiOLhyd=HLCY zrYGsa-OkOn;Por>ZS^m<$>&5o{+m7TXaS+XqqmlHwDIj5X-nOtPUr5eNSXPc%;XgZ zooiao$Jvix@QJj$Hcc(=uC3sos@k7_%(IdxEnIi{>T`Vpe_=;&c9X%@>&>#}-MpaM zN`|c+sk`pe*n3jgy3%;HXx!+(JTktDDfE$>CYEo$URt)XJn>#8Bcl7mXzu2$hvtyl zOxJ0jGD*h7kQSe;TbUDVBcYRSpXKvZP5hA5Uh}I{wMRm?A7U0YocuBKi`o%Us~Ds6 zd$=!fWiAvdIZ9&~okY!9lKp76|~*;UofCbV+)%#3E%na3$cH60@0*LxoI~G8ZYMp)i99hXgDE zivx#Sh*Tak$Q24SVH!z{Ox_Ox?xf5Fk~B)#?6kBrRvMpWFlpJ`fPerthsWmeV4wk; z)Ab}`f%Rrz3Zf4~hMQ3nVI&EI9-=T2wIPL+GMQi&^Wv06y3j#K`8d zIBcDcJ=nrbhNl9M{(yed!mI*&B0B~*8&XUt9-fNpN#DT`7&>5YOfe-n(!o$Ro`maw zsu_6YzTz&xB6-PRQ0|Dj(xbJAc$=#t0w3JGT z%z&m);VEQNCgop(8BhX~I4*IG0Og2zYM3Jq;KBk_poZ0`0E2~G+@C8()p&pi9R#J& zn@L2E;uI7BXAuBL;2*#j`>RDT2Um+>fl!3OVpJo9)wo6@5OV#6JQNuO5oIDkS0YJ+ zqoSZN0L2YZ3psot2NntW0$89HYhXkm6ay%sP^`fP7+25-g`pC;!K6b#ISC!2#o0!^ z*5QL9ToM|skTQ8J&Ra=z5<+T#fs{Fy(5G15E~p3{9!nw=n_Q8Q2i#I;p@=IIzg3FE zO=i%E6egF$;tL!rR9Pe-89*#T^(g>w$U!cWFcXfD29wHQNRl$CkRZx(U|9*q2}4Lk zhLAV_l-=o8?C?aHQW-iv|vQXcBA{~KMdZ(pZyJ$MRA120RS2iuh3MT@SU zGh0S0q`rTh5=H&z;$nU_3a_U|jHe{aRagxjI|v?Gbdn*v;E3mxUDk zIMVdAEyL+ZTaZS{coARBzvO9JuG6yft^C9{^V`5$-&?xg?# literal 0 HcmV?d00001 diff --git a/client/src/main/resources/textures/blocks/lit_tian_torch.png b/client/src/main/resources/textures/blocks/lit_tian_torch.png new file mode 100755 index 0000000000000000000000000000000000000000..4f986926c7c7c0445947e43734ef2a16b01cb329 GIT binary patch literal 4651 zcmeHLdsGu=7Ec!uO*fgFg6ZznU8FiIX~1`<%#M@3P( zR9F@9vDFq@&{cfY`ao>!3qeuvwYUoEDhjT+RgXoqmi;Cm!fDUx@to~{BxjPD``!Dy z_x`?n@5z_7>V#N#m(eaP7Rx<8PLTw@J()w`ZRD^9S+Hr!6n#`V9E|=Xr~dCU5*GadPqTL(;)M z`;N3a%xO6rzAUlBoBLD2+O^{o?AZ+v`uY-5%rjl#2(=$_V#wxl-_>amSU&8&{qov$H~TWEnS1 zg8kW*8yzc)-aL_x%bJVi!yeQJ2$^OsuK*yM$IG>t*yL>lAb=1u$i76g+WTN9EP3mPy zZH)Uc2aoC@gDFfpSv5>=bgJ4nOqEbrnzsVK*_gwFXt%A|RCVg=g3z78!?!^%d4U~| zT&cZ#BJQ`Z^P-W81<_|Yhb^?j&@FoP3+Epp`MkW{%XjRZQ~?zZZ9FztQ#wCzh2IWG zf3KG2Pd2=2V~smm?}ChHvlce`j;INIpjZ_#n&lOzA2KI$x#no}c&7qq@!3VG#|v9q zYir9g%Bs=9!zK@1axtQeHQjmLi@&Wz-Mzfrca0X6lh=n$SY3vk9r4edDTO6>3cuQ% zbYMd=vVXzChQeYZxcK0m`m26a?Iw!rh>f&yZIwHsgEsEIs=jtDCHc^nMP$kpNNCt! zs)G(+KKgNWX9Jell=XzD|2}Cn+L{~S?wh$`ZK?Q79h`o)_^Z0G^UC(queenae@$4p zbp0&p?7CYuUyXe-$&)x_Z zIE6P=Yv%_yEu(E$CCT!fm*N`Tj^_;%eAho~e3QQYw(C#6RZrCQwLUQgk7IK~Pr9%1 z&%R#%TKuZK{Be0^O{n(#y02U2LrvcEH;lO#M7Hj-tnvBx;i7MsAnd1w_=|PbQ4ddy zSRYvW8jq-j*p`{InrqX$E;V;m1*ARNI{ufONxxiO`Ez~4Ro69#T&KP&ckJ95&{kA3 zlI!2{{K+l3{^x(p>`Lr%wA9@2>_p2_Kug<5(7GwAsWQxD;G(!mOK@!lGiYrVD=ge* zMzKW%&DIin(kSQrxAHp;u2<)0RRI* zqimZY%}B{?a*iEW2JRU#kHfaB(2L}p6qTACZL$z-Ay>$SA*GGX;B%(9u){34PL`yI z>45-Ga!x8un`Jzn)oSHh1zeLw&qJhADG%oJ_o_FEk) z(PC1O5RwQ(U`U8aMUVs&>L65zNcaL=s}qaFeW2ov6pb1&f`J0yToT~m0t6LE1u!HL zi?xtYs?|Xfgs+3d0-cDD=!Arn&+h|~XdyvWqG^4jVxVvUC6);JQcQ$Gd>x8FLWw8@ zl4vC;gu}QvM1)Ipn7A7X$7C@kivb1ONg7Z+!8056b{`DkvPgBjoWtkB?0GPsYv2`6=#zo*SK4?C=T%i~B2_|LS9x;rYFSls>8{g_7DTZzrKH-!wvx>KOg z3<9^u39!1CuvFBjC&2XRDc84h@;6EWBLpFQ977K3leq^<|AYA#@{88&t6Js55oF8n zbe@o)4+R$@E@qZ&NDF6q4n5wnd4=bns;r^)v!bW9N9^%>xXnKonYUH_QK$5->t$u2Wf1 z#DtWi5)&2_0rjkmH~JOUW_NdW03h?bY6M3a5qVQcW^GNv$t@YDrA5{P=^}G>2B7#+ z*9HI*G;%V0Q)A4mXA@|uA$)sWz{f{u8xtCyO zicb%-IKH_EuP`>E<$&SPqHgqFsQCOKg%9_xqj#*EQ9`#G#-?ZTubp6kaxMn-s>jT3 z=b!Co!@%3SaeUvu!2p(-W<>8P5eKA{S+q+593@4p^dVcyd1j(^(#jlrw!c1)gXCqr zDk$je1coZ`UV!0uqJ1ZZu9=mlP0yEvGst=z{V#A1t&$(ThROi7#83q!>g#$n3M0KXa)wAA3}Dih=|?Pg{Q&0HY9%DFgt&vew1ZnVomUKL+u zOGqz@0T-$<8O8oWSwn4A!pKMy$S(<_KhyvI&c6Y32aAndQKl9E00007Fi*Ar-fh6C_x-u+~dT{A)J2 zIqUy@hDUWqyo}Nx>VMS>EI1+h`s7s}rpev0|8BoHJt6kv7RZ!l7f^FMX@-^Wb%#)4+%)rKnx(LSeZ;FVI;}KnE?WJDez4we^J_t*!|BO+bXxp3~zw+y6+;B=g9Pcj+Qqma{n#Xrhq?NGa zd?w$8^Kmy}<#61WZl}##H*S(|$Bj{o2ag{yva#H)yXE)j@s{ZQ=X3KKs~Vr}6UU8e z37xUhWW4ZjN$2Z#M4DS+2f`Ols%UMmA1euvp1504x%sV(hZozc8@~SX-~?W*7jkRY zr^#LN#LgolM_09;T62zWahEl7b*HQC z)$1?3{e9(jZC&TLX}aCRI|g5WJ=}dZwBC<@A}u34D}15Ppt$Ha9r3~5TN_5K`KE=@ zzP6&FI4~-;AhT`Z=^NMXZ2G*ZV!GRhI?!5iZFMUl$awql4|LVuqwilUaU`FLid%9B zlLlpxFYYD*FHAD5^5uDJXY%iWqCZ`f5je^}LrWZ#C4tt~UROo##ZbETTH02w*H0avR zz^GYscTQe~mMj`;&73;5?js4D55-kgre_S(Z}f2B06qVghj>eE`=(zc=n0pWk6?!B_wy<*D0%S(cvgpaB$~GWz2^m&`;^;+>m1`R<(y^uInn~k?2cr7#RJsT{mJo{Cu*l&M_4S~cxLg3z z6VUH^&?#UPicC07=1>?Omy0`@aeW~ySg*e;hq8Opv0x(Hjyr%U4R#gx+j5%TVC?l^ zDXPcgq^MO2DPc1TArdnVn=y$5#$|n=^iG;VofytS0dOG!a3m@@ zszh)Mk}AYFB(*BdkV;_@LlUuBj7u>&Y7zH^NTLW(m8iXMR4kMQK;gJlX;H!mq{L(r zNGele5UNtBAdA&3hUHe7+$>XgqOoA=c#?9U;5Z2fYQse?r_G~a30KD$^;!WUgkMOE zc9gLK2d!Wx;mmQrP^1tJJefgRHpL1VB9llJazrJ8r3%RlquDq`gGyvE#jsE!^=Q~* zQG;Xvu_#-o0Kg*$xu|0)9A!u~ibTMO8t!9HS_o_YA6c`_!`E~lc>+O${qsGd?v6^v7j>_?mv+L_N_@VjDby&| zodS*K;ucSw0IOStWuZxjvT@zf%e-SYei%B^C%lU>KBwOa-Z|76l~5R0yt; zNzJfT-XEPNtxO(D;W0MABj5^@r-v(kxaXiI^|#K;!r4;*gh8+Z`YmCio`gm0%y^!$ zM)Vs_G#-OKLk9SD%fRpgvryDK40||Z$IhSl>N$%)aR&fBu*pmDJ3!X}T`$GJOBoMT z*8p8F#lTA$4^-FxjV_-Tk5jl4{0hng4@-s_t82i67S}vunvU}^`<@$?#QxPX+?6ng z=5YS14$+%14(dw#ao`b zqPw+fwN~6+b?ddIRXkS23lF@ixYo0%z|soXdMvi9>~8`BzV^L7-`oC2@+O)29-r^` z`}uvpzn5PM^~v$VkjM~$Kp@m6Xbj*xoWFVng3rN^TS$Q*U}e5BjWduQ$mwD&jE#mk zpOc1YFJlo1yf+#?n!e`2h_EGhl_%dTzcK#3pc2g!VQur{`@2S!;9JLL`_^0g1`aR} zc@q59fFH}s;+li{BRgYYUnM3kC9-R~mw)tP)C}En$J6ikZak*@pfoUI)`Drz;#Vzw z`Ss*;D~FFNdbnxGo{FRSV~d{dZSpMfvgUlECNJXb(jnFJ3f>B!XJ6}6vh6>KX+PcB z=N^9KE;;Sn{f-a3$;&b%l|w6MCG@*0Iye@3ybtO*VS>)2Uv%!{%I#C{kzw6@Z*TkV z>?3PZ>eDS>2|r9Mu6R-X$=V;bh&(ZWO#NwZbkS|$Y3c9EHcx+1)Vwdc?zSh<>| zR90O!^Vny|3T%J(%lA@ue$)SPnC#ZN2Nt0;d`nJ`s(pgZH7_^J?AgN}=X0!Hadh{g z!m58a3@Z|TG5+$U#<@j?v0;#A-HmU;f_oK2J`0RZ@8cFtfCd(X%*>pU5mQiETCSb8 zx|i&NJL~WoYYI(qK~L_Z0l|M-rmlmGg2bw#Xzf6yF)8W%m~?!SZUC$4A;7S*1yat7x1emHK02YE=p zygtu*ykvgr&9WsgBY%v3H;c)8bYot<@NU}8fRbwmmrotuaw@&KpC@l(!=q1k8L|ds zEn?ZT>uss^k3;iP%KKluBKvQ0^~H21=3X^fRdVI#`<09LJSXd>{A=MSgK|gDF3f8_ zvHbWC^@bz&de_#S@SGTXI6ORh*0HA3BkM;lZqimnqr}dc%;i0oPHdiZdfSq}%o110 zHP2FlpI%Yea5 z(@GzXdJOva%WH61DwL5x`~N|owRopT~>WfJmT zbV`1*k;>1elx9)%xR5BX3INz?j)c5+o5QX0szrWW6}acchzRnVaM@~6nobW*WL-2w zhzT(Y$9kDOTr@5OigKAPDuX7j4FWu=MOKb;su0BE@rXSVG3&}iFr`w7pg4l#FtC8# zJ_kp7VTXGt57CODq1}{=adHgnfOt&O#O88pkqGFaSNYkUI$b-w!`;RL-~;iJP6QL9 zh~18K_Hc8tc>ts>p!Rq`Jleqx?F?b2+WnomE}Op`GlkGL+73+J zAS(7+$at+z-|oRvkjdDcelI}wYnB{i=^*R1+<1+@oX&{=_jcUZtY6jcHwIQZol3(} zxqNzBjatOVSD9IgF{}KylvGaBatQ{@FiZ{;G)=%HAu+=ig-lAwP|Spx6`i284mU?S zD4K@?;9>^gps2!Prj$|`lM_mqFyTsAfhv`-6qQ(HI4zgrGQ1PSWETUvlC*Wsiia`- zC^;=7ffw*4Wduy1avUacQURMV5>uE6nG#cCeke1giep`N5-cZUCo^fp>B#gec*0dN zdaYW7i_s2=-bQj3;Gh;IF^*hshr-C%=@gFS*~CDmQVAiK$uJp)Vv-J{X|&4?I+4f3 zP_cyYYxreRfnor$B;Th1z%K{2s3y8-l4D&)mbIxxd`b}S*{;@saWaz}sUbNUfTFlm zh00Z!)QDm#3|A4d(I^gR?XYLfjK%kB*8K25QLRg!z_>wtpI_8EQ7Lpz>r?Bajq#5X z1o?+TMN+LLxXC=)?2ikuT2+*lbY#+C_h@U^S90bTT7e=h7KsT*VTFW{z=VasVUrYe z20^0=iPR#alx^g-qq|uP=OJBmOeWwFa0S}a&lNPnzfdDz&&6Y<`Beaf!KfVmIbld! z!3e)+ys9_~`57lseuGY%4Df4}fz1o-g-H8m*v1*i_qTktt;KH{0)o1Nyb-@$bam17 zMhv`>aaVVB(e*|QypeHNcm3b!3h6jb(GKt{$O8^b>l>_MaL@`gCB|z6TlshT@X7rD zC&A8y>284_v@d^k6KvQR0fa%ERu>yoAM{rLF!8CZ!!1B$(`sUjigOJYv5*2ZyvNb= z<-IHWFW9v5`ty)?XSA?6^#wKfaPnfgdfBDF(OaK4? literal 0 HcmV?d00001 diff --git a/client/src/main/resources/textures/blocks/torch.png b/client/src/main/resources/textures/blocks/torch.png index a2ce41b8ad537bb691d7ad063286503cd1fcfc30..55062ec84c6c61c5a0082ab06e0b994a802123b2 100755 GIT binary patch literal 4612 zcmeHLdsGu=79T}__XuwYf_!75bqV0xpT9ia!RI^euP_L5+mvBU;u0{2(9YOQw3!le z>2^v;IcXCFIlp~wRMU-x#Id(wr)n9ueX0o z{aL>a|NPf@3^!7^731a?m?o6No}Q{ zmuFwN5T3Lvr}(y@>afTCmZ^gqPHF|s2R{zHdjGj)f-UlN8)R|2SG0Nk*Vj6R-B&ea zUHa^DLwRsLQNN&gXw}WYtPj&YS5JonE<a%6Z$CpZIpDb;W9~U@e|h=Nnt{YwM&Lr85W3+t@!f7^O#9 zN^||){LXoeZgtnirsS(wH)Z|-Z+%?;Cwa^8DV07=c*z;dvrD6I4=SD#vB~SK=l<&X zw~iyVM-TV^_{jSe{=?g6gq%*gJKI;`UvhNgr_*!x|Ck9^^v^j~Red;m8vcOZ72Kin zx(mSuqZY7`J1~&>;adWc1g>-tq2Vc5!qB=5imY?kM!)YnsNR(DC{QK4Xt<gw0>SYaz#zvExc7uyf4j0=O@ zE8~vUtHV}{nWpB}1m~TzJMvkd#%*^`GE1V$_g^tgS+)JReSDoy+B;`g1|F^oOItAa z`N3t5hNj%Ck^c!FIie%r>pDS6HFfEO@FKy0(JLF+$t$nNKDZajK5kJpe|I7z^CRL=XjXWBlk{cFjT66~-t^(^D~W@%|0WNLJ6~OzGIrIv_L4)-kk$#0{0nEC zJ5{vphnd$39(sJgc2@e5ip$xBxpNrMJW($CZoHj5Y|Z8#-%TI`^KAt*H5X~&2~6eq-~WZJ3~eSiFvNJx`f(R&KL zL~oCzQt0RmhDywcGZGn#2sJ4R5AzOnY5;(R;xM7pVz#mxr&i>`)qs0mjEICT6>gDM zl%zKZBW(;NM8&9B0!KONG?^&OTNuiaCQX8FS{DR((uz_z&aOcahr=Ou$i+4$8Ih{h zYD6MKWHK0Nz-+pe!V(2KAU}!r>+pIz!6T@w(oK_?P>%!OZS?qd!H@ubY zVgc}hI59gS6-y9{1?g$Qa#3jjq${A`wP1~4&LIgDYfEJaDk_b#a$|c!kVLn=J(V%L z(jf_iGE)|y$^x&_UM{D{=ndT#JO#fyGM$n|jb&FxBG(>@+Foohu7*!J{ScNO3FiN5_QcmJ3 zQYPyG6=P*N%t}x^6aW{~0Ed#umAG1=f>oG80U&S;#_^C4m@-Kz5;b9%62*Ez#4|Lg zO3d6dDjtdiP%5Qdrj(*6Ovof8fRX?xQZ0q0YLf~l)H0<6SGb@^LNm?ASTL}iv;|A1 z5W6+mwZIdui7>=yMKZDEjl^KaI1@0?ie}Q*ROg!oBW z?L=Z6ro%W2fJ$TvjYO%DDvT02enfyL4&(iJDb>RcjHFl#aerbkz~zLwL!QwjvBl$!{? z3NVa-Q7NH-aWyCfl~krgC6o%sFse5?Ycp{UjG-cu0gr$yP@XQXgcDpFHLe`Dx z&;x+(bMjXF_R-Zx*IP00R?2P}UgqIWnZ^)YF`u a!=bPtW7uKV=a+$BC?+aSSMisHIsXOaNVAy$ delta 131 zcmV-}0DS+1B%cA0BYXg6NklJ63YamO$0W&H* l|6A)xQ|1D5EpfaC003HxD*7v7Q#Swr002ovPDHLkV1hX$H-G>D diff --git a/client/src/main/resources/textures/blocks/unlit_redstone_torch.png b/client/src/main/resources/textures/blocks/unlit_redstone_torch.png deleted file mode 100755 index 635eabd4c41c2d250c75f4f261e0336c30070d36..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`NuDl_Ar-fh6C_xhWm*gk{(NUh z+QiF{d2Pv&hFL1R|J!ZLdLnJG^TyNtz5956viazi{(hgb%4Hwp=hw{ttR=K3+tSf52bs^Dc{n82?rv|opR8_+fePgg&ebxsLQ E02a+VdjJ3c diff --git a/client/src/main/resources/textures/blocks/redstone_dust_cross.png b/client/src/main/resources/textures/blocks/wire_cross.png similarity index 100% rename from client/src/main/resources/textures/blocks/redstone_dust_cross.png rename to client/src/main/resources/textures/blocks/wire_cross.png diff --git a/client/src/main/resources/textures/blocks/redstone_dust_cross_overlay.png b/client/src/main/resources/textures/blocks/wire_cross_overlay.png similarity index 100% rename from client/src/main/resources/textures/blocks/redstone_dust_cross_overlay.png rename to client/src/main/resources/textures/blocks/wire_cross_overlay.png diff --git a/client/src/main/resources/textures/blocks/redstone_dust_line.png b/client/src/main/resources/textures/blocks/wire_line.png similarity index 100% rename from client/src/main/resources/textures/blocks/redstone_dust_line.png rename to client/src/main/resources/textures/blocks/wire_line.png diff --git a/client/src/main/resources/textures/blocks/redstone_dust_line_overlay.png b/client/src/main/resources/textures/blocks/wire_line_overlay.png similarity index 100% rename from client/src/main/resources/textures/blocks/redstone_dust_line_overlay.png rename to client/src/main/resources/textures/blocks/wire_line_overlay.png diff --git a/client/src/main/resources/textures/items/redstone.png b/client/src/main/resources/textures/items/charged_powder.png similarity index 100% rename from client/src/main/resources/textures/items/redstone.png rename to client/src/main/resources/textures/items/charged_powder.png diff --git a/client/src/main/resources/textures/items/chest_minecart.png b/client/src/main/resources/textures/items/chest_minecart.png deleted file mode 100755 index 78a377860a47b7d9bc0b25b4b4a01f83064254be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`dp%toLn>}1e~7VYWo*0H*e3J6 zULx%P>xaxYKH=@jbJ`T78+?@m+YXpKzT`1Qu_fntcE^et5;4Y#&Iw|TUk>nIxOS11 zTS5EKQo$o^D~}o^ygM{C;UJH_rHJ!}%$$sOM@$%0IE-0thD~TR=)GC#noz1BwVL|^ zuj4ksNaHwh1?i@BoXfd4NIrV9F7wVCDM)(OC*=@rFXSRG8Hr0 tNpF0ryhG7wQxQw^jvSL*-( diff --git a/client/src/main/resources/textures/items/comparator.png b/client/src/main/resources/textures/items/comparator.png deleted file mode 100755 index 28b8eec1a49be16653fbf25c58ca34d9727a7377..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 968 zcmV;(12_DMP)00U@AL_t(I%U#d?PtZG)3S#}4|CC4ra#nVH2fi9*|E0Nte`;Y zY)nkpd2l=mga>!u;!r5@9yks@{ghk%1FyZ`Vq%~NfX2Nw?9b2V!AI`nyDkTFH*XS> z5&*NRQdD1$OI5MCTwM2fINIKd!#0F6d8v<65tS-E*AEgk2`PBamdn#QUAezFo1F{>)Zs$ImdEMhL- z&Di)9!C(-8zt+|yBfk>}1jO5=Pa)FvdXkJrh8GriA|r#k1J96J^(3nv6}h>NeR!Pq zPfjqpxX709aI$XQl6EP{iHj35IT@w9^>v)K+nm09ffWR)6=kfrodo@Us>=3}l#swi zC`8M9ZxR(5#n_E*Jk}YKCzo()G>FRZaEdD`$lUW7Cl548fM-8`OZ4;%&}(;arsE4D z4RN^VoZNOT;{2meerug!Wb992(CN@bO3B*#I)-Eu0Cp*9IPw|2b_f0T%jmWl7`fPo z|HeFDwp$pPUBc`2(s|-IQ9d6^LQW04ND_HgigGF z{Io!B;=3|LAUzq4UZ*49WTN4t4`k;3@c>*L7?i)-9J0rHm4d|ByKA{6MXdRK_@<|+ zscj(Q+7yc2?Iy$R2Dtn8!~TN+y!7=c2~e2e#bcde>gpitN|5FcKc^@xjC;&xL`_Z( z4`imX5Ed;9igN*IuC4(fO9%kAKcCCcga^aliWt9hhaJ(;EIXa}wr)jvp|B8_s`AxO z76C|rcP;JzfeHX7%EFDNr;bUI{_{%trDZt5$pGJsH%#{ZGyJ* qgFK#@MCX<3C>jkRA$X_0ntuSa&vuWOH%}Y@0000+jA diff --git a/client/src/main/resources/textures/items/furnace_minecart.png b/client/src/main/resources/textures/items/furnace_minecart.png deleted file mode 100755 index 5478f25cc0f990cd5a0cfcf514906c91bc593d19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ydl>XLn>}1CmdjAVP*Y)*nnA+ zVcE%3r?~n$jaX*8E#f`6e4>Uk$IZU$0)d8xJJOum4(KqwY?NNGb}_e@Ls*NqatCiv zcjAFNt=b2htgNgw+7d3`xNxU4lfgqEjbqbV1?EJl&7ZptymBxJ6JH?Rl%u>UZI7OV z8B46NpLl}tk&{PRSEo&|^7GSslgW5fU;^U{vnB%%V-MMLBAmu7&zSa@Ju-H23+uCx b)?{Tk*&)2!QRk@^(A^B4u6{1-oD!M<&UQ~X diff --git a/client/src/main/resources/textures/items/hopper_minecart.png b/client/src/main/resources/textures/items/hopper_minecart.png deleted file mode 100755 index 8a138fbb6a44a34a2a358a9eca42053ea983582f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 396 zcmV;70dxL|P) zwXiQKq(r&fkp=)TmLiH{)a`FiS4e5@8akQH7pCA#IOpJ;qmU9&9AlJ^O)b*N$NL** z^981p95>yrBhli!hao6UQI?(-N=SEe?lo;!NO6066gT;}QU{|Jvia)4^uFa#!#r0D>?6_SOCs q^!k~)Y_%0-Of{Pqs@KmH{wq$05wufy&*5eO0000?gt%TO5mo6nSVsr~5f+SXl zwqvN}VA?sn*ulXNJI)Dtn3y~5A5)rh5czai+WXFz`d*%ghv)nG{dxWRWoI6t zmD^#F-TAkAOTj?qe;I>b52It_3^c2R6FF%FF&i1*K7Igz$>k$mdc&mk20^cfWy*aJ zMQe_S{4}giOfDb$$&Z|$xQWv0&>6f;r;_hxqASOwrG*nY2AWkml{~hY`|L`|!7s_V zOa_z7N5kqQ9`fsYa|%EeLY_7MBp&h;PUNu3BL>fOxUl~PVR5CV@1*DYuza6POH~M& zou8G_+g|B*SY+YZgmgPB((SOw?EI`$g^;QcGWsGWRUxGA6gKNMUcG+D^jw4wPw#Q- z+C{>NTrc8uY>7L;DOA z`meGU0vJa8vk!nkazPK!LYmDcrM0!bh$m(EME@u47w{Wmj0TJKK{^ls0000yV5`uly#Dw77bCG3*_%&!am_b+*%6S?n$J%?~AL(zi+CWm<1B$-Sa7&931 z_Akt4k>ombV%>q4<`Woim^2l*Rf**>J8&iF9atvlVa$-pwukKiQ@cv92b;l!rGnjx eOR|@UFfgPhv|d}0y-6785C%_IKbLh*2~7ab3Ols` diff --git a/client/src/main/resources/textures/items/wire.png b/client/src/main/resources/textures/items/wire.png new file mode 100755 index 0000000000000000000000000000000000000000..1b3aa44784f5a9518dedd311eb97dc03150196d8 GIT binary patch literal 4755 zcmeHLc~nzp77wV%rUKFttV;;kLg8g!9|Qz~A!smQKtwCPyu1gIY-WLg+5*$crcjlA z8>~=Jkr^2sWn4h3v~^)BinyUNSVgVdIHRQ%oi70qPJ7NA&zb(m%SrOSyZpX;fA@a( zVk;g6ZnH<>BTX=@F85d*vUJ>3FE@C*+~5pIB+t>oGH7GKiIzvnl^^aKNV~8?pOC96c1*P}wtpDW~dAGPPYJT&khLBm( z$h?|oz5Mvh8P2T^x`3XB4Z`$;9u0F}CGjo?KP^t^YCb)9c%bm`3w)zLBQh#P(AdAO zF|BAz)^+QdU+?D)d|xOrIy{;4qNhD3qqe}i(B(VZA6xds6{)KivTLVgtsL=@P%P z`2BMHO2i$%q>2hO@`|prz8%lJlXcKxa>NSL)&+j|OAghYDmhY=_wQXh)^1_N>}f6O z5YPTum=Cd%TZ@Zh>$+yge%xOXyYg8)9KARH!H(oYzVSh8>C6L@E@eNpUTdiBct1Ln zTHTmg*(D9$Sv}D1n6b}c^2rMs1iN#S7#dgW8MkflK*sJ6_sIM0P3IRn+HNY2^B4a( z=W)*T+n;<^xwtRu{ZD7{IJN7YTZPwac3kR6Y*gnwjNxY8pVFN@)NQ}geg5I>?jd!5 z_kSq9YwMMDLihQ8%hM(H@UiZo_}=+b`n%X&GZ*?d{(T_0e2%POM#<~G`;XlB4?^tDh_lEVA=Ei!v;0w9OBQC72Z$0w^L;PrJ^Yv}DO)KY3b9wK`vQ@ZK z%du^QN1tyVWI8|jE8bBbxpXKs_C;>SK-2SPIPE}ZSt*vj``Y;%Uu=H0`h2$hBHKs( z>FHCPzd3uI_$;W#BVisa7>t;A=&_+7G3}OmuE$c>qPEPoU-D{Cy7!j+<8aL>ZQ- zQ1eNT54Vws3OS#&oF%4;wV_y&B0OD(ElZD-qUp&fPfiL7v=1=B06>Kq5TZ$?RO?|A zpJc&>!M#~bArUPmhGae|PAnmYYIGQpNoJC%P?$-PLMH{<69aT|9F7(&8i4>SJ}Jpy z(83f-YHBJul|k0%5-Btuk4K@>DRepnEFgWF+JKlKwcgVVF^nO=^r%juH7GP{q8SsB zX^aLwi3Ie-H}R>oV(}=vT0g=9;Dcg9v=kbdN>QmOV?FeSuoM6?63}mY=%rv_Qlc@v z#;8NFuoO&f@Ei*vM@Rj&MxD}HmVSkf6A2yh?89cTR}cZ)Hw5{qGh1~r<)6AAbv^Zu}0gDT{(<(AEsvv>%d z1)*#%3Ng7{IfO7dbg;xwoJM6aSyaXtD3MxkK-4H^h63PZ1;C-97@bL#qYw?@aUmv; z$%S|bhCy7MBj?F5IS1v^#y~99DL_{u%CS+Iq2vIH&Y^LcERGCf;!GCAl(9LGjLO9z zDvEI#Tn-8@x&=y(!izLI6#~ksP$7vJMXOG&7R5F8U(U{8ugJb})h`CPz zfJF{+fkSl|V$kTM8jX@qGKWModycBb;5f+<10p~S7yzZxSum9Y)0k2!4`y&+D$|!r zhpA)iHF5=>_P?ynhldz2T=H;*9_*iH5e=WHW!Spm)$mfOupA{K(Q+tY1RYL6kECF7 zOPl~}ScN7b>O>4okCAqLBUk)JE1*mcn*&-0!Z<7pVzPNMNXBDuAy7jZ&XaR77KV*S z*K2S?Dx$-J69JEaE6|=6u87{2LivohPEEqhRRDxRR1WlO!YCsNQ_M5tO~wI~UvUy( zF&HysfZwnT3@syjkV01sL=vc*CHVW;^OzhJ5P4;edc_zFFN;4stt zwjxwixdGu+gGd}U_1@I!Qx{AQ+b3!Pq85=LSjs(fG|J!pB+<2MmTjHLr||M^n;K7J zJ7fLi8OUGkE+5-$8Lv=^)RptUn}MtS)uw@J8-v#2!VQhd{aCpSDh zY@K)DR(Q$An|)QG5q5Xex{N}ov%}5wcx!Zstw+BjRQ;!KW32FF{y|&!>^rF1Zu}Ul zN!)d`-X(3tALe|M>4vi7>_T_xeR+$&e^9kR64Bdv^YwKvYJq2n?NIVfe$MKiSMGrt X$8|+LA)UKG^aN2@q@X!uP1b(_`3~~G literal 0 HcmV?d00001 diff --git a/common/src/main/java/common/block/artificial/BlockCompressedPowered.java b/common/src/main/java/common/block/artificial/BlockCompressedPowered.java deleted file mode 100755 index bd2af8db..00000000 --- a/common/src/main/java/common/block/artificial/BlockCompressedPowered.java +++ /dev/null @@ -1,33 +0,0 @@ -package common.block.artificial; - -import common.block.Block; -import common.block.Material; -import common.util.BlockPos; -import common.util.Facing; -import common.world.IWorldAccess; -import common.world.State; - -public class BlockCompressedPowered extends Block -{ - public BlockCompressedPowered(Material p_i46386_1_) - { - super(p_i46386_1_); - } - - /** - * Can this block provide power. Only wire currently seems to have this change based on its state. - */ - public boolean canProvidePower() - { - return true; - } - - public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) - { - return 15; - } - - public boolean isMagnetic() { - return true; - } -} diff --git a/common/src/main/java/common/block/artificial/BlockDoor.java b/common/src/main/java/common/block/artificial/BlockDoor.java index e1ef3fb7..19dd9732 100755 --- a/common/src/main/java/common/block/artificial/BlockDoor.java +++ b/common/src/main/java/common/block/artificial/BlockDoor.java @@ -9,6 +9,7 @@ import common.collect.Lists; import common.entity.npc.EntityNPC; import common.item.Item; import common.item.block.ItemDoor; +import common.item.tool.ItemKey; import common.model.BlockLayer; import common.model.Model; import common.model.ModelProvider; @@ -55,17 +56,25 @@ public class BlockDoor extends Block implements Rotatable { public static final PropertyBool OPEN = PropertyBool.create("open"); public static final PropertyEnum HINGE = PropertyEnum.create("hinge", EnumHingePosition.class); - public static final PropertyBool POWERED = PropertyBool.create("powered"); public static final PropertyEnum HALF = PropertyEnum.create("half", EnumDoorHalf.class); public static final List DOORS = Lists.newArrayList(); + + private ItemKey keyItem; public BlockDoor(Material material) { super(material); this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(OPEN, false) - .withProperty(HINGE, EnumHingePosition.LEFT).withProperty(POWERED, false) - .withProperty(HALF, EnumDoorHalf.LOWER)); + .withProperty(HINGE, EnumHingePosition.LEFT).withProperty(HALF, EnumDoorHalf.LOWER)); DOORS.add(this); } + + public void setKeyItem(ItemKey key) { + this.keyItem = key; + } + + public ItemKey getKeyItem() { + return this.keyItem; + } public boolean isOpaqueCube() { return false; @@ -146,7 +155,7 @@ public class BlockDoor extends Block implements Rotatable { } public boolean onBlockActivated(World world, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ) { - if(this.material == Material.SOLID) + if(this.keyItem != null && (player.getHeldItem() == null || player.getHeldItem().getItem() != this.keyItem)) return true; BlockPos lower = state.getValue(HALF) == EnumDoorHalf.LOWER ? pos : pos.down(); BlockPos upper = state.getValue(HALF) == EnumDoorHalf.UPPER ? pos : pos.up(); @@ -214,21 +223,6 @@ public class BlockDoor extends Block implements Rotatable { this.dropBlockAsItem(world, pos, state, 0); } } - else { - boolean power = world.isBlockPowered(pos) || world.isBlockPowered(upper); - - if((power || neighbor.canProvidePower()) && neighbor != this) { - world.setState(pos, state.withProperty(POWERED, power), 2); - world.setState(upper, top.withProperty(POWERED, power), 2); - - if((power != state.getValue(OPEN)) || (power != top.getValue(OPEN))) { - world.setState(pos, state.withProperty(OPEN, power), 2); - world.setState(upper, top.withProperty(OPEN, power), 2); - world.markBlockRangeForRenderUpdate(pos, upper); - world.playAuxSFX(power ? 1003 : 1006, pos, 0); - } - } - } } } @@ -262,7 +256,7 @@ public class BlockDoor extends Block implements Rotatable { } protected Property[] getProperties() { - return new Property[] {HALF, FACING, OPEN, HINGE, POWERED}; + return new Property[] {HALF, FACING, OPEN, HINGE}; } private static ModelRotation getRotation(Facing rot, int offset) { @@ -290,10 +284,6 @@ public class BlockDoor extends Block implements Rotatable { } } - public Property[] getIgnoredProperties() { - return new Property[] {POWERED}; - } - protected Item getItemToRegister() { return new ItemDoor(this); } diff --git a/common/src/main/java/common/block/artificial/BlockFenceGate.java b/common/src/main/java/common/block/artificial/BlockFenceGate.java index 9bea0794..ad5089c8 100755 --- a/common/src/main/java/common/block/artificial/BlockFenceGate.java +++ b/common/src/main/java/common/block/artificial/BlockFenceGate.java @@ -25,17 +25,16 @@ import common.world.World; public class BlockFenceGate extends Block implements Rotatable { public static final PropertyBool OPEN = PropertyBool.create("open"); - public static final PropertyBool POWERED = PropertyBool.create("powered"); public static final PropertyBool IN_WALL = PropertyBool.create("in_wall"); private final String texture; - public BlockFenceGate(WoodType p_i46394_1_) + public BlockFenceGate(WoodType type) { - super(Material.WOOD); // , p_i46394_1_.getMapColor()); - this.setDefaultState(this.getBaseState().withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false))); + super(Material.WOOD); + this.setDefaultState(this.getBaseState().withProperty(OPEN, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false))); this.setTab(CheatTab.WOOD); - this.texture = p_i46394_1_.getName() + "_planks"; + this.texture = type.getName() + "_planks"; } /** @@ -110,7 +109,7 @@ public class BlockFenceGate extends Block implements Rotatable */ public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) { - return this.getState().withProperty(FACING, placer.getHorizontalFacing()).withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false)); + return this.getState().withProperty(FACING, placer.getHorizontalFacing()).withProperty(OPEN, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false)); } public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) @@ -137,35 +136,6 @@ public class BlockFenceGate extends Block implements Rotatable return true; } - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (!worldIn.client) - { - boolean flag = worldIn.isBlockPowered(pos); - - if (flag || neighborBlock.canProvidePower()) - { - if (flag && !((Boolean)state.getValue(OPEN)).booleanValue() && !((Boolean)state.getValue(POWERED)).booleanValue()) - { - worldIn.setState(pos, state.withProperty(OPEN, Boolean.valueOf(true)).withProperty(POWERED, Boolean.valueOf(true)), 2); - worldIn.playAuxSFX(1003, pos, 0); - } - else if (!flag && ((Boolean)state.getValue(OPEN)).booleanValue() && ((Boolean)state.getValue(POWERED)).booleanValue()) - { - worldIn.setState(pos, state.withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)), 2); - worldIn.playAuxSFX(1006, pos, 0); - } - else if (flag != ((Boolean)state.getValue(POWERED)).booleanValue()) - { - worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(flag)), 2); - } - } - } - } - public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side) { return true; @@ -173,7 +143,7 @@ public class BlockFenceGate extends Block implements Rotatable protected Property[] getProperties() { - return new Property[] {FACING, OPEN, POWERED, IN_WALL}; + return new Property[] {FACING, OPEN, IN_WALL}; } public Transforms getTransform() { @@ -377,10 +347,6 @@ public class BlockFenceGate extends Block implements Rotatable .rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite())); } - public Property[] getIgnoredProperties() { - return new Property[] {POWERED}; - } - public Property[] getUnsavedProperties() { return new Property[] {IN_WALL}; } diff --git a/common/src/main/java/common/block/artificial/BlockMagnetic.java b/common/src/main/java/common/block/artificial/BlockMagnetic.java new file mode 100755 index 00000000..5971699c --- /dev/null +++ b/common/src/main/java/common/block/artificial/BlockMagnetic.java @@ -0,0 +1,16 @@ +package common.block.artificial; + +import common.block.Block; +import common.block.Material; + +public class BlockMagnetic extends Block +{ + public BlockMagnetic(Material material) + { + super(material); + } + + public boolean isMagnetic() { + return true; + } +} diff --git a/common/src/main/java/common/block/artificial/BlockTrapDoor.java b/common/src/main/java/common/block/artificial/BlockTrapDoor.java index 4261eab8..986a2314 100755 --- a/common/src/main/java/common/block/artificial/BlockTrapDoor.java +++ b/common/src/main/java/common/block/artificial/BlockTrapDoor.java @@ -5,8 +5,8 @@ import common.block.Rotatable; import common.block.Material; import common.entity.npc.EntityNPC; import common.entity.types.EntityLiving; -import common.init.Blocks; import common.item.CheatTab; +import common.item.tool.ItemKey; import common.model.BlockLayer; import common.model.Model; import common.model.ModelProvider; @@ -30,6 +30,8 @@ public class BlockTrapDoor extends Block implements Rotatable { public static final PropertyBool OPEN = PropertyBool.create("open"); public static final PropertyEnum HALF = PropertyEnum.create("half", BlockTrapDoor.DoorHalf.class); + + private ItemKey keyItem; public BlockTrapDoor(Material materialIn) { @@ -40,6 +42,14 @@ public class BlockTrapDoor extends Block implements Rotatable this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); this.setTab(materialIn == Material.WOOD ? CheatTab.WOOD : CheatTab.TECHNOLOGY); } + + public void setKeyItem(ItemKey key) { + this.keyItem = key; + } + + public ItemKey getKeyItem() { + return this.keyItem; + } /** * Used to determine ambient occlusion and culling when rebuilding chunks for render @@ -128,51 +138,14 @@ public class BlockTrapDoor extends Block implements Rotatable } } - public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) + public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ) { - if (this.material == Material.SOLID) - { - return true; - } - else - { - state = state.cycleProperty(OPEN); - worldIn.setState(pos, state, 2); - worldIn.playAuxSFX(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0); - return true; - } - } - - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (!worldIn.client) - { - BlockPos blockpos = pos.offset(((Facing)state.getValue(FACING)).getOpposite()); - - if (!isValidSupportBlock(worldIn.getState(blockpos).getBlock())) - { - worldIn.setBlockToAir(pos); - this.dropBlockAsItem(worldIn, pos, state, 0); - } - else - { - boolean flag = worldIn.isBlockPowered(pos); - - if (flag || neighborBlock.canProvidePower()) - { - boolean flag1 = ((Boolean)state.getValue(OPEN)).booleanValue(); - - if (flag1 != flag) - { - worldIn.setState(pos, state.withProperty(OPEN, Boolean.valueOf(flag)), 2); - worldIn.playAuxSFX(flag ? 1003 : 1006, pos, 0); - } - } - } - } + if(this.keyItem != null && (player.getHeldItem() == null || player.getHeldItem().getItem() != this.keyItem)) + return true; + state = state.cycleProperty(OPEN); + worldIn.setState(pos, state, 2); + worldIn.playAuxSFX(player, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0); + return true; } /** @@ -197,61 +170,14 @@ public class BlockTrapDoor extends Block implements Rotatable iblockstate = iblockstate.withProperty(FACING, facing).withProperty(OPEN, Boolean.valueOf(false)); iblockstate = iblockstate.withProperty(HALF, hitY > 0.5F ? BlockTrapDoor.DoorHalf.TOP : BlockTrapDoor.DoorHalf.BOTTOM); } + else { + iblockstate = iblockstate.withProperty(FACING, placer.getHorizontalFacing()).withProperty(OPEN, Boolean.valueOf(false)); + iblockstate = iblockstate.withProperty(HALF, facing == Facing.DOWN ? BlockTrapDoor.DoorHalf.TOP : BlockTrapDoor.DoorHalf.BOTTOM); + } return iblockstate; } - /** - * Check whether this Block can be placed on the given side - */ - public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, Facing side) - { - return !side.getAxis().isVertical() && isValidSupportBlock(worldIn.getState(pos.offset(side.getOpposite())).getBlock()); - } - - protected static Facing getFacing(int meta) - { - switch (meta & 3) - { - case 0: - return Facing.NORTH; - - case 1: - return Facing.SOUTH; - - case 2: - return Facing.WEST; - - case 3: - default: - return Facing.EAST; - } - } - - protected static int getMetaForFacing(Facing facing) - { - switch (facing) - { - case NORTH: - return 0; - - case SOUTH: - return 1; - - case WEST: - return 2; - - case EAST: - default: - return 3; - } - } - - private static boolean isValidSupportBlock(Block blockIn) - { - return blockIn.getMaterial().isOpaque() && blockIn.isFullCube() || blockIn == Blocks.glass || blockIn instanceof BlockStainedGlass || blockIn == Blocks.glowstone || blockIn instanceof BlockSlab || blockIn instanceof BlockStairs; - } - public BlockLayer getBlockLayer() { return BlockLayer.CUTOUT; diff --git a/common/src/main/java/common/block/natural/BlockRedstoneOre.java b/common/src/main/java/common/block/natural/BlockRedstoneOre.java deleted file mode 100755 index b40966a9..00000000 --- a/common/src/main/java/common/block/natural/BlockRedstoneOre.java +++ /dev/null @@ -1,200 +0,0 @@ -package common.block.natural; - -import common.block.Block; -import common.block.Material; -import common.entity.Entity; -import common.entity.npc.EntityNPC; -import common.init.Blocks; -import common.init.Items; -import common.item.Item; -import common.item.ItemStack; -import common.model.Model; -import common.model.ModelProvider; -import common.rng.Random; -import common.util.BlockPos; -import common.util.Facing; -import common.util.ParticleType; -import common.world.AWorldClient; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public class BlockRedstoneOre extends Block -{ - private final boolean isOn; - - public BlockRedstoneOre(boolean isOn) - { - super(Material.SOLID); - - if (isOn) - { - this.setTickRandomly(); - } - - this.isOn = isOn; - } - - /** - * How many world ticks before ticking - */ - public int tickRate(World worldIn, BlockPos pos) - { - return 30; - } - - public void onBlockClicked(World worldIn, BlockPos pos, EntityNPC playerIn) - { - this.activate(worldIn, pos); - super.onBlockClicked(worldIn, pos, playerIn); - } - - /** - * Triggered whenever an entity collides with this block (enters into the block) - */ - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) - { - this.activate(worldIn, pos); - super.onEntityCollidedWithBlock(worldIn, pos, entityIn); - } - - public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) - { - this.activate(worldIn, pos); - return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ); - } - - private void activate(World worldIn, BlockPos pos) - { - this.spawnParticles(worldIn, pos); - - if (this == Blocks.redstone_ore) - { - worldIn.setState(pos, Blocks.lit_redstone_ore.getState()); - } - } - - public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) - { - if (this == Blocks.lit_redstone_ore) - { - worldIn.setState(pos, Blocks.redstone_ore.getState()); - } - } - - /** - * Get the Item that this Block should drop when harvested. - */ - public Item getItemDropped(State state, Random rand, int fortune) - { - return Items.redstone; - } - - /** - * Get the quantity dropped based on the given fortune level - */ - public int quantityDroppedWithBonus(int fortune, Random random) - { - return this.quantityDropped(random) + random.zrange(fortune + 1); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - public int quantityDropped(Random random) - { - return random.range(4, 5); - } - - /** - * Spawns this Block's drops into the World as EntityItems. - */ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune) - { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); - - if (this.getItemDropped(state, worldIn.rand, fortune) != this.getItem()) - { - int i = worldIn.rand.roll(5); - this.dropXpOnBlockBreak(worldIn, pos, i); - } - } - - public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) - { - if (this.isOn) - { - this.spawnParticles(worldIn, pos); - } - } - - private void spawnParticles(World worldIn, BlockPos pos) - { - Random random = worldIn.rand; - double d0 = 0.0625D; - - for (int i = 0; i < 6; ++i) - { - double d1 = (double)((float)pos.getX() + random.floatv()); - double d2 = (double)((float)pos.getY() + random.floatv()); - double d3 = (double)((float)pos.getZ() + random.floatv()); - - if (i == 0 && !worldIn.getState(pos.up()).getBlock().isOpaqueCube()) - { - d2 = (double)pos.getY() + d0 + 1.0D; - } - - if (i == 1 && !worldIn.getState(pos.down()).getBlock().isOpaqueCube()) - { - d2 = (double)pos.getY() - d0; - } - - if (i == 2 && !worldIn.getState(pos.south()).getBlock().isOpaqueCube()) - { - d3 = (double)pos.getZ() + d0 + 1.0D; - } - - if (i == 3 && !worldIn.getState(pos.north()).getBlock().isOpaqueCube()) - { - d3 = (double)pos.getZ() - d0; - } - - if (i == 4 && !worldIn.getState(pos.east()).getBlock().isOpaqueCube()) - { - d1 = (double)pos.getX() + d0 + 1.0D; - } - - if (i == 5 && !worldIn.getState(pos.west()).getBlock().isOpaqueCube()) - { - d1 = (double)pos.getX() - d0; - } - - if (d1 < (double)pos.getX() || d1 > (double)(pos.getX() + 1) || d2 < 0.0D || d2 > (double)(pos.getY() + 1) || d3 < (double)pos.getZ() || d3 > (double)(pos.getZ() + 1)) - { - worldIn.spawnParticle(ParticleType.DUST, d1, d2, d3, 0xff0000); - } - } - } - - public ItemStack createStackedBlock(State state) - { - return new ItemStack(Items.redstone_ore); - } - - public boolean isXrayVisible() - { - return true; - } - - public boolean isMagnetic() { - return true; - } - - public Model getModel(ModelProvider provider, String name, State state) { - return provider.getModel("redstone_ore").add().all(); - } - - protected Item getItemToRegister() { - return this.isOn ? null : super.getItemToRegister(); - } -} diff --git a/common/src/main/java/common/block/tech/BlockBasePressurePlate.java b/common/src/main/java/common/block/tech/BlockBasePressurePlate.java index 21db25c1..3c899c39 100755 --- a/common/src/main/java/common/block/tech/BlockBasePressurePlate.java +++ b/common/src/main/java/common/block/tech/BlockBasePressurePlate.java @@ -36,7 +36,7 @@ public abstract class BlockBasePressurePlate extends Block protected void setBlockBoundsBasedOnState0(State state) { - boolean flag = this.getRedstoneStrength(state) > 0; + boolean flag = this.getSignalStrength(state) > 0; float f = 0.0625F; if (flag) @@ -121,7 +121,7 @@ public abstract class BlockBasePressurePlate extends Block { // if (!worldIn.client) // { - int i = this.getRedstoneStrength(state); + int i = this.getSignalStrength(state); if (i > 0) { @@ -137,7 +137,7 @@ public abstract class BlockBasePressurePlate extends Block { if (!worldIn.client) { - int i = this.getRedstoneStrength(state); + int i = this.getSignalStrength(state); if (i == 0) { @@ -149,15 +149,15 @@ public abstract class BlockBasePressurePlate extends Block /** * Updates the pressure plate when stepped on */ - protected void updateState(World worldIn, BlockPos pos, State state, int oldRedstoneStrength) + protected void updateState(World worldIn, BlockPos pos, State state, int oldSignal) { - int i = this.computeRedstoneStrength(worldIn, pos); - boolean flag = oldRedstoneStrength > 0; + int i = this.computeSignalStrength(worldIn, pos); + boolean flag = oldSignal > 0; boolean flag1 = i > 0; - if (oldRedstoneStrength != i) + if (oldSignal != i) { - state = this.setRedstoneStrength(state, i); + state = this.setSignalStrength(state, i); worldIn.setState(pos, state, 2); this.updateNeighbors(worldIn, pos); worldIn.markBlockRangeForRenderUpdate(pos, pos); @@ -189,7 +189,7 @@ public abstract class BlockBasePressurePlate extends Block public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { - if (this.getRedstoneStrength(state) > 0) + if (this.getSignalStrength(state) > 0) { this.updateNeighbors(worldIn, pos); } @@ -208,12 +208,12 @@ public abstract class BlockBasePressurePlate extends Block public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) { - return this.getRedstoneStrength(state); + return this.getSignalStrength(state); } public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) { - return side == Facing.UP ? this.getRedstoneStrength(state) : 0; + return side == Facing.UP ? this.getSignalStrength(state) : 0; } /** @@ -241,7 +241,7 @@ public abstract class BlockBasePressurePlate extends Block } public Model getModel(ModelProvider provider, String name, State state) { - if(this.getRedstoneStrength(state) > 0) + if(this.getSignalStrength(state) > 0) return provider.getModel(this.getTexture()) .add(1, 0, 1, 15, 0.5f, 15) .d().uv(1, 1, 15, 15) @@ -267,9 +267,9 @@ public abstract class BlockBasePressurePlate extends Block public abstract String getTexture(); - protected abstract int computeRedstoneStrength(World worldIn, BlockPos pos); + protected abstract int computeSignalStrength(World worldIn, BlockPos pos); - protected abstract int getRedstoneStrength(State state); + protected abstract int getSignalStrength(State state); - protected abstract State setRedstoneStrength(State state, int strength); + protected abstract State setSignalStrength(State state, int strength); } diff --git a/common/src/main/java/common/block/tech/BlockBrewingStand.java b/common/src/main/java/common/block/tech/BlockBrewingStand.java index 6279f44c..420dc33f 100755 --- a/common/src/main/java/common/block/tech/BlockBrewingStand.java +++ b/common/src/main/java/common/block/tech/BlockBrewingStand.java @@ -475,7 +475,7 @@ public class BlockBrewingStand extends BlockContainer public int getSignal(World worldIn, BlockPos pos, int input) { - return Container.calcRedstone(worldIn.getTileEntity(pos)); + return Container.calcSignal(worldIn.getTileEntity(pos)); } public BlockLayer getBlockLayer() diff --git a/common/src/main/java/common/block/tech/BlockCauldron.java b/common/src/main/java/common/block/tech/BlockCauldron.java index e412b33e..9d4b5669 100755 --- a/common/src/main/java/common/block/tech/BlockCauldron.java +++ b/common/src/main/java/common/block/tech/BlockCauldron.java @@ -553,7 +553,6 @@ public class BlockCauldron extends Block public void setWaterLevel(World worldIn, BlockPos pos, State state, int level) { worldIn.setState(pos, state.withProperty(LEVEL, Integer.valueOf(ExtMath.clampi(level, 0, 3))), 2); - worldIn.updateComparatorOutputLevel(pos, this); } /** diff --git a/common/src/main/java/common/block/tech/BlockChest.java b/common/src/main/java/common/block/tech/BlockChest.java index 7e235086..3c81620d 100755 --- a/common/src/main/java/common/block/tech/BlockChest.java +++ b/common/src/main/java/common/block/tech/BlockChest.java @@ -12,7 +12,6 @@ import common.entity.Entity; import common.entity.animal.EntityCat; import common.entity.npc.EntityNPC; import common.entity.types.EntityLiving; -import common.init.Items; import common.init.SoundEvent; import common.inventory.Container; import common.inventory.IInventory; @@ -21,6 +20,7 @@ import common.item.CheatTab; import common.item.Item; import common.item.ItemStack; import common.item.block.ItemChest; +import common.item.tool.ItemKey; import common.packet.SPacketSoundEffect; import common.properties.Property; import common.tileentity.TileEntity; @@ -157,7 +157,6 @@ public class BlockChest extends BlockContainer implements Rotatable if (tileentity instanceof IInventory) { InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity); - worldIn.updateComparatorOutputLevel(pos, this); } super.onBlockRemoved(worldIn, pos, state); @@ -176,7 +175,7 @@ public class BlockChest extends BlockContainer implements Rotatable if (chest != null) { ItemStack stack = Vars.locking ? playerIn.getHeldItem() : null; - if(stack != null && stack.getItem() == Items.key) { + if(stack != null && stack.getItem() instanceof ItemKey) { if(chest.getLockCode() != null) { if(stack.hasDisplayName() && stack.getDisplayName().equals(chest.getLockCode())) { chest.setLockCode(null); @@ -246,7 +245,7 @@ public class BlockChest extends BlockContainer implements Rotatable public int getSignal(World worldIn, BlockPos pos, int input) { - return Container.calcRedstoneFromInventory(this.getChest(worldIn, pos)); + return Container.calcSignalFrom(this.getChest(worldIn, pos)); } protected Property[] getProperties() diff --git a/common/src/main/java/common/block/tech/BlockDispenser.java b/common/src/main/java/common/block/tech/BlockDispenser.java index 70fdc063..2bd32c28 100755 --- a/common/src/main/java/common/block/tech/BlockDispenser.java +++ b/common/src/main/java/common/block/tech/BlockDispenser.java @@ -1,6 +1,5 @@ package common.block.tech; -import common.block.Block; import common.block.BlockContainer; import common.block.Directional; import common.block.Material; @@ -15,7 +14,6 @@ import common.model.Model; import common.model.ModelProvider; import common.model.ModelRotation; import common.properties.Property; -import common.properties.PropertyBool; import common.rng.Random; import common.tileentity.TileEntity; import common.tileentity.TileEntityDispenser; @@ -28,8 +26,6 @@ import common.world.AWorldServer; public class BlockDispenser extends BlockContainer implements Directional { - public static final PropertyBool TRIGGERED = PropertyBool.create("triggered"); - protected Random rand = new Random(); public static void dispense(World world, double speed, Facing facing, Vec3 position, ItemStack stack) @@ -45,7 +41,7 @@ public class BlockDispenser extends BlockContainer implements Directional public BlockDispenser() { super(Material.SOLID); - this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(TRIGGERED, Boolean.valueOf(false))); + this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH)); this.setTab(CheatTab.TECHNOLOGY); } @@ -94,7 +90,7 @@ public class BlockDispenser extends BlockContainer implements Directional } } - worldIn.setState(pos, state.withProperty(FACING, enumfacing).withProperty(TRIGGERED, Boolean.valueOf(false)), 2); + worldIn.setState(pos, state.withProperty(FACING, enumfacing), 2); } } @@ -126,67 +122,6 @@ public class BlockDispenser extends BlockContainer implements Directional } } - protected void dispense(World worldIn, BlockPos pos) - { - TileEntity te = worldIn.getTileEntity(pos); - - if (te instanceof TileEntityDispenser tileentitydispenser) - { - int i = tileentitydispenser.getDispenseSlot(); - - if (i < 0) - { - worldIn.playAuxSFX(1001, pos, 0); - } - else - { - ItemStack itemstack = tileentitydispenser.getStackInSlot(i); - if(itemstack != null) { - ItemStack itemstack1 = this.dispenseStack(itemstack, worldIn, pos); - tileentitydispenser.setInventorySlotContents(i, itemstack1.isEmpty() ? null : itemstack1); - } - } - } - } - - protected ItemStack dispenseStack(ItemStack stack, World world, BlockPos pos) - { - Facing facing = world.getState(pos).getValue(FACING); - ItemStack nstack = stack.getItem().dispenseStack(world, world.getTileEntity(pos), getDispensePosition(pos, facing), pos, facing, stack); - int id = stack.getItem().getDispenseSoundId(); - if(id != 0) - world.playAuxSFX(id, pos, 0); - world.playAuxSFX(2000, pos, facing.getFrontOffsetX() + 1 + (facing.getFrontOffsetZ() + 1) * 3); - return nstack; - } - - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(pos.up()); - boolean flag1 = ((Boolean)state.getValue(TRIGGERED)).booleanValue(); - - if (flag && !flag1) - { - worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); - worldIn.setState(pos, state.withProperty(TRIGGERED, Boolean.valueOf(true)), 4); - } - else if (!flag && flag1) - { - worldIn.setState(pos, state.withProperty(TRIGGERED, Boolean.valueOf(false)), 4); - } - } - - public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) - { -// if (!worldIn.client) -// { - this.dispense(worldIn, pos); -// } - } - /** * Returns a new instance of a block's tile entity class. Called on placing the block. */ @@ -201,7 +136,7 @@ public class BlockDispenser extends BlockContainer implements Directional */ public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) { - return this.getState().withProperty(FACING, BlockPistonBase.getFacingFromEntity(worldIn, pos, placer)).withProperty(TRIGGERED, Boolean.valueOf(false)); + return this.getState().withProperty(FACING, BlockPistonBase.getFacingFromEntity(worldIn, pos, placer)); } public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) @@ -211,7 +146,6 @@ public class BlockDispenser extends BlockContainer implements Directional if (tileentity instanceof TileEntityDispenser) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityDispenser)tileentity); - worldIn.updateComparatorOutputLevel(pos, this); } super.onBlockRemoved(worldIn, pos, state); @@ -225,11 +159,6 @@ public class BlockDispenser extends BlockContainer implements Directional return new Vec3(d0, d1, d2); } - public static Facing getFacing(int meta) - { - return Facing.getFront(meta & 7); - } - public boolean hasSignalProcessing() { return true; @@ -237,7 +166,7 @@ public class BlockDispenser extends BlockContainer implements Directional public int getSignal(World worldIn, BlockPos pos, int input) { - return Container.calcRedstone(worldIn.getTileEntity(pos)); + return Container.calcSignal(worldIn.getTileEntity(pos)); } /** @@ -258,7 +187,7 @@ public class BlockDispenser extends BlockContainer implements Directional protected Property[] getProperties() { - return new Property[] {FACING, TRIGGERED}; + return new Property[] {FACING}; } public boolean isMagnetic() { @@ -273,8 +202,4 @@ public class BlockDispenser extends BlockContainer implements Directional return provider.getModel(name + "_front_horizontal").add().du("furnace_top").n() .s("furnace_side").we("furnace_side").rotate(ModelRotation.getNorthRot(state.getValue(FACING))); } - - public Property[] getIgnoredProperties() { - return new Property[] {TRIGGERED}; - } } diff --git a/common/src/main/java/common/block/tech/BlockDropper.java b/common/src/main/java/common/block/tech/BlockDropper.java index a9aaefa3..d9b1fd28 100755 --- a/common/src/main/java/common/block/tech/BlockDropper.java +++ b/common/src/main/java/common/block/tech/BlockDropper.java @@ -1,88 +1,12 @@ package common.block.tech; -import common.inventory.IInventory; -import common.item.ItemStack; import common.tileentity.TileEntity; -import common.tileentity.TileEntityDispenser; import common.tileentity.TileEntityDropper; -import common.tileentity.TileEntityHopper; -import common.util.BlockPos; -import common.util.Facing; -import common.world.World; public class BlockDropper extends BlockDispenser { - protected ItemStack dispenseStack(ItemStack stack, World world, BlockPos pos) - { - Facing facing = world.getState(pos).getValue(FACING); - dispense(world, 6.0, facing, getDispensePosition(pos, facing), stack.split(1)); - world.playAuxSFX(1000, pos, 0); - world.playAuxSFX(2000, pos, facing.getFrontOffsetX() + 1 + (facing.getFrontOffsetZ() + 1) * 3); - return stack; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ public TileEntity createNewTileEntity() { return new TileEntityDropper(); } - - protected void dispense(World worldIn, BlockPos pos) - { - TileEntity te = worldIn.getTileEntity(pos); - - if (te instanceof TileEntityDispenser tileentitydispenser) - { - int i = tileentitydispenser.getDispenseSlot(); - - if (i < 0) - { - worldIn.playAuxSFX(1001, pos, 0); - } - else - { - ItemStack itemstack = tileentitydispenser.getStackInSlot(i); - - if (itemstack != null) - { - Facing enumfacing = (Facing)worldIn.getState(pos).getValue(FACING); - BlockPos blockpos = pos.offset(enumfacing); - IInventory iinventory = TileEntityHopper.getInventoryAtPosition(worldIn, (double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ()); - ItemStack itemstack1; - - if (iinventory == null) - { - itemstack1 = this.dispenseStack(itemstack, worldIn, pos); - - if (itemstack1 != null && itemstack1.isEmpty()) - { - itemstack1 = null; - } - } - else - { - itemstack1 = TileEntityHopper.putStackInInventoryAllSlots(iinventory, itemstack.copy().split(1), enumfacing.getOpposite()); - - if (itemstack1 == null) - { - itemstack1 = itemstack.copy(); - - if (itemstack1.decrSize()) - { - itemstack1 = null; - } - } - else - { - itemstack1 = itemstack.copy(); - } - } - - tileentitydispenser.setInventorySlotContents(i, itemstack1); - } - } - } - } } diff --git a/common/src/main/java/common/block/tech/BlockFurnace.java b/common/src/main/java/common/block/tech/BlockFurnace.java index 0ac3b057..c29761f0 100755 --- a/common/src/main/java/common/block/tech/BlockFurnace.java +++ b/common/src/main/java/common/block/tech/BlockFurnace.java @@ -190,7 +190,6 @@ public class BlockFurnace extends BlockContainer implements Rotatable if (tileentity instanceof TileEntityFurnace) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityFurnace)tileentity); - worldIn.updateComparatorOutputLevel(pos, this); } } @@ -204,7 +203,7 @@ public class BlockFurnace extends BlockContainer implements Rotatable public int getSignal(World worldIn, BlockPos pos, int input) { - return Container.calcRedstone(worldIn.getTileEntity(pos)); + return Container.calcSignal(worldIn.getTileEntity(pos)); } public Item getItem(World worldIn, BlockPos pos) diff --git a/common/src/main/java/common/block/tech/BlockHopper.java b/common/src/main/java/common/block/tech/BlockHopper.java index 10085c06..f0bbc18a 100755 --- a/common/src/main/java/common/block/tech/BlockHopper.java +++ b/common/src/main/java/common/block/tech/BlockHopper.java @@ -1,7 +1,6 @@ package common.block.tech; import java.util.List; -import common.block.Block; import common.block.BlockContainer; import common.block.DirectionalDown; import common.block.Material; @@ -18,7 +17,6 @@ import common.model.Model; import common.model.ModelProvider; import common.model.ModelRotation; import common.properties.Property; -import common.properties.PropertyBool; import common.tileentity.TileEntity; import common.tileentity.TileEntityHopper; import common.util.BlockPos; @@ -83,12 +81,10 @@ public class BlockHopper extends BlockContainer implements DirectionalDown .e().uv(6, 12, 10, 16).noCull() ; - public static final PropertyBool ENABLED = PropertyBool.create("enabled"); - public BlockHopper() { super(Material.SOLID); - this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.DOWN).withProperty(ENABLED, Boolean.valueOf(true))); + this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.DOWN)); this.setTab(CheatTab.TECHNOLOGY); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } @@ -130,7 +126,7 @@ public class BlockHopper extends BlockContainer implements DirectionalDown enumfacing = Facing.DOWN; } - return this.getState().withProperty(FACING, enumfacing).withProperty(ENABLED, Boolean.valueOf(true)); + return this.getState().withProperty(FACING, enumfacing); } /** @@ -141,11 +137,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown return new TileEntityHopper(); } - public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) - { - this.updateState(worldIn, pos, state); - } - public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) { if (worldIn.client) @@ -166,24 +157,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown } } - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - this.updateState(worldIn, pos, state); - } - - private void updateState(World worldIn, BlockPos pos, State state) - { - boolean flag = !worldIn.isBlockPowered(pos); - - if (flag != ((Boolean)state.getValue(ENABLED)).booleanValue()) - { - worldIn.setState(pos, state.withProperty(ENABLED, Boolean.valueOf(flag)), 4); - } - } - public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { TileEntity tileentity = worldIn.getTileEntity(pos); @@ -191,7 +164,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown if (tileentity instanceof TileEntityHopper) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityHopper)tileentity); - worldIn.updateComparatorOutputLevel(pos, this); } super.onBlockRemoved(worldIn, pos, state); @@ -223,20 +195,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown return true; } - public static Facing getFacing(int meta) - { - return Facing.getFront(meta & 7); - } - - /** - * Get's the hopper's active status from the 8-bit of the metadata. Note that the metadata stores whether the block - * is powered, so this returns true when that bit is 0. - */ - public static boolean isEnabled(int meta) - { - return (meta & 8) != 8; - } - public boolean hasSignalProcessing() { return true; @@ -244,7 +202,7 @@ public class BlockHopper extends BlockContainer implements DirectionalDown public int getSignal(World worldIn, BlockPos pos, int input) { - return Container.calcRedstone(worldIn.getTileEntity(pos)); + return Container.calcSignal(worldIn.getTileEntity(pos)); } public BlockLayer getBlockLayer() @@ -254,7 +212,7 @@ public class BlockHopper extends BlockContainer implements DirectionalDown protected Property[] getProperties() { - return new Property[] {FACING, ENABLED}; + return new Property[] {FACING}; } public boolean isMagnetic() { @@ -314,10 +272,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown .e().uv(0, 8, 4, 12).noCull() .rotate(ModelRotation.getNorthRot(state.getValue(FACING))); } - - public Property[] getIgnoredProperties() { - return new Property[] {ENABLED}; - } protected Item getItemToRegister() { return new ItemBlock(this, "hopper", true); diff --git a/common/src/main/java/common/block/tech/BlockLitTorch.java b/common/src/main/java/common/block/tech/BlockLitTorch.java new file mode 100755 index 00000000..7321e448 --- /dev/null +++ b/common/src/main/java/common/block/tech/BlockLitTorch.java @@ -0,0 +1,125 @@ +package common.block.tech; + +import common.entity.npc.EntityNPC; +import common.init.SoundEvent; +import common.item.CheatTab; +import common.item.Item; +import common.item.ItemStack; +import common.properties.Property; +import common.properties.PropertyInteger; +import common.rng.Random; +import common.util.BlockPos; +import common.util.Facing; +import common.util.ParticleType; +import common.vars.Vars; +import common.world.AWorldClient; +import common.world.State; +import common.world.World; +import common.world.AWorldServer; + +public class BlockLitTorch extends BlockTorch { + public static final PropertyInteger FUEL = PropertyInteger.create("fuel", 0, 7); + + private BlockUnlitTorch unlit; + + public BlockLitTorch(BlockUnlitTorch unlit) { + this.unlit = unlit; + unlit.setLitTorch(this); + this.setTab(CheatTab.TECHNOLOGY); + this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.UP).withProperty(FUEL, 7)); + this.setTickRandomly(); + } + + public void extinguish(AWorldServer worldIn, BlockPos pos, State state, Random rand) { + worldIn.setState(pos, this.unlit.getState().withProperty(FACING, state.getValue(FACING)), 3); + worldIn.playSound(SoundEvent.FIZZ, (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), + 0.5F); + for(int i = 0; i < 5; ++i) { + double d0 = (double)pos.getX() + rand.doublev() * 0.6D + 0.2D; + double d1 = (double)pos.getY() + rand.doublev() * 0.6D + 0.2D; + double d2 = (double)pos.getZ() + rand.doublev() * 0.6D + 0.2D; + worldIn.spawnParticles(ParticleType.SMOKE, d0, d1, d2); + } + } + + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { + if(Vars.torchBurnout > 0 && rand.chance(Vars.torchBurnout)) { + int fuel = state.getValue(FUEL); + if(fuel <= 0) { + this.extinguish(worldIn, pos, state, rand); + } + else { + worldIn.setState(pos, state.withProperty(FUEL, fuel - 1), 2); + } + } + } + + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { + if(this.unlit.getParticleColor() == 0xffffffff) { + Facing enumfacing = (Facing)state.getValue(FACING); + double d0 = (double)pos.getX() + 0.5D; + double d1 = (double)pos.getY() + 0.7D; + double d2 = (double)pos.getZ() + 0.5D; + double d3 = 0.22D; + double d4 = 0.27D; + + if (enumfacing.getAxis().isHorizontal()) + { + Facing enumfacing1 = enumfacing.getOpposite(); + worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ()); + worldIn.spawnParticle(ParticleType.FLAME, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ()); + } + else + { + worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2); + worldIn.spawnParticle(ParticleType.FLAME, d0, d1, d2); + } + } + else { + double d0 = (double)pos.getX() + 0.5D + (rand.doublev() - 0.5D) * 0.2D; + double d1 = (double)pos.getY() + 0.7D + (rand.doublev() - 0.5D) * 0.2D; + double d2 = (double)pos.getZ() + 0.5D + (rand.doublev() - 0.5D) * 0.2D; + Facing enumfacing = (Facing)state.getValue(FACING); + + if(enumfacing.getAxis().isHorizontal()) { + Facing enumfacing1 = enumfacing.getOpposite(); + double d3 = 0.27D; + d0 += 0.27D * (double)enumfacing1.getFrontOffsetX(); + d1 += 0.22D; + d2 += 0.27D * (double)enumfacing1.getFrontOffsetZ(); + } + + worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, this.unlit.getParticleColor()); + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) { + if(!worldIn.client) + this.extinguish((AWorldServer)worldIn, pos, state, worldIn.rand); + return true; + } + + protected Property[] getProperties() { + return new Property[] {FACING, FUEL}; + } + + public Property[] getIgnoredProperties() { + return new Property[] {FUEL}; + } + + protected Item getItemToRegister() { + return null; + } + + public Item getItemDropped(State state, Random rand, int fortune) { + return this.unlit.getItem(); + } + + public Item getItem(World worldIn, BlockPos pos) { + return this.unlit.getItem(); + } + + public ItemStack createStackedBlock(State state) { + return new ItemStack(this.unlit.getItem()); + } +} diff --git a/common/src/main/java/common/block/tech/BlockMachine.java b/common/src/main/java/common/block/tech/BlockMachine.java index 20745180..9941d92d 100755 --- a/common/src/main/java/common/block/tech/BlockMachine.java +++ b/common/src/main/java/common/block/tech/BlockMachine.java @@ -57,7 +57,6 @@ public abstract class BlockMachine extends Block implements Rotatable, ITileEnti TileEntity tileentity = worldIn.getTileEntity(pos); if(tileentity instanceof Device) { InventoryHelper.dropInventoryItems(worldIn, pos, (Device)tileentity); - worldIn.updateComparatorOutputLevel(pos, this); } super.onBlockRemoved(worldIn, pos, state); worldIn.removeTileEntity(pos); @@ -68,7 +67,7 @@ public abstract class BlockMachine extends Block implements Rotatable, ITileEnti } public int getSignal(World worldIn, BlockPos pos, int input) { - return Container.calcRedstone(worldIn.getTileEntity(pos)); + return Container.calcSignal(worldIn.getTileEntity(pos)); } public boolean onBlockEventReceived(World worldIn, BlockPos pos, State state, int eventID, int eventParam) { diff --git a/common/src/main/java/common/block/tech/BlockNuke.java b/common/src/main/java/common/block/tech/BlockNuke.java index eddf5497..6a3b7f12 100755 --- a/common/src/main/java/common/block/tech/BlockNuke.java +++ b/common/src/main/java/common/block/tech/BlockNuke.java @@ -15,7 +15,6 @@ import common.util.BlockPos; import common.world.Explosion; import common.world.State; import common.world.World; -import common.world.AWorldServer; public class BlockNuke extends Block { @@ -24,26 +23,6 @@ public class BlockNuke extends Block super(Material.EXPLOSIVE); this.setTab(CheatTab.TECHNOLOGY); } - - public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) - { - super.onBlockAdded(worldIn, pos, state); - - if (worldIn.isBlockPowered(pos)) - { - this.explode(worldIn, pos); - worldIn.setBlockToAir(pos); - } - } - - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (worldIn.isBlockPowered(pos)) - { - this.explode(worldIn, pos); - worldIn.setBlockToAir(pos); - } - } public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState) { diff --git a/common/src/main/java/common/block/tech/BlockPistonBase.java b/common/src/main/java/common/block/tech/BlockPistonBase.java index c8e40eb4..ccb2c08b 100755 --- a/common/src/main/java/common/block/tech/BlockPistonBase.java +++ b/common/src/main/java/common/block/tech/BlockPistonBase.java @@ -333,32 +333,32 @@ public class BlockPistonBase extends Block implements Directional private boolean shouldBeExtended(World worldIn, BlockPos pos, Facing facing) { - for (Facing enumfacing : Facing.values()) - { - if (enumfacing != facing && worldIn.isSidePowered(pos.offset(enumfacing), enumfacing)) - { - return true; - } - } +// for (Facing enumfacing : Facing.values()) +// { +// if (enumfacing != facing && worldIn.isSidePowered(pos.offset(enumfacing), enumfacing)) +// { +// return true; +// } +// } +// +// if (worldIn.isSidePowered(pos, Facing.DOWN)) +// { +// return true; +// } +// else +// { +// BlockPos blockpos = pos.up(); +// +// for (Facing enumfacing1 : Facing.values()) +// { +// if (enumfacing1 != Facing.DOWN && worldIn.isSidePowered(blockpos.offset(enumfacing1), enumfacing1)) +// { +// return true; +// } +// } - if (worldIn.isSidePowered(pos, Facing.DOWN)) - { - return true; - } - else - { - BlockPos blockpos = pos.up(); - - for (Facing enumfacing1 : Facing.values()) - { - if (enumfacing1 != Facing.DOWN && worldIn.isSidePowered(blockpos.offset(enumfacing1), enumfacing1)) - { - return true; - } - } - - return false; - } + return false; // TODO: piston control +// } } /** diff --git a/common/src/main/java/common/block/tech/BlockPressurePlate.java b/common/src/main/java/common/block/tech/BlockPressurePlate.java index 373077e0..c0b2f387 100755 --- a/common/src/main/java/common/block/tech/BlockPressurePlate.java +++ b/common/src/main/java/common/block/tech/BlockPressurePlate.java @@ -24,17 +24,17 @@ public class BlockPressurePlate extends BlockBasePressurePlate this.sensitivity = sensitivityIn; } - protected int getRedstoneStrength(State state) + protected int getSignalStrength(State state) { return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0; } - protected State setRedstoneStrength(State state, int strength) + protected State setSignalStrength(State state, int strength) { return state.withProperty(POWERED, Boolean.valueOf(strength > 0)); } - protected int computeRedstoneStrength(World worldIn, BlockPos pos) + protected int computeSignalStrength(World worldIn, BlockPos pos) { BoundingBox axisalignedbb = this.getSensitiveAABB(pos); List list; diff --git a/common/src/main/java/common/block/tech/BlockPressurePlateWeighted.java b/common/src/main/java/common/block/tech/BlockPressurePlateWeighted.java index 90009041..e5b0e10b 100755 --- a/common/src/main/java/common/block/tech/BlockPressurePlateWeighted.java +++ b/common/src/main/java/common/block/tech/BlockPressurePlateWeighted.java @@ -21,7 +21,7 @@ public class BlockPressurePlateWeighted extends BlockBasePressurePlate this.field_150068_a = p_i46380_2_; } - protected int computeRedstoneStrength(World worldIn, BlockPos pos) + protected int computeSignalStrength(World worldIn, BlockPos pos) { int i = Math.min(worldIn.getEntitiesWithinAABB(Entity.class, this.getSensitiveAABB(pos)).size(), this.field_150068_a); @@ -36,12 +36,12 @@ public class BlockPressurePlateWeighted extends BlockBasePressurePlate } } - protected int getRedstoneStrength(State state) + protected int getSignalStrength(State state) { return ((Integer)state.getValue(POWER)).intValue(); } - protected State setRedstoneStrength(State state, int strength) + protected State setSignalStrength(State state, int strength) { return state.withProperty(POWER, Integer.valueOf(strength)); } diff --git a/common/src/main/java/common/block/tech/BlockRail.java b/common/src/main/java/common/block/tech/BlockRail.java index b7d42d5b..097217fc 100755 --- a/common/src/main/java/common/block/tech/BlockRail.java +++ b/common/src/main/java/common/block/tech/BlockRail.java @@ -1,37 +1,710 @@ package common.block.tech; +import java.util.List; + import common.block.Block; +import common.block.Material; +import common.collect.Lists; +import common.init.Blocks; +import common.item.CheatTab; +import common.model.BlockLayer; +import common.model.Model; +import common.model.ModelProvider; +import common.model.ModelRotation; import common.properties.Property; import common.properties.PropertyEnum; import common.util.BlockPos; +import common.util.BoundingBox; +import common.util.DirectionVec; +import common.util.Facing; +import common.util.HitPosition; +import common.util.Identifyable; +import common.util.Vec3; +import common.world.IWorldAccess; import common.world.State; import common.world.World; +import common.world.AWorldServer; -public class BlockRail extends BlockRailBase +public class BlockRail extends Block { - public static final PropertyEnum SHAPE = PropertyEnum.create("shape", BlockRailBase.EnumRailDirection.class); + public static final PropertyEnum SHAPE = PropertyEnum.create("shape", BlockRail.EnumRailDirection.class); + + public static boolean isRailBlock(World worldIn, BlockPos pos) + { + return isRailBlock(worldIn.getState(pos)); + } + + public static boolean isRailBlock(State state) + { + Block block = state.getBlock(); + return block == Blocks.rail; + } public BlockRail() { - super(false); - this.setDefaultState(this.getBaseState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); + super(Material.SMALL); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setTab(CheatTab.TECHNOLOGY); + this.setFlatItemTexture(); + this.setDefaultState(this.getBaseState().withProperty(SHAPE, BlockRail.EnumRailDirection.NORTH_SOUTH)); + } + + public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state) + { + return null; + } + + /** + * Used to determine ambient occlusion and culling when rebuilding chunks for render + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. + */ + public HitPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.collisionRayTrace(worldIn, pos, start, end); + } + + public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos) + { + State iblockstate = worldIn.getState(pos); + BlockRail.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() == this ? (BlockRail.EnumRailDirection)iblockstate.getValue(SHAPE) : null; + + if (blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.isAscending()) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + } + + public boolean isFullCube() + { + return false; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return worldIn.isBlockSolid(pos.down()); + } + + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) + { + if (!worldIn.client) + { + this.applyState(worldIn, pos, state, true); + } + } + + /** + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) + { + if (!worldIn.client) + { + BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)state.getValue(SHAPE); + boolean flag = false; + + if (!worldIn.isBlockSolid(pos.down())) + { + flag = true; + } + + if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.ASCENDING_EAST && !worldIn.isBlockSolid(pos.east())) + { + flag = true; + } + else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.ASCENDING_WEST && !worldIn.isBlockSolid(pos.west())) + { + flag = true; + } + else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.ASCENDING_NORTH && !worldIn.isBlockSolid(pos.north())) + { + flag = true; + } + else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.ASCENDING_SOUTH && !worldIn.isBlockSolid(pos.south())) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + else + { + this.onNeighborChangedInternal(worldIn, pos, state, neighborBlock); + } + } + } + + protected State applyState(World worldIn, BlockPos pos, State state, boolean force) + { + return worldIn.client ? state : (new BlockRail.Rail(worldIn, pos, state)).setDirection(false /* TODO: switching */, force).getBlockState(); + } + + public int getMobilityFlag() + { + return 0; + } + + public BlockLayer getBlockLayer() + { + return BlockLayer.CUTOUT; + } + + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) + { + super.onBlockRemoved(worldIn, pos, state); + + if (((BlockRail.EnumRailDirection)state.getValue(SHAPE)).isAscending()) + { + worldIn.notifyNeighborsOfStateChange(pos.up(), this); + } + } + + public boolean isMagnetic() { + return true; + } + + public Model getModel(ModelProvider provider, String name, State state) { + EnumRailDirection dir = state.getValue(SHAPE); + switch(dir) { + case NORTH_SOUTH: + case EAST_WEST: + default: + return provider.getModel(name) + .add(0, 1, 0, 16, 1, 16) + .d().uv(0, 16, 16, 0).noCull() + .u().uv(0, 0, 16, 16).noCull() + .rotate(dir == EnumRailDirection.EAST_WEST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); + case NORTH_EAST: + case NORTH_WEST: + case SOUTH_EAST: + case SOUTH_WEST: + return provider.getModel(name + "_turned") + .add(0, 1, 0, 16, 1, 16) + .d().uv(0, 16, 16, 0).noCull() + .u().uv(0, 0, 16, 16).noCull() + .rotate(dir == EnumRailDirection.SOUTH_WEST ? ModelRotation.X0_Y90 : (dir == EnumRailDirection.NORTH_WEST ? + ModelRotation.X0_Y180 : (dir == EnumRailDirection.NORTH_EAST ? ModelRotation.X0_Y270 : ModelRotation.X0_Y0))); + case ASCENDING_NORTH: + case ASCENDING_EAST: + return provider.getModel(name) + .add(0, 9, 0, 16, 9, 16).rotate(8, 9, 8, Facing.Axis.X, 45, true) + .d().uv(0, 16, 16, 0).noCull() + .u().uv(0, 0, 16, 16).noCull() + .rotate(dir == EnumRailDirection.ASCENDING_EAST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); + case ASCENDING_SOUTH: + case ASCENDING_WEST: + return provider.getModel(name) + .add(0, 9, 0, 16, 9, 16).rotate(8, 9, 8, Facing.Axis.X, -45, true) + .d().uv(0, 16, 16, 0).noCull() + .u().uv(0, 0, 16, 16).noCull() + .rotate(dir == EnumRailDirection.ASCENDING_WEST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); + } } protected void onNeighborChangedInternal(World worldIn, BlockPos pos, State state, Block neighborBlock) { - if (neighborBlock.canProvidePower() && (new BlockRailBase.Rail(worldIn, pos, state)).countAdjacentRails() == 3) + if ((new BlockRail.Rail(worldIn, pos, state)).countAdjacentRails() == 3) { - this.func_176564_a(worldIn, pos, state, false); + this.applyState(worldIn, pos, state, false); } } - public Property getShapeProperty() - { - return SHAPE; - } - protected Property[] getProperties() { return new Property[] {SHAPE}; } + + private static enum BaseShape { + STRAIGHT, ASCENDING, TURNED; + } + + public static enum EnumRailDirection implements Identifyable, DirectionVec + { + NORTH_SOUTH("north_south", Facing.SOUTH, BaseShape.STRAIGHT), + EAST_WEST("east_west", Facing.EAST, BaseShape.STRAIGHT), + ASCENDING_EAST("ascending_east", Facing.EAST, BaseShape.ASCENDING), + ASCENDING_WEST("ascending_west", Facing.WEST, BaseShape.ASCENDING), + ASCENDING_NORTH("ascending_north", Facing.NORTH, BaseShape.ASCENDING), + ASCENDING_SOUTH("ascending_south", Facing.DOWN, BaseShape.ASCENDING), + SOUTH_EAST("south_east", Facing.EAST, BaseShape.TURNED), + SOUTH_WEST("south_west", Facing.SOUTH, BaseShape.TURNED), + NORTH_WEST("north_west", Facing.NORTH, BaseShape.TURNED), + NORTH_EAST("north_east", Facing.WEST, BaseShape.TURNED); + + private final String name; + private final Facing facing; + private final BaseShape shape; + + private EnumRailDirection(String name, Facing facing, BaseShape shape) + { + this.name = name; + this.facing = facing; + this.shape = shape; + } + + public String toString() + { + return this.name; + } + + public boolean isAscending() + { + return this == ASCENDING_NORTH || this == ASCENDING_EAST || this == ASCENDING_SOUTH || this == ASCENDING_WEST; + } + + public String getName() + { + return this.name; + } + + public Facing getFacing() + { + return this.facing; + } + + public Facing getVector() { + return this.facing; + } + + public boolean isAxis() { + return false; + } + + public boolean canApply(EnumRailDirection dir) { + return this.shape == dir.shape; + } + } + + public class Rail + { + private final World world; + private final BlockPos pos; + private final BlockRail block; + private State state; + private final List field_150657_g = Lists.newArrayList(); + + public Rail(World worldIn, BlockPos pos, State state) + { + this.world = worldIn; + this.pos = pos; + this.state = state; + this.block = (BlockRail)state.getBlock(); + BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)state.getValue(BlockRail.SHAPE); + this.func_180360_a(blockrailbase$enumraildirection); + } + + private void func_180360_a(BlockRail.EnumRailDirection p_180360_1_) + { + this.field_150657_g.clear(); + + switch (p_180360_1_) + { + case NORTH_SOUTH: + this.field_150657_g.add(this.pos.north()); + this.field_150657_g.add(this.pos.south()); + break; + + case EAST_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.east()); + break; + + case ASCENDING_EAST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.east().up()); + break; + + case ASCENDING_WEST: + this.field_150657_g.add(this.pos.west().up()); + this.field_150657_g.add(this.pos.east()); + break; + + case ASCENDING_NORTH: + this.field_150657_g.add(this.pos.north().up()); + this.field_150657_g.add(this.pos.south()); + break; + + case ASCENDING_SOUTH: + this.field_150657_g.add(this.pos.north()); + this.field_150657_g.add(this.pos.south().up()); + break; + + case SOUTH_EAST: + this.field_150657_g.add(this.pos.east()); + this.field_150657_g.add(this.pos.south()); + break; + + case SOUTH_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.south()); + break; + + case NORTH_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.north()); + break; + + case NORTH_EAST: + this.field_150657_g.add(this.pos.east()); + this.field_150657_g.add(this.pos.north()); + } + } + + private void func_150651_b() + { + for (int i = 0; i < this.field_150657_g.size(); ++i) + { + BlockRail.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i)); + + if (blockrailbase$rail != null && blockrailbase$rail.func_150653_a(this)) + { + this.field_150657_g.set(i, blockrailbase$rail.pos); + } + else + { + this.field_150657_g.remove(i--); + } + } + } + + private boolean hasRailAt(BlockPos pos) + { + return BlockRail.isRailBlock(this.world, pos) || BlockRail.isRailBlock(this.world, pos.up()) || BlockRail.isRailBlock(this.world, pos.down()); + } + + private BlockRail.Rail findRailAt(BlockPos pos) + { + State iblockstate = this.world.getState(pos); + + if (BlockRail.isRailBlock(iblockstate)) + { + return BlockRail.this.new Rail(this.world, pos, iblockstate); + } + else + { + BlockPos lvt_2_1_ = pos.up(); + iblockstate = this.world.getState(lvt_2_1_); + + if (BlockRail.isRailBlock(iblockstate)) + { + return BlockRail.this.new Rail(this.world, lvt_2_1_, iblockstate); + } + else + { + lvt_2_1_ = pos.down(); + iblockstate = this.world.getState(lvt_2_1_); + return BlockRail.isRailBlock(iblockstate) ? BlockRail.this.new Rail(this.world, lvt_2_1_, iblockstate) : null; + } + } + } + + private boolean func_150653_a(BlockRail.Rail p_150653_1_) + { + return this.func_180363_c(p_150653_1_.pos); + } + + private boolean func_180363_c(BlockPos p_180363_1_) + { + for (int i = 0; i < this.field_150657_g.size(); ++i) + { + BlockPos blockpos = (BlockPos)this.field_150657_g.get(i); + + if (blockpos.getX() == p_180363_1_.getX() && blockpos.getZ() == p_180363_1_.getZ()) + { + return true; + } + } + + return false; + } + + protected int countAdjacentRails() + { + int i = 0; + + for (Facing enumfacing : Facing.Plane.HORIZONTAL) + { + if (this.hasRailAt(this.pos.offset(enumfacing))) + { + ++i; + } + } + + return i; + } + + private boolean func_150649_b(BlockRail.Rail rail) + { + return this.func_150653_a(rail) || this.field_150657_g.size() != 2; + } + + private void func_150645_c(BlockRail.Rail p_150645_1_) + { + this.field_150657_g.add(p_150645_1_.pos); + BlockPos blockpos = this.pos.north(); + BlockPos blockpos1 = this.pos.south(); + BlockPos blockpos2 = this.pos.west(); + BlockPos blockpos3 = this.pos.east(); + boolean flag = this.func_180363_c(blockpos); + boolean flag1 = this.func_180363_c(blockpos1); + boolean flag2 = this.func_180363_c(blockpos2); + boolean flag3 = this.func_180363_c(blockpos3); + BlockRail.EnumRailDirection blockrailbase$enumraildirection = null; + + if (flag || flag1) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH; + } + + if (flag2 || flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.EAST_WEST; + } + + if (flag1 && flag3 && !flag && !flag2) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_EAST; + } + + if (flag1 && flag2 && !flag && !flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_WEST; + } + + if (flag && flag2 && !flag1 && !flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_WEST; + } + + if (flag && flag3 && !flag1 && !flag2) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_EAST; + } + + if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.NORTH_SOUTH) + { + if (BlockRail.isRailBlock(this.world, blockpos.up())) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_NORTH; + } + + if (BlockRail.isRailBlock(this.world, blockpos1.up())) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_SOUTH; + } + } + + if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.EAST_WEST) + { + if (BlockRail.isRailBlock(this.world, blockpos3.up())) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_EAST; + } + + if (BlockRail.isRailBlock(this.world, blockpos2.up())) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_WEST; + } + } + + if (blockrailbase$enumraildirection == null) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH; + } + + this.state = this.state.withProperty(BlockRail.SHAPE, blockrailbase$enumraildirection); + this.world.setState(this.pos, this.state, 3); + } + + private boolean func_180361_d(BlockPos p_180361_1_) + { + BlockRail.Rail blockrailbase$rail = this.findRailAt(p_180361_1_); + + if (blockrailbase$rail == null) + { + return false; + } + else + { + blockrailbase$rail.func_150651_b(); + return blockrailbase$rail.func_150649_b(this); + } + } + + public BlockRail.Rail setDirection(boolean switched, boolean force) + { + BlockPos blockpos = this.pos.north(); + BlockPos blockpos1 = this.pos.south(); + BlockPos blockpos2 = this.pos.west(); + BlockPos blockpos3 = this.pos.east(); + boolean flag = this.func_180361_d(blockpos); + boolean flag1 = this.func_180361_d(blockpos1); + boolean flag2 = this.func_180361_d(blockpos2); + boolean flag3 = this.func_180361_d(blockpos3); + BlockRail.EnumRailDirection blockrailbase$enumraildirection = null; + + if ((flag || flag1) && !flag2 && !flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH; + } + + if ((flag2 || flag3) && !flag && !flag1) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.EAST_WEST; + } + + if (flag1 && flag3 && !flag && !flag2) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_EAST; + } + + if (flag1 && flag2 && !flag && !flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_WEST; + } + + if (flag && flag2 && !flag1 && !flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_WEST; + } + + if (flag && flag3 && !flag1 && !flag2) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_EAST; + } + + if (blockrailbase$enumraildirection == null) + { + if (flag || flag1) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH; + } + + if (flag2 || flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.EAST_WEST; + } + + if (switched) + { + if (flag1 && flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_EAST; + } + + if (flag2 && flag1) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_WEST; + } + + if (flag3 && flag) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_EAST; + } + + if (flag && flag2) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_WEST; + } + } + else + { + if (flag && flag2) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_WEST; + } + + if (flag3 && flag) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_EAST; + } + + if (flag2 && flag1) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_WEST; + } + + if (flag1 && flag3) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_EAST; + } + } + } + + if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.NORTH_SOUTH) + { + if (BlockRail.isRailBlock(this.world, blockpos.up())) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_NORTH; + } + + if (BlockRail.isRailBlock(this.world, blockpos1.up())) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_SOUTH; + } + } + + if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.EAST_WEST) + { + if (BlockRail.isRailBlock(this.world, blockpos3.up())) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_EAST; + } + + if (BlockRail.isRailBlock(this.world, blockpos2.up())) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_WEST; + } + } + + if (blockrailbase$enumraildirection == null) + { + blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH; + } + + this.func_180360_a(blockrailbase$enumraildirection); + this.state = this.state.withProperty(BlockRail.SHAPE, blockrailbase$enumraildirection); + + if (force || this.world.getState(this.pos) != this.state) + { + this.world.setState(this.pos, this.state, 3); + + for (int i = 0; i < this.field_150657_g.size(); ++i) + { + BlockRail.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i)); + + if (blockrailbase$rail != null) + { + blockrailbase$rail.func_150651_b(); + + if (blockrailbase$rail.func_150649_b(this)) + { + blockrailbase$rail.func_150645_c(this); + } + } + } + } + + return this; + } + + public State getBlockState() + { + return this.state; + } + } } diff --git a/common/src/main/java/common/block/tech/BlockRailBase.java b/common/src/main/java/common/block/tech/BlockRailBase.java deleted file mode 100755 index 13a7c16a..00000000 --- a/common/src/main/java/common/block/tech/BlockRailBase.java +++ /dev/null @@ -1,724 +0,0 @@ -package common.block.tech; - -import java.util.List; - -import common.block.Block; -import common.block.Material; -import common.collect.Lists; -import common.init.Blocks; -import common.item.CheatTab; -import common.model.BlockLayer; -import common.model.Model; -import common.model.ModelProvider; -import common.model.ModelRotation; -import common.properties.Property; -import common.util.BlockPos; -import common.util.BoundingBox; -import common.util.DirectionVec; -import common.util.Facing; -import common.util.HitPosition; -import common.util.Identifyable; -import common.util.Vec3; -import common.world.IWorldAccess; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public abstract class BlockRailBase extends Block -{ - protected final boolean isPowered; - - public static boolean isRailBlock(World worldIn, BlockPos pos) - { - return isRailBlock(worldIn.getState(pos)); - } - - public static boolean isRailBlock(State state) - { - Block block = state.getBlock(); - return block == Blocks.rail || block == Blocks.golden_rail || block == Blocks.detector_rail || block == Blocks.activator_rail; - } - - public BlockRailBase(boolean isPowered) - { - super(Material.SMALL); - this.isPowered = isPowered; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - this.setTab(CheatTab.TECHNOLOGY); - this.setFlatItemTexture(); - } - - public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state) - { - return null; - } - - /** - * Used to determine ambient occlusion and culling when rebuilding chunks for render - */ - public boolean isOpaqueCube() - { - return false; - } - - /** - * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. - */ - public HitPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) - { - this.setBlockBoundsBasedOnState(worldIn, pos); - return super.collisionRayTrace(worldIn, pos, start, end); - } - - public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos) - { - State iblockstate = worldIn.getState(pos); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() == this ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(this.getShapeProperty()) : null; - - if (blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.isAscending()) - { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); - } - else - { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - } - } - - public boolean isFullCube() - { - return false; - } - - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) - { - return worldIn.isBlockSolid(pos.down()); - } - - public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) - { - if (!worldIn.client) - { - state = this.func_176564_a(worldIn, pos, state, true); - - if (this.isPowered) - { - this.onNeighborBlockChange(worldIn, pos, state, this); - } - } - } - - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (!worldIn.client) - { - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty()); - boolean flag = false; - - if (!worldIn.isBlockSolid(pos.down())) - { - flag = true; - } - - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !worldIn.isBlockSolid(pos.east())) - { - flag = true; - } - else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !worldIn.isBlockSolid(pos.west())) - { - flag = true; - } - else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !worldIn.isBlockSolid(pos.north())) - { - flag = true; - } - else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !worldIn.isBlockSolid(pos.south())) - { - flag = true; - } - - if (flag) - { - this.dropBlockAsItem(worldIn, pos, state, 0); - worldIn.setBlockToAir(pos); - } - else - { - this.onNeighborChangedInternal(worldIn, pos, state, neighborBlock); - } - } - } - - protected void onNeighborChangedInternal(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - } - - protected State func_176564_a(World worldIn, BlockPos p_176564_2_, State p_176564_3_, boolean p_176564_4_) - { - return worldIn.client ? p_176564_3_ : (new BlockRailBase.Rail(worldIn, p_176564_2_, p_176564_3_)).func_180364_a(worldIn.isBlockPowered(p_176564_2_), p_176564_4_).getBlockState(); - } - - public int getMobilityFlag() - { - return 0; - } - - public BlockLayer getBlockLayer() - { - return BlockLayer.CUTOUT; - } - - public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) - { - super.onBlockRemoved(worldIn, pos, state); - - if (((BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty())).isAscending()) - { - worldIn.notifyNeighborsOfStateChange(pos.up(), this); - } - - if (this.isPowered) - { - worldIn.notifyNeighborsOfStateChange(pos, this); - worldIn.notifyNeighborsOfStateChange(pos.down(), this); - } - } - - public boolean isMagnetic() { - return true; - } - - public Model getModel(ModelProvider provider, String name, State state) { - EnumRailDirection dir = state.getValue(this.getShapeProperty()); - switch(dir) { - case NORTH_SOUTH: - case EAST_WEST: - default: - return provider.getModel(name) - .add(0, 1, 0, 16, 1, 16) - .d().uv(0, 16, 16, 0).noCull() - .u().uv(0, 0, 16, 16).noCull() - .rotate(dir == EnumRailDirection.EAST_WEST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); - case NORTH_EAST: - case NORTH_WEST: - case SOUTH_EAST: - case SOUTH_WEST: - return provider.getModel(name + "_turned") - .add(0, 1, 0, 16, 1, 16) - .d().uv(0, 16, 16, 0).noCull() - .u().uv(0, 0, 16, 16).noCull() - .rotate(dir == EnumRailDirection.SOUTH_WEST ? ModelRotation.X0_Y90 : (dir == EnumRailDirection.NORTH_WEST ? - ModelRotation.X0_Y180 : (dir == EnumRailDirection.NORTH_EAST ? ModelRotation.X0_Y270 : ModelRotation.X0_Y0))); - case ASCENDING_NORTH: - case ASCENDING_EAST: - return provider.getModel(name) - .add(0, 9, 0, 16, 9, 16).rotate(8, 9, 8, Facing.Axis.X, 45, true) - .d().uv(0, 16, 16, 0).noCull() - .u().uv(0, 0, 16, 16).noCull() - .rotate(dir == EnumRailDirection.ASCENDING_EAST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); - case ASCENDING_SOUTH: - case ASCENDING_WEST: - return provider.getModel(name) - .add(0, 9, 0, 16, 9, 16).rotate(8, 9, 8, Facing.Axis.X, -45, true) - .d().uv(0, 16, 16, 0).noCull() - .u().uv(0, 0, 16, 16).noCull() - .rotate(dir == EnumRailDirection.ASCENDING_WEST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); - } - } - - public abstract Property getShapeProperty(); - - private static enum BaseShape { - STRAIGHT, ASCENDING, TURNED; - } - - public static enum EnumRailDirection implements Identifyable, DirectionVec - { - NORTH_SOUTH("north_south", Facing.SOUTH, BaseShape.STRAIGHT), - EAST_WEST("east_west", Facing.EAST, BaseShape.STRAIGHT), - ASCENDING_EAST("ascending_east", Facing.EAST, BaseShape.ASCENDING), - ASCENDING_WEST("ascending_west", Facing.WEST, BaseShape.ASCENDING), - ASCENDING_NORTH("ascending_north", Facing.NORTH, BaseShape.ASCENDING), - ASCENDING_SOUTH("ascending_south", Facing.DOWN, BaseShape.ASCENDING), - SOUTH_EAST("south_east", Facing.EAST, BaseShape.TURNED), - SOUTH_WEST("south_west", Facing.SOUTH, BaseShape.TURNED), - NORTH_WEST("north_west", Facing.NORTH, BaseShape.TURNED), - NORTH_EAST("north_east", Facing.WEST, BaseShape.TURNED); - - private final String name; - private final Facing facing; - private final BaseShape shape; - - private EnumRailDirection(String name, Facing facing, BaseShape shape) - { - this.name = name; - this.facing = facing; - this.shape = shape; - } - - public String toString() - { - return this.name; - } - - public boolean isAscending() - { - return this == ASCENDING_NORTH || this == ASCENDING_EAST || this == ASCENDING_SOUTH || this == ASCENDING_WEST; - } - - public String getName() - { - return this.name; - } - - public Facing getFacing() - { - return this.facing; - } - - public Facing getVector() { - return this.facing; - } - - public boolean isAxis() { - return false; - } - - public boolean canApply(EnumRailDirection dir) { - return this.shape == dir.shape; - } - } - - public class Rail - { - private final World world; - private final BlockPos pos; - private final BlockRailBase block; - private State state; - private final boolean isPowered; - private final List field_150657_g = Lists.newArrayList(); - - public Rail(World worldIn, BlockPos pos, State state) - { - this.world = worldIn; - this.pos = pos; - this.state = state; - this.block = (BlockRailBase)state.getBlock(); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(BlockRailBase.this.getShapeProperty()); - this.isPowered = this.block.isPowered; - this.func_180360_a(blockrailbase$enumraildirection); - } - - private void func_180360_a(BlockRailBase.EnumRailDirection p_180360_1_) - { - this.field_150657_g.clear(); - - switch (p_180360_1_) - { - case NORTH_SOUTH: - this.field_150657_g.add(this.pos.north()); - this.field_150657_g.add(this.pos.south()); - break; - - case EAST_WEST: - this.field_150657_g.add(this.pos.west()); - this.field_150657_g.add(this.pos.east()); - break; - - case ASCENDING_EAST: - this.field_150657_g.add(this.pos.west()); - this.field_150657_g.add(this.pos.east().up()); - break; - - case ASCENDING_WEST: - this.field_150657_g.add(this.pos.west().up()); - this.field_150657_g.add(this.pos.east()); - break; - - case ASCENDING_NORTH: - this.field_150657_g.add(this.pos.north().up()); - this.field_150657_g.add(this.pos.south()); - break; - - case ASCENDING_SOUTH: - this.field_150657_g.add(this.pos.north()); - this.field_150657_g.add(this.pos.south().up()); - break; - - case SOUTH_EAST: - this.field_150657_g.add(this.pos.east()); - this.field_150657_g.add(this.pos.south()); - break; - - case SOUTH_WEST: - this.field_150657_g.add(this.pos.west()); - this.field_150657_g.add(this.pos.south()); - break; - - case NORTH_WEST: - this.field_150657_g.add(this.pos.west()); - this.field_150657_g.add(this.pos.north()); - break; - - case NORTH_EAST: - this.field_150657_g.add(this.pos.east()); - this.field_150657_g.add(this.pos.north()); - } - } - - private void func_150651_b() - { - for (int i = 0; i < this.field_150657_g.size(); ++i) - { - BlockRailBase.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i)); - - if (blockrailbase$rail != null && blockrailbase$rail.func_150653_a(this)) - { - this.field_150657_g.set(i, blockrailbase$rail.pos); - } - else - { - this.field_150657_g.remove(i--); - } - } - } - - private boolean hasRailAt(BlockPos pos) - { - return BlockRailBase.isRailBlock(this.world, pos) || BlockRailBase.isRailBlock(this.world, pos.up()) || BlockRailBase.isRailBlock(this.world, pos.down()); - } - - private BlockRailBase.Rail findRailAt(BlockPos pos) - { - State iblockstate = this.world.getState(pos); - - if (BlockRailBase.isRailBlock(iblockstate)) - { - return BlockRailBase.this.new Rail(this.world, pos, iblockstate); - } - else - { - BlockPos lvt_2_1_ = pos.up(); - iblockstate = this.world.getState(lvt_2_1_); - - if (BlockRailBase.isRailBlock(iblockstate)) - { - return BlockRailBase.this.new Rail(this.world, lvt_2_1_, iblockstate); - } - else - { - lvt_2_1_ = pos.down(); - iblockstate = this.world.getState(lvt_2_1_); - return BlockRailBase.isRailBlock(iblockstate) ? BlockRailBase.this.new Rail(this.world, lvt_2_1_, iblockstate) : null; - } - } - } - - private boolean func_150653_a(BlockRailBase.Rail p_150653_1_) - { - return this.func_180363_c(p_150653_1_.pos); - } - - private boolean func_180363_c(BlockPos p_180363_1_) - { - for (int i = 0; i < this.field_150657_g.size(); ++i) - { - BlockPos blockpos = (BlockPos)this.field_150657_g.get(i); - - if (blockpos.getX() == p_180363_1_.getX() && blockpos.getZ() == p_180363_1_.getZ()) - { - return true; - } - } - - return false; - } - - protected int countAdjacentRails() - { - int i = 0; - - for (Facing enumfacing : Facing.Plane.HORIZONTAL) - { - if (this.hasRailAt(this.pos.offset(enumfacing))) - { - ++i; - } - } - - return i; - } - - private boolean func_150649_b(BlockRailBase.Rail rail) - { - return this.func_150653_a(rail) || this.field_150657_g.size() != 2; - } - - private void func_150645_c(BlockRailBase.Rail p_150645_1_) - { - this.field_150657_g.add(p_150645_1_.pos); - BlockPos blockpos = this.pos.north(); - BlockPos blockpos1 = this.pos.south(); - BlockPos blockpos2 = this.pos.west(); - BlockPos blockpos3 = this.pos.east(); - boolean flag = this.func_180363_c(blockpos); - boolean flag1 = this.func_180363_c(blockpos1); - boolean flag2 = this.func_180363_c(blockpos2); - boolean flag3 = this.func_180363_c(blockpos3); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null; - - if (flag || flag1) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; - } - - if (flag2 || flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; - } - - if (!this.isPowered) - { - if (flag1 && flag3 && !flag && !flag2) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; - } - - if (flag1 && flag2 && !flag && !flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; - } - - if (flag && flag2 && !flag1 && !flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; - } - - if (flag && flag3 && !flag1 && !flag2) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; - } - } - - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) - { - if (BlockRailBase.isRailBlock(this.world, blockpos.up())) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH; - } - - if (BlockRailBase.isRailBlock(this.world, blockpos1.up())) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH; - } - } - - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) - { - if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST; - } - - if (BlockRailBase.isRailBlock(this.world, blockpos2.up())) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST; - } - } - - if (blockrailbase$enumraildirection == null) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; - } - - this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection); - this.world.setState(this.pos, this.state, 3); - } - - private boolean func_180361_d(BlockPos p_180361_1_) - { - BlockRailBase.Rail blockrailbase$rail = this.findRailAt(p_180361_1_); - - if (blockrailbase$rail == null) - { - return false; - } - else - { - blockrailbase$rail.func_150651_b(); - return blockrailbase$rail.func_150649_b(this); - } - } - - public BlockRailBase.Rail func_180364_a(boolean p_180364_1_, boolean p_180364_2_) - { - BlockPos blockpos = this.pos.north(); - BlockPos blockpos1 = this.pos.south(); - BlockPos blockpos2 = this.pos.west(); - BlockPos blockpos3 = this.pos.east(); - boolean flag = this.func_180361_d(blockpos); - boolean flag1 = this.func_180361_d(blockpos1); - boolean flag2 = this.func_180361_d(blockpos2); - boolean flag3 = this.func_180361_d(blockpos3); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null; - - if ((flag || flag1) && !flag2 && !flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; - } - - if ((flag2 || flag3) && !flag && !flag1) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; - } - - if (!this.isPowered) - { - if (flag1 && flag3 && !flag && !flag2) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; - } - - if (flag1 && flag2 && !flag && !flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; - } - - if (flag && flag2 && !flag1 && !flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; - } - - if (flag && flag3 && !flag1 && !flag2) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; - } - } - - if (blockrailbase$enumraildirection == null) - { - if (flag || flag1) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; - } - - if (flag2 || flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; - } - - if (!this.isPowered) - { - if (p_180364_1_) - { - if (flag1 && flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; - } - - if (flag2 && flag1) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; - } - - if (flag3 && flag) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; - } - - if (flag && flag2) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; - } - } - else - { - if (flag && flag2) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; - } - - if (flag3 && flag) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; - } - - if (flag2 && flag1) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; - } - - if (flag1 && flag3) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; - } - } - } - } - - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) - { - if (BlockRailBase.isRailBlock(this.world, blockpos.up())) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH; - } - - if (BlockRailBase.isRailBlock(this.world, blockpos1.up())) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH; - } - } - - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) - { - if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST; - } - - if (BlockRailBase.isRailBlock(this.world, blockpos2.up())) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST; - } - } - - if (blockrailbase$enumraildirection == null) - { - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; - } - - this.func_180360_a(blockrailbase$enumraildirection); - this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection); - - if (p_180364_2_ || this.world.getState(this.pos) != this.state) - { - this.world.setState(this.pos, this.state, 3); - - for (int i = 0; i < this.field_150657_g.size(); ++i) - { - BlockRailBase.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i)); - - if (blockrailbase$rail != null) - { - blockrailbase$rail.func_150651_b(); - - if (blockrailbase$rail.func_150649_b(this)) - { - blockrailbase$rail.func_150645_c(this); - } - } - } - } - - return this; - } - - public State getBlockState() - { - return this.state; - } - } -} diff --git a/common/src/main/java/common/block/tech/BlockRailDetector.java b/common/src/main/java/common/block/tech/BlockRailDetector.java deleted file mode 100755 index 1c08f12b..00000000 --- a/common/src/main/java/common/block/tech/BlockRailDetector.java +++ /dev/null @@ -1,187 +0,0 @@ -package common.block.tech; - -import java.util.List; -import java.util.function.Predicate; - -import common.entity.Entity; -import common.entity.item.EntityCart; -import common.inventory.Container; -import common.inventory.IInventory; -import common.model.Model; -import common.model.ModelProvider; -import common.properties.Property; -import common.properties.PropertyBool; -import common.properties.PropertyEnum; -import common.rng.Random; -import common.util.BlockPos; -import common.util.BoundingBox; -import common.util.Facing; -import common.world.IWorldAccess; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public class BlockRailDetector extends BlockRailBase -{ - public static final PropertyEnum SHAPE = PropertyEnum.create("shape", EnumRailDirection.class, EnumRailDirection.NORTH_SOUTH, EnumRailDirection.EAST_WEST, EnumRailDirection.ASCENDING_EAST, EnumRailDirection.ASCENDING_WEST, EnumRailDirection.ASCENDING_NORTH, EnumRailDirection.ASCENDING_SOUTH); - public static final PropertyBool POWERED = PropertyBool.create("powered"); - - public BlockRailDetector() - { - super(true); - this.setDefaultState(this.getBaseState().withProperty(POWERED, Boolean.valueOf(false)).withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); - } - - /** - * How many world ticks before ticking - */ - public int tickRate(World worldIn, BlockPos pos) - { - return 20; - } - - /** - * Can this block provide power. Only wire currently seems to have this change based on its state. - */ - public boolean canProvidePower() - { - return true; - } - - /** - * Called When an Entity Collided with the Block - */ - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn) - { - if (!worldIn.client) - { - if (!((Boolean)state.getValue(POWERED)).booleanValue()) - { - this.updatePoweredState(worldIn, pos, state); - } - } - } - - /** - * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) - */ - public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) - { - } - - public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) - { - if (/* !worldIn.client && */ ((Boolean)state.getValue(POWERED)).booleanValue()) - { - this.updatePoweredState(worldIn, pos, state); - } - } - - public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) - { - return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0; - } - - public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) - { - return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (side == Facing.UP ? 15 : 0); - } - - private void updatePoweredState(World worldIn, BlockPos pos, State state) - { - boolean flag = ((Boolean)state.getValue(POWERED)).booleanValue(); - boolean flag1 = false; - List list = this.findMinecarts(worldIn, pos, EntityCart.class, null); - - if (!list.isEmpty()) - { - flag1 = true; - } - - if (flag1 && !flag) - { - worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3); - worldIn.notifyNeighborsOfStateChange(pos, this); - worldIn.notifyNeighborsOfStateChange(pos.down(), this); - worldIn.markBlockRangeForRenderUpdate(pos, pos); - } - - if (!flag1 && flag) - { - worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 3); - worldIn.notifyNeighborsOfStateChange(pos, this); - worldIn.notifyNeighborsOfStateChange(pos.down(), this); - worldIn.markBlockRangeForRenderUpdate(pos, pos); - } - - if (flag1) - { - worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); - } - - worldIn.updateComparatorOutputLevel(pos, this); - } - - public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) - { - super.onBlockAdded(worldIn, pos, state); - this.updatePoweredState(worldIn, pos, state); - } - - public Property getShapeProperty() - { - return SHAPE; - } - - public boolean hasSignalProcessing() - { - return true; - } - - public int getSignal(World worldIn, BlockPos pos, int input) - { - if (((Boolean)worldIn.getState(pos).getValue(POWERED)).booleanValue()) - { -// List list = this.findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, null); -// -// if (!list.isEmpty()) -// { -// return ((EntityMinecartCommandBlock)list.get(0)).isPowered() ? 15 : 0; -// } - - List list1 = this.findMinecarts(worldIn, pos, EntityCart.class, new Predicate() { - public boolean test(EntityCart entity) { - return entity instanceof IInventory && entity.isEntityAlive(); - } - }); - - if (!list1.isEmpty()) - { - return Container.calcRedstoneFromInventory((IInventory)list1.get(0)); - } - } - - return 0; - } - - protected List findMinecarts(World worldIn, BlockPos pos, Class clazz, Predicate filter) - { - BoundingBox axisalignedbb = this.getDectectionBox(pos); - return filter == null ? worldIn.getEntitiesWithinAABB(clazz, axisalignedbb) : worldIn.getEntitiesWithinAABB(clazz, axisalignedbb, filter); - } - - private BoundingBox getDectectionBox(BlockPos pos) - { - float f = 0.2F; - return new BoundingBox((double)((float)pos.getX() + 0.2F), (double)pos.getY(), (double)((float)pos.getZ() + 0.2F), (double)((float)(pos.getX() + 1) - 0.2F), (double)((float)(pos.getY() + 1) - 0.2F), (double)((float)(pos.getZ() + 1) - 0.2F)); - } - - protected Property[] getProperties() - { - return new Property[] {SHAPE, POWERED}; - } - - public Model getModel(ModelProvider provider, String name, State state) { - return super.getModel(provider, name + (state.getValue(POWERED) ? "_powered" : ""), state); - } -} diff --git a/common/src/main/java/common/block/tech/BlockRailPowered.java b/common/src/main/java/common/block/tech/BlockRailPowered.java deleted file mode 100755 index f8cc7adc..00000000 --- a/common/src/main/java/common/block/tech/BlockRailPowered.java +++ /dev/null @@ -1,174 +0,0 @@ -package common.block.tech; - -import common.block.Block; -import common.model.Model; -import common.model.ModelProvider; -import common.properties.Property; -import common.properties.PropertyBool; -import common.properties.PropertyEnum; -import common.util.BlockPos; -import common.world.State; -import common.world.World; - -public class BlockRailPowered extends BlockRailBase -{ - public static final PropertyEnum SHAPE = PropertyEnum.create("shape", EnumRailDirection.class, EnumRailDirection.NORTH_SOUTH, EnumRailDirection.EAST_WEST, EnumRailDirection.ASCENDING_EAST, EnumRailDirection.ASCENDING_WEST, EnumRailDirection.ASCENDING_NORTH, EnumRailDirection.ASCENDING_SOUTH); - public static final PropertyBool POWERED = PropertyBool.create("powered"); - - public BlockRailPowered() - { - super(true); - this.setDefaultState(this.getBaseState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH).withProperty(POWERED, Boolean.valueOf(false))); - } - - - protected boolean func_176566_a(World worldIn, BlockPos pos, State state, boolean p_176566_4_, int p_176566_5_) - { - if (p_176566_5_ >= 8) - { - return false; - } - else - { - int i = pos.getX(); - int j = pos.getY(); - int k = pos.getZ(); - boolean flag = true; - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(SHAPE); - - switch (blockrailbase$enumraildirection) - { - case NORTH_SOUTH: - if (p_176566_4_) - { - ++k; - } - else - { - --k; - } - - break; - - case EAST_WEST: - if (p_176566_4_) - { - --i; - } - else - { - ++i; - } - - break; - - case ASCENDING_EAST: - if (p_176566_4_) - { - --i; - } - else - { - ++i; - ++j; - flag = false; - } - - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; - break; - - case ASCENDING_WEST: - if (p_176566_4_) - { - --i; - ++j; - flag = false; - } - else - { - ++i; - } - - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; - break; - - case ASCENDING_NORTH: - if (p_176566_4_) - { - ++k; - } - else - { - --k; - ++j; - flag = false; - } - - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; - break; - - case ASCENDING_SOUTH: - if (p_176566_4_) - { - ++k; - ++j; - flag = false; - } - else - { - --k; - } - - blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; - } - - return this.func_176567_a(worldIn, new BlockPos(i, j, k), p_176566_4_, p_176566_5_, blockrailbase$enumraildirection) ? true : flag && this.func_176567_a(worldIn, new BlockPos(i, j - 1, k), p_176566_4_, p_176566_5_, blockrailbase$enumraildirection); - } - } - - protected boolean func_176567_a(World worldIn, BlockPos p_176567_2_, boolean p_176567_3_, int distance, BlockRailBase.EnumRailDirection p_176567_5_) - { - State iblockstate = worldIn.getState(p_176567_2_); - - if (iblockstate.getBlock() != this) - { - return false; - } - else - { - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(SHAPE); - return p_176567_5_ != BlockRailBase.EnumRailDirection.EAST_WEST || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_SOUTH && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_NORTH && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_SOUTH ? (p_176567_5_ != BlockRailBase.EnumRailDirection.NORTH_SOUTH || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.EAST_WEST && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_EAST && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_WEST ? (((Boolean)iblockstate.getValue(POWERED)).booleanValue() ? (worldIn.isBlockPowered(p_176567_2_) ? true : this.func_176566_a(worldIn, p_176567_2_, iblockstate, p_176567_3_, distance + 1)) : false) : false) : false; - } - } - - protected void onNeighborChangedInternal(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - boolean flag = ((Boolean)state.getValue(POWERED)).booleanValue(); - boolean flag1 = worldIn.isBlockPowered(pos) || this.func_176566_a(worldIn, pos, state, true, 0) || this.func_176566_a(worldIn, pos, state, false, 0); - - if (flag1 != flag) - { - worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(flag1)), 3); - worldIn.notifyNeighborsOfStateChange(pos.down(), this); - - if (((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).isAscending()) - { - worldIn.notifyNeighborsOfStateChange(pos.up(), this); - } - } - } - - public Property getShapeProperty() - { - return SHAPE; - } - - protected Property[] getProperties() - { - return new Property[] {SHAPE, POWERED}; - } - - public Model getModel(ModelProvider provider, String name, State state) { - return super.getModel(provider, name + (state.getValue(POWERED) ? "_powered" : ""), state); - } -} diff --git a/common/src/main/java/common/block/tech/BlockRedstoneComparator.java b/common/src/main/java/common/block/tech/BlockRedstoneComparator.java deleted file mode 100755 index f80b9c85..00000000 --- a/common/src/main/java/common/block/tech/BlockRedstoneComparator.java +++ /dev/null @@ -1,432 +0,0 @@ -package common.block.tech; - -import common.block.Block; -import common.block.ITileEntityProvider; -import common.entity.npc.EntityNPC; -import common.entity.types.EntityLiving; -import common.init.Blocks; -import common.init.Items; -import common.init.SoundEvent; -import common.item.CheatTab; -import common.item.Item; -import common.item.block.ItemSmallBlock; -import common.model.Model; -import common.model.ModelProvider; -import common.model.ModelRotation; -import common.properties.Property; -import common.properties.PropertyBool; -import common.properties.PropertyEnum; -import common.rng.Random; -import common.tileentity.TileEntity; -import common.tileentity.TileEntityComparator; -import common.util.BlockPos; -import common.util.Facing; -import common.util.Identifyable; -import common.world.IWorldAccess; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider -{ - public static final PropertyBool POWERED = PropertyBool.create("powered"); - public static final PropertyEnum MODE = PropertyEnum.create("mode", BlockRedstoneComparator.Mode.class); - - public BlockRedstoneComparator(boolean powered) - { - super(powered); - this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE)); - this.hasTile = true; - } - -// /** -// * Gets the localized name of this block. Used for the statistics page. -// */ -// public String getLocalizedName() -// { -// return "Redstone-Komparator"; -// } - - /** - * Get the Item that this Block should drop when harvested. - */ - public Item getItemDropped(State state, Random rand, int fortune) - { - return Items.comparator; - } - - public Item getItem(World worldIn, BlockPos pos) - { - return Items.comparator; - } - - protected int getDelay(State state) - { - return 2; - } - - protected State getPoweredState(State unpoweredState) - { - Boolean obool = (Boolean)unpoweredState.getValue(POWERED); - BlockRedstoneComparator.Mode blockredstonecomparator$mode = (BlockRedstoneComparator.Mode)unpoweredState.getValue(MODE); - Facing enumfacing = (Facing)unpoweredState.getValue(FACING); - return Blocks.powered_comparator.getState().withProperty(FACING, enumfacing).withProperty(POWERED, obool).withProperty(MODE, blockredstonecomparator$mode); - } - - protected State getUnpoweredState(State poweredState) - { - Boolean obool = (Boolean)poweredState.getValue(POWERED); - BlockRedstoneComparator.Mode blockredstonecomparator$mode = (BlockRedstoneComparator.Mode)poweredState.getValue(MODE); - Facing enumfacing = (Facing)poweredState.getValue(FACING); - return Blocks.comparator.getState().withProperty(FACING, enumfacing).withProperty(POWERED, obool).withProperty(MODE, blockredstonecomparator$mode); - } - - protected boolean isPowered(State state) - { - return this.isRepeaterPowered || ((Boolean)state.getValue(POWERED)).booleanValue(); - } - - protected int getActiveSignal(IWorldAccess worldIn, BlockPos pos, State state) - { - TileEntity tileentity = worldIn.getTileEntity(pos); - return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0; - } - - private int calculateOutput(World worldIn, BlockPos pos, State state) - { - return state.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT ? Math.max(this.calculateInputStrength(worldIn, pos, state) - this.getPowerOnSides(worldIn, pos, state), 0) : this.calculateInputStrength(worldIn, pos, state); - } - - protected boolean shouldBePowered(World worldIn, BlockPos pos, State state) - { - int i = this.calculateInputStrength(worldIn, pos, state); - - if (i >= 15) - { - return true; - } - else if (i == 0) - { - return false; - } - else - { - int j = this.getPowerOnSides(worldIn, pos, state); - return j == 0 ? true : i >= j; - } - } - - protected int calculateInputStrength(World worldIn, BlockPos pos, State state) - { - int i = super.calculateInputStrength(worldIn, pos, state); - Facing enumfacing = (Facing)state.getValue(FACING); - BlockPos blockpos = pos.offset(enumfacing); - Block block = worldIn.getState(blockpos).getBlock(); - - if (block.hasSignalProcessing()) - { - i = block.getSignal(worldIn, blockpos, 0); - } - else if (i < 15 && block.isNormalCube()) - { - blockpos = blockpos.offset(enumfacing); - block = worldIn.getState(blockpos).getBlock(); - - if (block.hasSignalProcessing()) - { - i = block.getSignal(worldIn, blockpos, 0); - } - } - - return i; - } - -// private EntityFrame findItemFrame(World worldIn, final Facing facing, BlockPos pos) -// { -// List list = worldIn.getEntitiesWithinAABB(EntityFrame.class, new BoundingBox((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 1), (double)(pos.getZ() + 1)), new Predicate() -// { -// public boolean test(Entity p_apply_1_) -// { -// return p_apply_1_ != null && p_apply_1_.getHorizontalFacing() == facing; -// } -// }); -// return list.size() == 1 ? (EntityFrame)list.get(0) : null; -// } - - public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) - { -// if (!playerIn.capabilities.allowEdit) -// { -// return false; -// } -// else -// { - state = state.cycleProperty(MODE); - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F); - worldIn.setState(pos, state, 2); - this.onStateChange(worldIn, pos, state); - return true; -// } - } - - protected void updateState(World worldIn, BlockPos pos, State state) - { - if (worldIn.client || !((AWorldServer)worldIn).isBlockTickPending(pos, this)) - { - int i = this.calculateOutput(worldIn, pos, state); - TileEntity tileentity = worldIn.getTileEntity(pos); - int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0; - - if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state)) - { - if (this.isFacingTowardsRepeater(worldIn, pos, state)) - { - if(!worldIn.client) - ((AWorldServer)worldIn).updateBlockTick(pos, this, 2, -1); - } - else - { - if(!worldIn.client) - ((AWorldServer)worldIn).updateBlockTick(pos, this, 2, 0); - } - } - } - } - - private void onStateChange(World worldIn, BlockPos pos, State state) - { - int i = this.calculateOutput(worldIn, pos, state); - TileEntity tileentity = worldIn.getTileEntity(pos); - int j = 0; - - if (tileentity instanceof TileEntityComparator) - { - TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity; - j = tileentitycomparator.getOutputSignal(); - tileentitycomparator.setOutputSignal(i); - } - - if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE) - { - boolean flag1 = this.shouldBePowered(worldIn, pos, state); - boolean flag = this.isPowered(state); - - if (flag && !flag1) - { - worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2); - } - else if (!flag && flag1) - { - worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2); - } - - this.notifyNeighbors(worldIn, pos, state); - } - } - - public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) - { - if (this.isRepeaterPowered) - { - worldIn.setState(pos, this.getUnpoweredState(state).withProperty(POWERED, Boolean.valueOf(true)), 4); - } - - this.onStateChange(worldIn, pos, state); - } - - public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) - { - super.onBlockAdded(worldIn, pos, state); - worldIn.setTileEntity(pos, this.createNewTileEntity()); - } - - public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) - { - super.onBlockRemoved(worldIn, pos, state); - worldIn.removeTileEntity(pos); - this.notifyNeighbors(worldIn, pos, state); - } - - /** - * Called on both Client and Server when World#addBlockEvent is called - */ - public boolean onBlockEventReceived(World worldIn, BlockPos pos, State state, int eventID, int eventParam) - { - super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam); - TileEntity tileentity = worldIn.getTileEntity(pos); - return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam); - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - public TileEntity createNewTileEntity() - { - return new TileEntityComparator(); - } - - protected Property[] getProperties() - { - return new Property[] {FACING, MODE, POWERED}; - } - - /** - * Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the - * IBlockstate - */ - public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) - { - return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE); - } - - public Model getModel(ModelProvider provider, String name, State state) { - return (state.getValue(POWERED) ? (state.getValue(MODE) == Mode.SUBTRACT ? provider.getModel("comparator_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(4, 7, 11, 6, 7, 13) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(4, 2, 10, 6, 8, 14) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(3, 2, 11, 7, 8, 13) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(10, 7, 11, 12, 7, 13) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(10, 2, 10, 12, 8, 14) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(9, 2, 11, 13, 8, 13) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(7, 5, 2, 9, 5, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 6, 5) - .w("redstone_torch").uv(6, 5, 10, 9).noCull() - .e("redstone_torch").uv(6, 5, 10, 9).noCull() - .add(6, 2, 2, 10, 6, 4) - .n("redstone_torch").uv(6, 5, 10, 9).noCull() - .s("redstone_torch").uv(6, 5, 10, 9).noCull() : provider.getModel("comparator_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(4, 7, 11, 6, 7, 13) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(4, 2, 10, 6, 8, 14) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(3, 2, 11, 7, 8, 13) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(10, 7, 11, 12, 7, 13) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(10, 2, 10, 12, 8, 14) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(9, 2, 11, 13, 8, 13) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(7, 2, 2, 9, 4, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()) - : (state.getValue(MODE) == Mode.SUBTRACT ? provider.getModel("comparator_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(4, 2, 11, 6, 7, 13) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .add(10, 2, 11, 12, 7, 13) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .add(7, 5, 2, 9, 5, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 6, 5) - .w("redstone_torch").uv(6, 5, 10, 9).noCull() - .e("redstone_torch").uv(6, 5, 10, 9).noCull() - .add(6, 2, 2, 10, 6, 4) - .n("redstone_torch").uv(6, 5, 10, 9).noCull() - .s("redstone_torch").uv(6, 5, 10, 9).noCull() : provider.getModel("comparator_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(4, 2, 11, 6, 7, 13) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .add(10, 2, 11, 12, 7, 13) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .add(7, 2, 2, 9, 4, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 8).noCull())) - .rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite())); - } - - protected Item getItemToRegister() { - return this.isRepeaterPowered ? null : new ItemSmallBlock(this).setDisplay("Redstone-Komparator").setTab(CheatTab.TECHNOLOGY); - } - - public static enum Mode implements Identifyable - { - COMPARE("compare"), - SUBTRACT("subtract"); - - private final String name; - - private Mode(String name) - { - this.name = name; - } - - public String toString() - { - return this.name; - } - - public String getName() - { - return this.name; - } - } -} diff --git a/common/src/main/java/common/block/tech/BlockRedstoneDiode.java b/common/src/main/java/common/block/tech/BlockRedstoneDiode.java deleted file mode 100755 index cbeae1ed..00000000 --- a/common/src/main/java/common/block/tech/BlockRedstoneDiode.java +++ /dev/null @@ -1,298 +0,0 @@ -package common.block.tech; - -import common.block.Block; -import common.block.Rotatable; -import common.block.Material; -import common.entity.types.EntityLiving; -import common.init.Blocks; -import common.item.ItemStack; -import common.model.BlockLayer; -import common.rng.Random; -import common.util.BlockPos; -import common.util.Facing; -import common.world.IWorldAccess; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public abstract class BlockRedstoneDiode extends Block implements Rotatable -{ - /** Tells whether the repeater is powered or not */ - protected final boolean isRepeaterPowered; - - public BlockRedstoneDiode(boolean powered) - { - super(Material.SMALL); - this.isRepeaterPowered = powered; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - } - - public boolean isFullCube() - { - return false; - } - - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) - { - return worldIn.isBlockSolid(pos.down()) ? super.canPlaceBlockAt(worldIn, pos) : false; - } - - public boolean canBlockStay(World worldIn, BlockPos pos) - { - return worldIn.isBlockSolid(pos.down()); - } - - /** - * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) - */ - public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) - { - } - - public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) - { - if (!this.isLocked(worldIn, pos, state)) - { - boolean flag = this.shouldBePowered(worldIn, pos, state); - - if (this.isRepeaterPowered && !flag) - { - worldIn.setState(pos, this.getUnpoweredState(state), 2); - } - else if (!this.isRepeaterPowered) - { - worldIn.setState(pos, this.getPoweredState(state), 2); - - if (!flag) - { - worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1); - } - } - } - } - - public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side) - { - return side.getAxis() != Facing.Axis.Y; - } - - protected boolean isPowered(State state) - { - return this.isRepeaterPowered; - } - - public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) - { - return this.getWeakPower(worldIn, pos, state, side); - } - - public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) - { - return !this.isPowered(state) ? 0 : (state.getValue(FACING) == side ? this.getActiveSignal(worldIn, pos, state) : 0); - } - - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (this.canBlockStay(worldIn, pos)) - { - this.updateState(worldIn, pos, state); - } - else - { - this.dropBlockAsItem(worldIn, pos, state, 0); - worldIn.setBlockToAir(pos); - - for (Facing enumfacing : Facing.values()) - { - worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); - } - } - } - - protected void updateState(World worldIn, BlockPos pos, State state) - { - if (!this.isLocked(worldIn, pos, state)) - { - boolean flag = this.shouldBePowered(worldIn, pos, state); - - if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && (worldIn.client || !((AWorldServer)worldIn).isBlockTickPending(pos, this))) - { - int i = -1; - - if (this.isFacingTowardsRepeater(worldIn, pos, state)) - { - i = -3; - } - else if (this.isRepeaterPowered) - { - i = -2; - } - - if(!worldIn.client) - ((AWorldServer)worldIn).updateBlockTick(pos, this, this.getDelay(state), i); - } - } - } - - public boolean isLocked(IWorldAccess worldIn, BlockPos pos, State state) - { - return false; - } - - protected boolean shouldBePowered(World worldIn, BlockPos pos, State state) - { - return this.calculateInputStrength(worldIn, pos, state) > 0; - } - - protected int calculateInputStrength(World worldIn, BlockPos pos, State state) - { - Facing enumfacing = (Facing)state.getValue(FACING); - BlockPos blockpos = pos.offset(enumfacing); - int i = worldIn.getRedstonePower(blockpos, enumfacing); - - if (i >= 15) - { - return i; - } - else - { - State iblockstate = worldIn.getState(blockpos); - return Math.max(i, iblockstate.getBlock() == Blocks.redstone ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : 0); - } - } - - protected int getPowerOnSides(IWorldAccess worldIn, BlockPos pos, State state) - { - Facing enumfacing = (Facing)state.getValue(FACING); - Facing enumfacing1 = enumfacing.rotateY(); - Facing enumfacing2 = enumfacing.rotateYCCW(); - return Math.max(this.getPowerOnSide(worldIn, pos.offset(enumfacing1), enumfacing1), this.getPowerOnSide(worldIn, pos.offset(enumfacing2), enumfacing2)); - } - - protected int getPowerOnSide(IWorldAccess worldIn, BlockPos pos, Facing side) - { - State iblockstate = worldIn.getState(pos); - Block block = iblockstate.getBlock(); - return this.canPowerSide(block) ? (block == Blocks.redstone ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : iblockstate.getBlock().getStrongPower(worldIn, pos, iblockstate, side)) : 0; - } - - /** - * Can this block provide power. Only wire currently seems to have this change based on its state. - */ - public boolean canProvidePower() - { - return true; - } - - /** - * Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the - * IBlockstate - */ - public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) - { - return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); - } - - /** - * Called by ItemBlocks after a block is set in the world, to allow post-place logic - */ - public void onBlockPlacedBy(World worldIn, BlockPos pos, State state, EntityLiving placer, ItemStack stack) - { - if (this.shouldBePowered(worldIn, pos, state)) - { - worldIn.scheduleUpdate(pos, this, 1); - } - } - - public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) - { - this.notifyNeighbors(worldIn, pos, state); - } - - protected void notifyNeighbors(World worldIn, BlockPos pos, State state) - { - Facing enumfacing = (Facing)state.getValue(FACING); - BlockPos blockpos = pos.offset(enumfacing.getOpposite()); - worldIn.notifyBlockOfStateChange(blockpos, this); - worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing); - } - - /** - * Called when a player destroys this Block - */ - public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, State state) - { - if (this.isRepeaterPowered) - { - for (Facing enumfacing : Facing.values()) - { - worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); - } - } - - super.onBlockDestroyedByPlayer(worldIn, pos, state); - } - - /** - * Used to determine ambient occlusion and culling when rebuilding chunks for render - */ - public boolean isOpaqueCube() - { - return false; - } - - protected boolean canPowerSide(Block blockIn) - { - return blockIn.canProvidePower(); - } - - protected int getActiveSignal(IWorldAccess worldIn, BlockPos pos, State state) - { - return 15; - } - - public static boolean isRedstoneRepeaterBlockID(Block blockIn) - { - return Blocks.repeater.isAssociated(blockIn) || Blocks.comparator.isAssociated(blockIn); - } - - public boolean isAssociated(Block other) - { - return other == this.getPoweredState(this.getState()).getBlock() || other == this.getUnpoweredState(this.getState()).getBlock(); - } - - public boolean isFacingTowardsRepeater(World worldIn, BlockPos pos, State state) - { - Facing enumfacing = ((Facing)state.getValue(FACING)).getOpposite(); - BlockPos blockpos = pos.offset(enumfacing); - return isRedstoneRepeaterBlockID(worldIn.getState(blockpos).getBlock()) ? worldIn.getState(blockpos).getValue(FACING) != enumfacing : false; - } - - protected int getTickDelay(State state) - { - return this.getDelay(state); - } - - protected abstract int getDelay(State state); - - protected abstract State getPoweredState(State unpoweredState); - - protected abstract State getUnpoweredState(State poweredState); - - public boolean isAssociatedBlock(Block other) - { - return this.isAssociated(other); - } - - public BlockLayer getBlockLayer() - { - return BlockLayer.CUTOUT; - } - - public boolean isMagnetic() { - return true; - } -} diff --git a/common/src/main/java/common/block/tech/BlockRedstoneLight.java b/common/src/main/java/common/block/tech/BlockRedstoneLight.java deleted file mode 100755 index 12f72cfd..00000000 --- a/common/src/main/java/common/block/tech/BlockRedstoneLight.java +++ /dev/null @@ -1,99 +0,0 @@ -package common.block.tech; - -import common.block.Block; -import common.block.Material; -import common.init.Blocks; -import common.init.Items; -import common.item.Item; -import common.item.ItemStack; -import common.rng.Random; -import common.util.BlockPos; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public class BlockRedstoneLight extends Block -{ - private final boolean isOn; - - public BlockRedstoneLight(boolean isOn) - { - super(Material.LOOSE); - this.isOn = isOn; - - if (isOn) - { - this.setLightLevel(1.0F); - } - } - - public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) - { - if (!worldIn.client) - { - if (this.isOn && !worldIn.isBlockPowered(pos)) - { - worldIn.setState(pos, Blocks.redstone_lamp.getState(), 2); - } - else if (!this.isOn && worldIn.isBlockPowered(pos)) - { - worldIn.setState(pos, Blocks.lit_redstone_lamp.getState(), 2); - } - } - } - - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (!worldIn.client) - { - if (this.isOn && !worldIn.isBlockPowered(pos)) - { - worldIn.scheduleUpdate(pos, this, 4); - } - else if (!this.isOn && worldIn.isBlockPowered(pos)) - { - worldIn.setState(pos, Blocks.lit_redstone_lamp.getState(), 2); - } - } - } - - public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) - { -// if (!worldIn.client) -// { - if (this.isOn && !worldIn.isBlockPowered(pos)) - { - worldIn.setState(pos, Blocks.redstone_lamp.getState(), 2); - } -// } - } - - /** - * Get the Item that this Block should drop when harvested. - */ - public Item getItemDropped(State state, Random rand, int fortune) - { - return Items.redstone_lamp; - } - - public Item getItem(World worldIn, BlockPos pos) - { - return Items.redstone_lamp; - } - - public ItemStack createStackedBlock(State state) - { - return new ItemStack(Items.redstone_lamp); - } - - public boolean isMagnetic() { - return true; - } - - protected Item getItemToRegister() { - return this.isOn ? null : super.getItemToRegister(); - } -} diff --git a/common/src/main/java/common/block/tech/BlockRedstoneRepeater.java b/common/src/main/java/common/block/tech/BlockRedstoneRepeater.java deleted file mode 100755 index 4669429b..00000000 --- a/common/src/main/java/common/block/tech/BlockRedstoneRepeater.java +++ /dev/null @@ -1,562 +0,0 @@ -package common.block.tech; - -import common.block.Block; -import common.entity.npc.EntityNPC; -import common.init.Blocks; -import common.init.Items; -import common.item.CheatTab; -import common.item.Item; -import common.item.block.ItemSmallBlock; -import common.model.Model; -import common.model.ModelProvider; -import common.model.ModelRotation; -import common.properties.Property; -import common.properties.PropertyBool; -import common.properties.PropertyInteger; -import common.rng.Random; -import common.util.BlockPos; -import common.util.Facing; -import common.util.ParticleType; -import common.world.IWorldAccess; -import common.world.AWorldClient; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public class BlockRedstoneRepeater extends BlockRedstoneDiode -{ - public static final PropertyBool LOCKED = PropertyBool.create("locked"); - public static final PropertyInteger DELAY = PropertyInteger.create("delay", 1, 4); - - public BlockRedstoneRepeater(boolean powered) - { - super(powered); - this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(DELAY, Integer.valueOf(1)).withProperty(LOCKED, Boolean.valueOf(false))); - } - -// /** -// * Gets the localized name of this block. Used for the statistics page. -// */ -// public String getLocalizedName() -// { -// return "Redstone-Verstärker"; -// } - - /** - * Get the actual Block state of this Block at the given position. This applies properties not visible in the - * metadata, such as fence connections. - */ - public State getActualState(State state, IWorldAccess worldIn, BlockPos pos) - { - return state.withProperty(LOCKED, Boolean.valueOf(this.isLocked(worldIn, pos, state))); - } - - public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) - { -// if (!playerIn.capabilities.allowEdit) -// { -// return false; -// } -// else -// { - worldIn.setState(pos, state.cycleProperty(DELAY), 3); - return true; -// } - } - - protected int getDelay(State state) - { - return ((Integer)state.getValue(DELAY)).intValue() * 2; - } - - protected State getPoweredState(State unpoweredState) - { - Integer integer = (Integer)unpoweredState.getValue(DELAY); - Boolean obool = (Boolean)unpoweredState.getValue(LOCKED); - Facing enumfacing = (Facing)unpoweredState.getValue(FACING); - return Blocks.powered_repeater.getState().withProperty(FACING, enumfacing).withProperty(DELAY, integer).withProperty(LOCKED, obool); - } - - protected State getUnpoweredState(State poweredState) - { - Integer integer = (Integer)poweredState.getValue(DELAY); - Boolean obool = (Boolean)poweredState.getValue(LOCKED); - Facing enumfacing = (Facing)poweredState.getValue(FACING); - return Blocks.repeater.getState().withProperty(FACING, enumfacing).withProperty(DELAY, integer).withProperty(LOCKED, obool); - } - - /** - * Get the Item that this Block should drop when harvested. - */ - public Item getItemDropped(State state, Random rand, int fortune) - { - return Items.repeater; - } - - public Item getItem(World worldIn, BlockPos pos) - { - return Items.repeater; - } - - public boolean isLocked(IWorldAccess worldIn, BlockPos pos, State state) - { - return this.getPowerOnSides(worldIn, pos, state) > 0; - } - - protected boolean canPowerSide(Block blockIn) - { - return isRedstoneRepeaterBlockID(blockIn); - } - - public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) - { - if (this.isRepeaterPowered) - { - Facing enumfacing = (Facing)state.getValue(FACING); - double d0 = (double)((float)pos.getX() + 0.5F) + (double)(rand.floatv() - 0.5F) * 0.2D; - double d1 = (double)((float)pos.getY() + 0.4F) + (double)(rand.floatv() - 0.5F) * 0.2D; - double d2 = (double)((float)pos.getZ() + 0.5F) + (double)(rand.floatv() - 0.5F) * 0.2D; - float f = -5.0F; - - if (rand.chance()) - { - f = (float)(((Integer)state.getValue(DELAY)).intValue() * 2 - 1); - } - - f = f / 16.0F; - double d3 = (double)(f * (float)enumfacing.getFrontOffsetX()); - double d4 = (double)(f * (float)enumfacing.getFrontOffsetZ()); - worldIn.spawnParticle(ParticleType.DUST, d0 + d3, d1, d2 + d4, 0xff0000); - } - } - - public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) - { - super.onBlockRemoved(worldIn, pos, state); - this.notifyNeighbors(worldIn, pos, state); - } - - protected Property[] getProperties() - { - return new Property[] {FACING, DELAY, LOCKED}; - } - - private static Model getModelOff(int delay) { - switch(delay) { - case 1: - default: - return ModelProvider.getModelProvider().getModel("repeater_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(7, 2, 6, 9, 7, 8) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .add(7, 2, 2, 9, 7, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull(); - case 2: - return ModelProvider.getModelProvider().getModel("repeater_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(7, 2, 8, 9, 7, 10) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .add(7, 2, 2, 9, 7, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull(); - case 3: - return ModelProvider.getModelProvider().getModel("repeater_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(7, 2, 10, 9, 7, 12) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .add(7, 2, 2, 9, 7, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull(); - case 4: - return ModelProvider.getModelProvider().getModel("repeater_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(7, 2, 12, 9, 7, 14) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .add(7, 2, 2, 9, 7, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull(); - } - } - - private static Model getModelOn(int delay) { - switch(delay) { - case 1: - default: - return ModelProvider.getModelProvider().getModel("repeater_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(7, 7, 6, 9, 7, 8) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 5, 9, 8, 9) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 6, 10, 8, 8) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(7, 7, 2, 9, 7, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 8, 5) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 2, 10, 8, 4) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull(); - case 2: - return ModelProvider.getModelProvider().getModel("repeater_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(7, 7, 8, 9, 7, 10) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 7, 9, 8, 11) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 8, 10, 8, 10) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(7, 7, 2, 9, 7, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 8, 5) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 2, 10, 8, 4) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull(); - case 3: - return ModelProvider.getModelProvider().getModel("repeater_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(7, 7, 10, 9, 7, 12) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 9, 9, 8, 13) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 10, 10, 8, 12) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(7, 7, 2, 9, 7, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 8, 5) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 2, 10, 8, 4) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull(); - case 4: - return ModelProvider.getModelProvider().getModel("repeater_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(7, 7, 12, 9, 7, 14) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 11, 9, 8, 15) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 12, 10, 8, 14) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(7, 7, 2, 9, 7, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 8, 5) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 2, 10, 8, 4) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull(); - } - } - - private static Model getModelOffLocked(int delay) { - switch(delay) { - case 1: - default: - return ModelProvider.getModelProvider().getModel("repeater_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(2, 2, 6, 14, 4, 8) - .d("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .u("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .n("bedrock").uv(2, 7, 14, 9).noCull() - .s("bedrock").uv(2, 7, 14, 9).noCull() - .w("bedrock").uv(6, 7, 8, 9).noCull() - .e("bedrock").uv(6, 7, 8, 9).noCull() - .add(7, 2, 2, 9, 7, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull(); - case 2: - return ModelProvider.getModelProvider().getModel("repeater_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(2, 2, 8, 14, 4, 10) - .d("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .u("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .n("bedrock").uv(2, 7, 14, 9).noCull() - .s("bedrock").uv(2, 7, 14, 9).noCull() - .w("bedrock").uv(6, 7, 8, 9).noCull() - .e("bedrock").uv(6, 7, 8, 9).noCull() - .add(7, 2, 2, 9, 7, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull(); - case 3: - return ModelProvider.getModelProvider().getModel("repeater_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(2, 2, 10, 14, 4, 12) - .d("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .u("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .n("bedrock").uv(2, 7, 14, 9).noCull() - .s("bedrock").uv(2, 7, 14, 9).noCull() - .w("bedrock").uv(6, 7, 8, 9).noCull() - .e("bedrock").uv(6, 7, 8, 9).noCull() - .add(7, 2, 2, 9, 7, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull(); - case 4: - return ModelProvider.getModelProvider().getModel("repeater_off") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(2, 2, 12, 14, 4, 14) - .d("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .u("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .n("bedrock").uv(2, 7, 14, 9).noCull() - .s("bedrock").uv(2, 7, 14, 9).noCull() - .w("bedrock").uv(6, 7, 8, 9).noCull() - .e("bedrock").uv(6, 7, 8, 9).noCull() - .add(7, 2, 2, 9, 7, 4) - .d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull() - .u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull() - .n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull() - .e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull(); - } - } - - private static Model getModelOnLocked(int delay) { - switch(delay) { - case 1: - default: - return ModelProvider.getModelProvider().getModel("repeater_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(2, 2, 6, 14, 4, 8) - .d("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .u("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .n("bedrock").uv(2, 7, 14, 9).noCull() - .s("bedrock").uv(2, 7, 14, 9).noCull() - .w("bedrock").uv(6, 7, 8, 9).noCull() - .e("bedrock").uv(6, 7, 8, 9).noCull() - .add(7, 7, 2, 9, 7, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 8, 5) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 2, 10, 8, 4) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull(); - case 2: - return ModelProvider.getModelProvider().getModel("repeater_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(2, 2, 8, 14, 4, 10) - .d("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .u("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .n("bedrock").uv(2, 7, 14, 9).noCull() - .s("bedrock").uv(2, 7, 14, 9).noCull() - .w("bedrock").uv(6, 7, 8, 9).noCull() - .e("bedrock").uv(6, 7, 8, 9).noCull() - .add(7, 7, 2, 9, 7, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 8, 5) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 2, 10, 8, 4) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull(); - case 3: - return ModelProvider.getModelProvider().getModel("repeater_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(2, 2, 10, 14, 4, 12) - .d("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .u("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .n("bedrock").uv(2, 7, 14, 9).noCull() - .s("bedrock").uv(2, 7, 14, 9).noCull() - .w("bedrock").uv(6, 7, 8, 9).noCull() - .e("bedrock").uv(6, 7, 8, 9).noCull() - .add(7, 7, 2, 9, 7, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 8, 5) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 2, 10, 8, 4) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull(); - case 4: - return ModelProvider.getModelProvider().getModel("repeater_on") - .add(0, 0, 0, 16, 2, 16) - .d("concrete_plate").uv(0, 0, 16, 16) - .u().uv(0, 0, 16, 16).noCull() - .n("concrete_plate").uv(0, 14, 16, 16) - .s("concrete_plate").uv(0, 14, 16, 16) - .w("concrete_plate").uv(0, 14, 16, 16) - .e("concrete_plate").uv(0, 14, 16, 16) - .add(2, 2, 12, 14, 4, 14) - .d("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .u("bedrock").uv(7, 2, 9, 14).rot(90).noCull() - .n("bedrock").uv(2, 7, 14, 9).noCull() - .s("bedrock").uv(2, 7, 14, 9).noCull() - .w("bedrock").uv(6, 7, 8, 9).noCull() - .e("bedrock").uv(6, 7, 8, 9).noCull() - .add(7, 7, 2, 9, 7, 4) - .u("redstone_torch").uv(7, 6, 9, 8).noCull() - .add(7, 2, 1, 9, 8, 5) - .w("redstone_torch").uv(6, 5, 10, 11).noCull() - .e("redstone_torch").uv(6, 5, 10, 11).noCull() - .add(6, 2, 2, 10, 8, 4) - .n("redstone_torch").uv(6, 5, 10, 11).noCull() - .s("redstone_torch").uv(6, 5, 10, 11).noCull(); - } - } - - public Model getModel(ModelProvider provider, String name, State state) { - return (this.isRepeaterPowered ? (state.getValue(LOCKED) ? getModelOnLocked(state.getValue(DELAY)) : - getModelOn(state.getValue(DELAY))) : (state.getValue(LOCKED) ? getModelOffLocked(state.getValue(DELAY)) : - getModelOff(state.getValue(DELAY)))) - .rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite())); - } - - protected Item getItemToRegister() { - return this.isRepeaterPowered ? null : new ItemSmallBlock(this).setDisplay("Redstone-Verstärker").setTab(CheatTab.TECHNOLOGY); - } - - public Property[] getUnsavedProperties() { - return new Property[] {LOCKED}; - } -} diff --git a/common/src/main/java/common/block/tech/BlockRedstoneTorch.java b/common/src/main/java/common/block/tech/BlockRedstoneTorch.java deleted file mode 100755 index f24c09c7..00000000 --- a/common/src/main/java/common/block/tech/BlockRedstoneTorch.java +++ /dev/null @@ -1,242 +0,0 @@ -package common.block.tech; - -import java.util.List; -import java.util.Map; - -import common.block.Block; -import common.collect.Lists; -import common.collect.Maps; -import common.init.Blocks; -import common.init.Items; -import common.init.SoundEvent; -import common.item.CheatTab; -import common.item.Item; -import common.rng.Random; -import common.util.BlockPos; -import common.util.Facing; -import common.util.ParticleType; -import common.world.IWorldAccess; -import common.world.AWorldClient; -import common.world.State; -import common.world.World; -import common.world.AWorldServer; - -public class BlockRedstoneTorch extends BlockTorch -{ - private static Map> toggles = Maps.>newHashMap(); - private final boolean isOn; - - private boolean isBurnedOut(AWorldServer worldIn, BlockPos pos, boolean turnOff) - { - if (!toggles.containsKey(worldIn)) - { - toggles.put(worldIn, Lists.newArrayList()); - } - - List list = (List)toggles.get(worldIn); - - if (turnOff) - { - list.add(new BlockRedstoneTorch.Toggle(pos, worldIn.getTime())); - } - - int i = 0; - - for (int j = 0; j < list.size(); ++j) - { - BlockRedstoneTorch.Toggle blockredstonetorch$toggle = (BlockRedstoneTorch.Toggle)list.get(j); - - if (blockredstonetorch$toggle.pos.equals(pos)) - { - ++i; - - if (i >= 8) - { - return true; - } - } - } - - return false; - } - - public BlockRedstoneTorch(boolean isOn) - { - this.isOn = isOn; -// this.setTickRandomly(true); - this.setTab((CheatTab)null); - } - - /** - * How many world ticks before ticking - */ - public int tickRate(World worldIn, BlockPos pos) - { - return 2; - } - - public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) - { - if (this.isOn) - { - for (Facing enumfacing : Facing.values()) - { - worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); - } - } - } - - public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) - { - if (this.isOn) - { - for (Facing enumfacing : Facing.values()) - { - worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); - } - } - } - - public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) - { - return this.isOn && state.getValue(FACING) != side ? 15 : 0; - } - - private boolean shouldBeOff(World worldIn, BlockPos pos, State state) - { - Facing enumfacing = ((Facing)state.getValue(FACING)).getOpposite(); - return worldIn.isSidePowered(pos.offset(enumfacing), enumfacing); - } - - /** - * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) - */ - public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) - { - } - - public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) - { - boolean flag = this.shouldBeOff(worldIn, pos, state); - List list = (List)toggles.get(worldIn); - - while (list != null && !list.isEmpty() && worldIn.getTime() - ((BlockRedstoneTorch.Toggle)list.get(0)).time > 60L) - { - list.remove(0); - } - - if (this.isOn) - { - if (flag) - { - worldIn.setState(pos, Blocks.unlit_redstone_torch.getState().withProperty(FACING, state.getValue(FACING)), 3); - - if (this.isBurnedOut(worldIn, pos, true)) - { - worldIn.playSound(SoundEvent.FIZZ, (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), 0.5F); - - for (int i = 0; i < 5; ++i) - { - double d0 = (double)pos.getX() + rand.doublev() * 0.6D + 0.2D; - double d1 = (double)pos.getY() + rand.doublev() * 0.6D + 0.2D; - double d2 = (double)pos.getZ() + rand.doublev() * 0.6D + 0.2D; - worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2); - } - - worldIn.scheduleUpdate(pos, worldIn.getState(pos).getBlock(), 160); - } - } - } - else if (!flag && !this.isBurnedOut(worldIn, pos, false)) - { - worldIn.setState(pos, Blocks.redstone_torch.getState().withProperty(FACING, state.getValue(FACING)), 3); - } - } - - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) - { - if (!this.onNeighborChangeInternal(worldIn, pos, state)) - { - if (this.isOn == this.shouldBeOff(worldIn, pos, state)) - { - worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); - } - } - } - - public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) - { - return side == Facing.DOWN ? this.getWeakPower(worldIn, pos, state, side) : 0; - } - - /** - * Get the Item that this Block should drop when harvested. - */ - public Item getItemDropped(State state, Random rand, int fortune) - { - return Items.redstone_torch; - } - - /** - * Can this block provide power. Only wire currently seems to have this change based on its state. - */ - public boolean canProvidePower() - { - return true; - } - - public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) - { - if (this.isOn) - { - double d0 = (double)pos.getX() + 0.5D + (rand.doublev() - 0.5D) * 0.2D; - double d1 = (double)pos.getY() + 0.7D + (rand.doublev() - 0.5D) * 0.2D; - double d2 = (double)pos.getZ() + 0.5D + (rand.doublev() - 0.5D) * 0.2D; - Facing enumfacing = (Facing)state.getValue(FACING); - - if (enumfacing.getAxis().isHorizontal()) - { - Facing enumfacing1 = enumfacing.getOpposite(); - double d3 = 0.27D; - d0 += 0.27D * (double)enumfacing1.getFrontOffsetX(); - d1 += 0.22D; - d2 += 0.27D * (double)enumfacing1.getFrontOffsetZ(); - } - - worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, 0xff0000); - } - } - - public Item getItem(World worldIn, BlockPos pos) - { - return Items.redstone_torch; - } - - public boolean isAssociatedBlock(Block other) - { - return other == Blocks.unlit_redstone_torch || other == Blocks.redstone_torch; - } - - public boolean isMagnetic() { - return true; - } - - protected Item getItemToRegister() { - return this.isOn ? super.getItemToRegister() : null; - } - - static class Toggle - { - BlockPos pos; - long time; - - public Toggle(BlockPos pos, long time) - { - this.pos = pos; - this.time = time; - } - } -} diff --git a/common/src/main/java/common/block/tech/BlockTNT.java b/common/src/main/java/common/block/tech/BlockTNT.java index e6c27784..e83ad012 100755 --- a/common/src/main/java/common/block/tech/BlockTNT.java +++ b/common/src/main/java/common/block/tech/BlockTNT.java @@ -22,7 +22,6 @@ import common.util.Facing; import common.world.Explosion; import common.world.State; import common.world.World; -import common.world.AWorldServer; public class BlockTNT extends Block { diff --git a/common/src/main/java/common/block/tech/BlockToggleableLight.java b/common/src/main/java/common/block/tech/BlockToggleableLight.java new file mode 100755 index 00000000..e416dcd4 --- /dev/null +++ b/common/src/main/java/common/block/tech/BlockToggleableLight.java @@ -0,0 +1,66 @@ +package common.block.tech; + +import common.block.Block; +import common.block.Material; +import common.entity.npc.EntityNPC; +import common.init.Blocks; +import common.init.Items; +import common.item.Item; +import common.item.ItemStack; +import common.rng.Random; +import common.util.BlockPos; +import common.util.Facing; +import common.world.State; +import common.world.World; + +public class BlockToggleableLight extends Block { + private final boolean isOn; + + public BlockToggleableLight(boolean isOn) { + super(Material.LOOSE); + this.isOn = isOn; + if(isOn) + this.setLightLevel(1.0F); + } + + public void toggle(World worldIn, BlockPos pos) { + worldIn.setState(pos, this.isOn ? Blocks.lamp.getState() : Blocks.lit_lamp.getState(), 2); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ) { + if(!this.isOn) { + if(player.getCurrentEquippedItem() == null) + return super.onBlockActivated(worldIn, pos, state, player, side, hitX, hitY, hitZ); + Item item = player.getCurrentEquippedItem().getItem(); + if(item != Items.flint_and_steel && item != Items.fireball) + return super.onBlockActivated(worldIn, pos, state, player, side, hitX, hitY, hitZ); + if(item == Items.flint_and_steel) + player.getCurrentEquippedItem().damage(1, player); + else + player.getCurrentEquippedItem().decrSize(); + } + this.toggle(worldIn, pos); + worldIn.playAuxSFX(player, this.isOn ? 1004 : 1007, pos, 0); + return true; + } + + public Item getItemDropped(State state, Random rand, int fortune) { + return Items.lamp; + } + + public Item getItem(World worldIn, BlockPos pos) { + return Items.lamp; + } + + public ItemStack createStackedBlock(State state) { + return new ItemStack(Items.lamp); + } + + public boolean isMagnetic() { + return true; + } + + protected Item getItemToRegister() { + return this.isOn ? null : super.getItemToRegister(); + } +} diff --git a/common/src/main/java/common/block/tech/BlockTorch.java b/common/src/main/java/common/block/tech/BlockTorch.java index 17a384c2..fa48f7ec 100755 --- a/common/src/main/java/common/block/tech/BlockTorch.java +++ b/common/src/main/java/common/block/tech/BlockTorch.java @@ -5,6 +5,7 @@ import common.block.DirectionalUp; import common.block.Material; import common.block.artificial.BlockFence; import common.block.artificial.BlockStainedGlass; +import common.block.artificial.BlockWall; import common.entity.types.EntityLiving; import common.init.Blocks; import common.item.CheatTab; @@ -13,19 +14,16 @@ import common.model.Model; import common.model.ModelProvider; import common.model.ModelRotation; import common.properties.Property; -import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; import common.util.Facing; import common.util.HitPosition; -import common.util.ParticleType; import common.util.Vec3; -import common.world.AWorldClient; import common.world.State; import common.world.World; import common.world.AWorldServer; -public class BlockTorch extends Block implements DirectionalUp +public abstract class BlockTorch extends Block implements DirectionalUp { private static boolean isBlockNormalCube(World world, BlockPos pos, boolean def) { if(!World.isValid(pos) || (world.client && !world.isBlockLoaded(pos, false))) @@ -38,7 +36,6 @@ public class BlockTorch extends Block implements DirectionalUp { super(Material.SMALL); this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.UP)); -// this.setTickRandomly(true); this.setTab(CheatTab.TECHNOLOGY); this.setFlatItemTexture(); } @@ -70,7 +67,7 @@ public class BlockTorch extends Block implements DirectionalUp else { Block block = worldIn.getState(pos).getBlock(); - return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block instanceof BlockStainedGlass; + return block instanceof BlockFence || block == Blocks.glass || block instanceof BlockWall || block instanceof BlockStainedGlass; } } @@ -217,28 +214,6 @@ public class BlockTorch extends Block implements DirectionalUp return super.collisionRayTrace(worldIn, pos, start, end); } - public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) - { - Facing enumfacing = (Facing)state.getValue(FACING); - double d0 = (double)pos.getX() + 0.5D; - double d1 = (double)pos.getY() + 0.7D; - double d2 = (double)pos.getZ() + 0.5D; - double d3 = 0.22D; - double d4 = 0.27D; - - if (enumfacing.getAxis().isHorizontal()) - { - Facing enumfacing1 = enumfacing.getOpposite(); - worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ()); - worldIn.spawnParticle(ParticleType.FLAME, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ()); - } - else - { - worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2); - worldIn.spawnParticle(ParticleType.FLAME, d0, d1, d2); - } - } - public BlockLayer getBlockLayer() { return BlockLayer.CUTOUT; diff --git a/common/src/main/java/common/block/tech/BlockUnlitTorch.java b/common/src/main/java/common/block/tech/BlockUnlitTorch.java new file mode 100644 index 00000000..951f1c49 --- /dev/null +++ b/common/src/main/java/common/block/tech/BlockUnlitTorch.java @@ -0,0 +1,51 @@ +package common.block.tech; + +import common.entity.npc.EntityNPC; +import common.init.Items; +import common.item.CheatTab; +import common.item.Item; +import common.util.BlockPos; +import common.util.Facing; +import common.world.State; +import common.world.World; + +public class BlockUnlitTorch extends BlockTorch { + private final int particleColor; + + private BlockLitTorch lit; + + public BlockUnlitTorch(int color) { + this.particleColor = color; + this.setTab(CheatTab.TECHNOLOGY); + } + + void setLitTorch(BlockLitTorch lit) { + this.lit = lit; + } + + public int getParticleColor() { + return this.particleColor; + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) { + if(playerIn.getCurrentEquippedItem() != null) { + Item item = playerIn.getCurrentEquippedItem().getItem(); + + if(item == Items.flint_and_steel || item == Items.fireball) { + worldIn.setState(pos, this.lit.getState().withProperty(FACING, state.getValue(FACING)).withProperty(BlockLitTorch.FUEL, 7), 3); + worldIn.playAuxSFX(playerIn, 1007, pos, 0); + + if(item == Items.flint_and_steel) { + playerIn.getCurrentEquippedItem().damage(1, playerIn); + } + else { + playerIn.getCurrentEquippedItem().decrSize(); + } + + return true; + } + } + + return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ); + } +} diff --git a/common/src/main/java/common/block/tech/BlockRedstoneWire.java b/common/src/main/java/common/block/tech/BlockWire.java similarity index 59% rename from common/src/main/java/common/block/tech/BlockRedstoneWire.java rename to common/src/main/java/common/block/tech/BlockWire.java index e6c5699f..30529155 100755 --- a/common/src/main/java/common/block/tech/BlockRedstoneWire.java +++ b/common/src/main/java/common/block/tech/BlockWire.java @@ -9,10 +9,8 @@ import common.block.Material; import common.collect.Lists; import common.collect.Sets; import common.init.Blocks; -import common.init.Items; import common.item.Item; -import common.item.StackSize; -import common.item.block.ItemRedstone; +import common.item.block.ItemWire; import common.model.BlockLayer; import common.model.Model; import common.model.ModelProvider; @@ -34,345 +32,345 @@ import common.world.State; import common.world.World; import common.world.AWorldServer; -public class BlockRedstoneWire extends Block +public class BlockWire extends Block { - private static final Model redstone_none = ModelProvider.getModelProvider().getModel("redstone_dust_cross") + private static final Model wire_none = ModelProvider.getModelProvider().getModel("wire_cross") .add(5, 0.25f, 5, 11, 0.25f, 11).noShade() .u().uv(5, 5, 11, 11).tint().noCull() .add(5, 0.25f, 5, 11, 0.25f, 11).noShade() - .u("redstone_dust_cross_overlay").uv(5, 5, 11, 11).noCull() + .u("wire_cross_overlay").uv(5, 5, 11, 11).noCull() ; - private static final Model redstone_nsew = ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static final Model wire_nsew = ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(0, 0, 16, 16).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull() ; - private static final Model redstone_unusueuw = ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static final Model wire_unusueuw = ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(0, 0, 16, 16).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0.25f, 0, 0, 0.25f, 16, 16).noShade() - .e("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .e("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0.25f, 0, 0, 0.25f, 16, 16).noShade() - .e("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .e("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() ; - private static final Model redstone_unus = ModelProvider.getModelProvider().getModel("redstone_dust_cross") + private static final Model wire_unus = ModelProvider.getModelProvider().getModel("wire_cross") .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() ; - private static final Model redstone_ueuw = ModelProvider.getModelProvider().getModel("redstone_dust_cross") + private static final Model wire_ueuw = ModelProvider.getModelProvider().getModel("wire_cross") .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line").uv(0, 0, 16, 16).tint().noCull() + .u("wire_line").uv(0, 0, 16, 16).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line_overlay").uv(0, 0, 16, 16).noCull() + .u("wire_line_overlay").uv(0, 0, 16, 16).noCull() .add(0.25f, 0, 0, 0.25f, 16, 16).noShade() - .e("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .e("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0.25f, 0, 0, 0.25f, 16, 16).noShade() - .e("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .e("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() ; - private static Model redstone_n(boolean rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross") + private static Model wire_n(boolean rot) { + return ModelProvider.getModelProvider().getModel("wire_cross") .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); } - private static Model redstone_ne(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_ne(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .u().uv(5, 0, 16, 11).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 11).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 11).noCull() .rotate(rot); } - private static Model redstone_uew(boolean rot) { - Model model = ModelProvider.getModelProvider().getModel("redstone_dust_cross") + private static Model wire_uew(boolean rot) { + Model model = ModelProvider.getModelProvider().getModel("wire_cross") .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line").uv(0, 0, 16, 16).tint().noCull() + .u("wire_line").uv(0, 0, 16, 16).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line_overlay").uv(0, 0, 16, 16).noCull() + .u("wire_line_overlay").uv(0, 0, 16, 16).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull(); + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull(); return rot ? model.uvLock().rotate(ModelRotation.X0_Y180) : model; } - private static Model redstone_nue(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_nue(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .u().uv(5, 0, 16, 11).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 11).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 11).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(270).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(270).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(270).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(270).noCull() .rotate(rot); } - private static Model redstone_une(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_une(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .u().uv(5, 0, 16, 11).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 11).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 11).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_nse(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_nse(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(5, 0, 16, 16).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull() .rotate(rot); } - private static Model redstone_uns(boolean lock, ModelRotation rot) { - Model model = ModelProvider.getModelProvider().getModel("redstone_dust_cross") + private static Model wire_uns(boolean lock, ModelRotation rot) { + Model model = ModelProvider.getModelProvider().getModel("wire_cross") .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); return lock ? model.uvLock() : model; } - private static Model redstone_nsue(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_nsue(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(5, 0, 16, 16).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(270).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(270).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(270).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(270).noCull() .rotate(rot); } - private static Model redstone_unse(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unse(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(5, 0, 16, 16).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_nuse(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_nuse(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(5, 0, 16, 16).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_unue(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unue(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .u().uv(5, 0, 16, 11).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 11).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 11).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_unusue(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unusue(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(5, 0, 16, 16).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_unusew(boolean rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unusew(boolean rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(0, 0, 16, 16).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); } - private static Model redstone_unusuew(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unusuew(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(0, 0, 16, 16).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_unuse(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unuse(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(5, 0, 16, 16).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_nusue(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_nusue(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(5, 0, 16, 16).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade() - .n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_unsew(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unsew(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(0, 0, 16, 16).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_unsuew(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unsuew(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(0, 0, 16, 16).tint().noCull() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - private static Model redstone_unsue(ModelRotation rot) { - return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() + private static Model wire_unsue(ModelRotation rot) { + return ModelProvider.getModelProvider().getModel("wire_cross").uvLock() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .u().uv(5, 0, 16, 16).tint().noCull() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade() - .u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() + .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade() - .s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() + .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade() - .w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() + .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .rotate(rot); } - public static final PropertyEnum NORTH = PropertyEnum.create("north", BlockRedstoneWire.EnumAttachPosition.class); - public static final PropertyEnum EAST = PropertyEnum.create("east", BlockRedstoneWire.EnumAttachPosition.class); - public static final PropertyEnum SOUTH = PropertyEnum.create("south", BlockRedstoneWire.EnumAttachPosition.class); - public static final PropertyEnum WEST = PropertyEnum.create("west", BlockRedstoneWire.EnumAttachPosition.class); + public static final PropertyEnum NORTH = PropertyEnum.create("north", EnumAttachPosition.class); + public static final PropertyEnum EAST = PropertyEnum.create("east", EnumAttachPosition.class); + public static final PropertyEnum SOUTH = PropertyEnum.create("south", EnumAttachPosition.class); + public static final PropertyEnum WEST = PropertyEnum.create("west", EnumAttachPosition.class); public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); private boolean canProvidePower = true; private final Set blocksNeedingUpdate = Sets.newHashSet(); - public BlockRedstoneWire() + public BlockWire() { super(Material.SMALL); - this.setDefaultState(this.getBaseState().withProperty(NORTH, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(EAST, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(SOUTH, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(WEST, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(POWER, Integer.valueOf(0))); + this.setDefaultState(this.getBaseState().withProperty(NORTH, EnumAttachPosition.NONE).withProperty(EAST, EnumAttachPosition.NONE).withProperty(SOUTH, EnumAttachPosition.NONE).withProperty(WEST, EnumAttachPosition.NONE).withProperty(POWER, Integer.valueOf(0))); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); } @@ -389,19 +387,19 @@ public class BlockRedstoneWire extends Block return state; } - private BlockRedstoneWire.EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, Facing direction) + private EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, Facing direction) { BlockPos blockpos = pos.offset(direction); Block block = worldIn.getState(pos.offset(direction)).getBlock(); - if (!canConnectTo(worldIn.getState(blockpos), direction) && (block.isBlockNormalCube() || !canConnectUpwardsTo(worldIn.getState(blockpos.down())))) + if (!this.canConnectTo(worldIn.getState(blockpos), direction) && (block.isBlockNormalCube() || !this.canConnectUpwardsTo(worldIn.getState(blockpos.down())))) { Block block1 = worldIn.getState(pos.up()).getBlock(); - return !block1.isBlockNormalCube() && block.isBlockNormalCube() && canConnectUpwardsTo(worldIn.getState(blockpos.up())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; + return !block1.isBlockNormalCube() && block.isBlockNormalCube() && this.canConnectUpwardsTo(worldIn.getState(blockpos.up())) ? EnumAttachPosition.UP : EnumAttachPosition.NONE; } else { - return BlockRedstoneWire.EnumAttachPosition.SIDE; + return EnumAttachPosition.SIDE; } } @@ -434,7 +432,7 @@ public class BlockRedstoneWire extends Block return worldIn.isBlockSolid(pos.down()) || worldIn.getState(pos.down()).getBlock() == Blocks.glowstone; } - private State updateSurroundingRedstone(World worldIn, BlockPos pos, State state) + private State updateSurroundings(World worldIn, BlockPos pos, State state) { state = this.calculateCurrentChanges(worldIn, pos, pos, state); List list = Lists.newArrayList(this.blocksNeedingUpdate); @@ -455,7 +453,7 @@ public class BlockRedstoneWire extends Block int j = 0; j = this.getMaxCurrentStrength(worldIn, pos2, j); this.canProvidePower = false; - int k = worldIn.isBlockIndirectlyGettingPowered(pos1); + int k = 0; // TODO: worldIn.isBlockIndirectlyGettingPowered(pos1); this.canProvidePower = true; if (k > 0 && k > j - 1) @@ -527,7 +525,7 @@ public class BlockRedstoneWire extends Block } /** - * Calls World.notifyNeighborsOfStateChange() for all neighboring blocks, but only if the given block is a redstone + * Calls World.notifyNeighborsOfStateChange() for all neighboring blocks, but only if the given block is a * wire. */ private void notifyWireNeighborsOfStateChange(World worldIn, BlockPos pos) @@ -547,7 +545,7 @@ public class BlockRedstoneWire extends Block { if (!worldIn.client) { - this.updateSurroundingRedstone(worldIn, pos, state); + this.updateSurroundings(worldIn, pos, state); for (Facing enumfacing : Facing.Plane.VERTICAL) { @@ -586,7 +584,7 @@ public class BlockRedstoneWire extends Block worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); } - this.updateSurroundingRedstone(worldIn, pos, state); + this.updateSurroundings(worldIn, pos, state); for (Facing enumfacing1 : Facing.Plane.HORIZONTAL) { @@ -631,7 +629,7 @@ public class BlockRedstoneWire extends Block { if (this.canPlaceBlockAt(worldIn, pos)) { - this.updateSurroundingRedstone(worldIn, pos, state); + this.updateSurroundings(worldIn, pos, state); } else { @@ -646,7 +644,7 @@ public class BlockRedstoneWire extends Block */ public Item getItemDropped(State state, Random rand, int fortune) { - return Items.redstone; + return this.getItem(); } public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) @@ -707,32 +705,32 @@ public class BlockRedstoneWire extends Block Block block = iblockstate.getBlock(); boolean flag = block.isNormalCube(); boolean flag1 = worldIn.getState(pos.up()).getBlock().isNormalCube(); - return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down()))); + return !flag1 && flag && this.canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (this.canConnectTo(iblockstate, side) ? true : /* (block == Blocks.powered_repeater && iblockstate.getValue(BlockwireDiode.FACING) == side ? true : */ !flag && this.canConnectUpwardsTo(worldIn, blockpos.down())); } - protected static boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos) + protected boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos) { - return canConnectUpwardsTo(worldIn.getState(pos)); + return this.canConnectUpwardsTo(worldIn.getState(pos)); } - protected static boolean canConnectUpwardsTo(State state) + protected boolean canConnectUpwardsTo(State state) { - return canConnectTo(state, (Facing)null); + return this.canConnectTo(state, (Facing)null); } - protected static boolean canConnectTo(State blockState, Facing side) + protected boolean canConnectTo(State blockState, Facing side) { Block block = blockState.getBlock(); - if (block == Blocks.redstone) + if (block == this) { return true; } - else if (Blocks.repeater.isAssociated(block)) - { - Facing enumfacing = (Facing)blockState.getValue(BlockRedstoneRepeater.FACING); - return enumfacing == side || enumfacing.getOpposite() == side; - } +// else if (Blocks.repeater.isAssociated(block)) +// { +// Facing enumfacing = (Facing)blockState.getValue(BlockwireRepeater.FACING); +// return enumfacing == side || enumfacing.getOpposite() == side; +// } else { return block.canProvidePower() && side != null; @@ -791,7 +789,7 @@ public class BlockRedstoneWire extends Block public Item getItem(World worldIn, BlockPos pos) { - return Items.redstone; + return this.getItem(); } public BlockLayer getBlockLayer() @@ -823,186 +821,186 @@ public class BlockRedstoneWire extends Block boolean er = state.getValue(EAST) == EnumAttachPosition.SIDE; if(ea && na && sa && wa) - return redstone_none; + return wire_none; else if(eu && nu && su && wu) - return redstone_unusueuw; + return wire_unusueuw; else if(er && nr && sr && wr) - return redstone_nsew; + return wire_nsew; else if(ea && nu && su && wa) - return redstone_unus; + return wire_unus; else if(eu && na && sa && wu) - return redstone_ueuw; + return wire_ueuw; else if(ea && nr && sa && wa) - return redstone_n(false); + return wire_n(false); else if(ea && na && sr && wa) - return redstone_n(false); + return wire_n(false); else if(er && na && sa && wa) - return redstone_n(true); + return wire_n(true); else if(ea && na && sa && wr) - return redstone_n(true); + return wire_n(true); else if(ea && nu && sa && wa) - return redstone_uns(false, ModelRotation.X0_Y0); + return wire_uns(false, ModelRotation.X0_Y0); else if(ea && na && su && wa) - return redstone_uns(true, ModelRotation.X0_Y180); + return wire_uns(true, ModelRotation.X0_Y180); else if(eu && na && sa && wa) - return redstone_uew(false); + return wire_uew(false); else if(ea && na && sa && wu) - return redstone_uew(true); + return wire_uew(true); else if(er && nr && sa && wa) - return redstone_ne(ModelRotation.X0_Y0); + return wire_ne(ModelRotation.X0_Y0); else if(er && nu && sa && wa) - return redstone_une(ModelRotation.X0_Y0); + return wire_une(ModelRotation.X0_Y0); else if(eu && nr && sa && wa) - return redstone_nue(ModelRotation.X0_Y0); + return wire_nue(ModelRotation.X0_Y0); else if(eu && nu && sa && wa) - return redstone_unue(ModelRotation.X0_Y0); + return wire_unue(ModelRotation.X0_Y0); else if(er && na && sr && wa) - return redstone_ne(ModelRotation.X0_Y90); + return wire_ne(ModelRotation.X0_Y90); else if(eu && na && sr && wa) - return redstone_une(ModelRotation.X0_Y90); + return wire_une(ModelRotation.X0_Y90); else if(er && na && su && wa) - return redstone_nue(ModelRotation.X0_Y90); + return wire_nue(ModelRotation.X0_Y90); else if(eu && na && su && wa) - return redstone_unue(ModelRotation.X0_Y90); + return wire_unue(ModelRotation.X0_Y90); else if(ea && na && sr && wr) - return redstone_ne(ModelRotation.X0_Y180); + return wire_ne(ModelRotation.X0_Y180); else if(ea && na && su && wr) - return redstone_une(ModelRotation.X0_Y180); + return wire_une(ModelRotation.X0_Y180); else if(ea && na && sr && wu) - return redstone_nue(ModelRotation.X0_Y180); + return wire_nue(ModelRotation.X0_Y180); else if(ea && na && su && wu) - return redstone_unue(ModelRotation.X0_Y180); + return wire_unue(ModelRotation.X0_Y180); else if(ea && nr && sa && wr) - return redstone_ne(ModelRotation.X0_Y270); + return wire_ne(ModelRotation.X0_Y270); else if(ea && nr && sa && wu) - return redstone_une(ModelRotation.X0_Y270); + return wire_une(ModelRotation.X0_Y270); else if(ea && nu && sa && wr) - return redstone_nue(ModelRotation.X0_Y270); + return wire_nue(ModelRotation.X0_Y270); else if(ea && nu && sa && wu) - return redstone_unue(ModelRotation.X0_Y270); + return wire_unue(ModelRotation.X0_Y270); else if(ea && nr && sr && wa) - return redstone_n(false); + return wire_n(false); else if(ea && nu && sr && wa) - return redstone_uns(false, ModelRotation.X0_Y0); + return wire_uns(false, ModelRotation.X0_Y0); else if(ea && nr && su && wa) - return redstone_uns(false, ModelRotation.X0_Y180); + return wire_uns(false, ModelRotation.X0_Y180); else if(er && na && sa && wr) - return redstone_n(true); + return wire_n(true); else if(eu && na && sa && wr) - return redstone_uns(false, ModelRotation.X0_Y90); + return wire_uns(false, ModelRotation.X0_Y90); else if(er && na && sa && wu) - return redstone_uns(false, ModelRotation.X0_Y270); + return wire_uns(false, ModelRotation.X0_Y270); else if(er && nr && sr && wa) - return redstone_nse(ModelRotation.X0_Y0); + return wire_nse(ModelRotation.X0_Y0); else if(er && nu && sr && wa) - return redstone_unse(ModelRotation.X0_Y0); + return wire_unse(ModelRotation.X0_Y0); else if(er && nr && su && wa) - return redstone_nuse(ModelRotation.X0_Y0); + return wire_nuse(ModelRotation.X0_Y0); else if(eu && nr && sr && wa) - return redstone_nsue(ModelRotation.X0_Y0); + return wire_nsue(ModelRotation.X0_Y0); else if(eu && nr && su && wa) - return redstone_nusue(ModelRotation.X0_Y0); + return wire_nusue(ModelRotation.X0_Y0); else if(er && nu && su && wa) - return redstone_unuse(ModelRotation.X0_Y0); + return wire_unuse(ModelRotation.X0_Y0); else if(eu && nu && sr && wa) - return redstone_unsue(ModelRotation.X0_Y0); + return wire_unsue(ModelRotation.X0_Y0); else if(eu && nu && su && wa) - return redstone_unusue(ModelRotation.X0_Y0); + return wire_unusue(ModelRotation.X0_Y0); else if(er && na && sr && wr) - return redstone_nse(ModelRotation.X0_Y90); + return wire_nse(ModelRotation.X0_Y90); else if(eu && na && sr && wr) - return redstone_unse(ModelRotation.X0_Y90); + return wire_unse(ModelRotation.X0_Y90); else if(er && na && sr && wu) - return redstone_nuse(ModelRotation.X0_Y90); + return wire_nuse(ModelRotation.X0_Y90); else if(er && na && su && wr) - return redstone_nsue(ModelRotation.X0_Y90); + return wire_nsue(ModelRotation.X0_Y90); else if(er && na && su && wu) - return redstone_nusue(ModelRotation.X0_Y90); + return wire_nusue(ModelRotation.X0_Y90); else if(eu && na && sr && wu) - return redstone_unuse(ModelRotation.X0_Y90); + return wire_unuse(ModelRotation.X0_Y90); else if(eu && na && su && wr) - return redstone_unsue(ModelRotation.X0_Y90); + return wire_unsue(ModelRotation.X0_Y90); else if(eu && na && su && wu) - return redstone_unusue(ModelRotation.X0_Y90); + return wire_unusue(ModelRotation.X0_Y90); else if(ea && nr && sr && wr) - return redstone_nse(ModelRotation.X0_Y180); + return wire_nse(ModelRotation.X0_Y180); else if(ea && nr && su && wr) - return redstone_unse(ModelRotation.X0_Y180); + return wire_unse(ModelRotation.X0_Y180); else if(ea && nu && sr && wr) - return redstone_nuse(ModelRotation.X0_Y180); + return wire_nuse(ModelRotation.X0_Y180); else if(ea && nr && sr && wu) - return redstone_nsue(ModelRotation.X0_Y180); + return wire_nsue(ModelRotation.X0_Y180); else if(ea && nu && sr && wu) - return redstone_nusue(ModelRotation.X0_Y180); + return wire_nusue(ModelRotation.X0_Y180); else if(ea && nu && su && wr) - return redstone_unuse(ModelRotation.X0_Y180); + return wire_unuse(ModelRotation.X0_Y180); else if(ea && nr && su && wu) - return redstone_unsue(ModelRotation.X0_Y180); + return wire_unsue(ModelRotation.X0_Y180); else if(ea && nu && su && wu) - return redstone_unusue(ModelRotation.X0_Y180); + return wire_unusue(ModelRotation.X0_Y180); else if(er && nr && sa && wr) - return redstone_nse(ModelRotation.X0_Y270); + return wire_nse(ModelRotation.X0_Y270); else if(er && nr && sa && wu) - return redstone_unse(ModelRotation.X0_Y270); + return wire_unse(ModelRotation.X0_Y270); else if(eu && nr && sa && wr) - return redstone_nuse(ModelRotation.X0_Y270); + return wire_nuse(ModelRotation.X0_Y270); else if(er && nu && sa && wr) - return redstone_nsue(ModelRotation.X0_Y270); + return wire_nsue(ModelRotation.X0_Y270); else if(eu && nu && sa && wr) - return redstone_nusue(ModelRotation.X0_Y270); + return wire_nusue(ModelRotation.X0_Y270); else if(eu && nr && sa && wu) - return redstone_unuse(ModelRotation.X0_Y270); + return wire_unuse(ModelRotation.X0_Y270); else if(er && nu && sa && wu) - return redstone_unsue(ModelRotation.X0_Y270); + return wire_unsue(ModelRotation.X0_Y270); else if(eu && nu && sa && wu) - return redstone_unusue(ModelRotation.X0_Y270); + return wire_unusue(ModelRotation.X0_Y270); else if(er && nu && sr && wr) - return redstone_unsew(ModelRotation.X0_Y0); + return wire_unsew(ModelRotation.X0_Y0); else if(er && nr && su && wr) - return redstone_unsew(ModelRotation.X0_Y180); + return wire_unsew(ModelRotation.X0_Y180); else if(eu && nr && sr && wr) - return redstone_unsew(ModelRotation.X0_Y90); + return wire_unsew(ModelRotation.X0_Y90); else if(er && nr && sr && wu) - return redstone_unsew(ModelRotation.X0_Y270); + return wire_unsew(ModelRotation.X0_Y270); else if(er && nu && su && wr) - return redstone_unusew(false); + return wire_unusew(false); else if(eu && nr && sr && wu) - return redstone_unusew(true); + return wire_unusew(true); else if(eu && nu && sr && wr) - return redstone_unsuew(ModelRotation.X0_Y0); + return wire_unsuew(ModelRotation.X0_Y0); else if(eu && nr && su && wr) - return redstone_unsuew(ModelRotation.X0_Y90); + return wire_unsuew(ModelRotation.X0_Y90); else if(er && nr && su && wu) - return redstone_unsuew(ModelRotation.X0_Y180); + return wire_unsuew(ModelRotation.X0_Y180); else if(er && nu && sr && wu) - return redstone_unsuew(ModelRotation.X0_Y270); + return wire_unsuew(ModelRotation.X0_Y270); else if(eu && nu && su && wr) - return redstone_unusuew(ModelRotation.X0_Y0); + return wire_unusuew(ModelRotation.X0_Y0); else if(eu && nr && su && wu) - return redstone_unusuew(ModelRotation.X0_Y90); + return wire_unusuew(ModelRotation.X0_Y90); else if(er && nu && su && wu) - return redstone_unusuew(ModelRotation.X0_Y180); + return wire_unusuew(ModelRotation.X0_Y180); else if(eu && nu && sr && wu) - return redstone_unusuew(ModelRotation.X0_Y270); + return wire_unusuew(ModelRotation.X0_Y270); else - return redstone_none; + return wire_none; } public Property[] getIgnoredProperties() { @@ -1010,7 +1008,7 @@ public class BlockRedstoneWire extends Block } protected Item getItemToRegister() { - return new ItemRedstone(Blocks.redstone).setDisplay("Redstone").setMaxAmount(StackSize.XL); + return new ItemWire(this); } public Property[] getUnsavedProperties() { diff --git a/common/src/main/java/common/entity/item/EntityCart.java b/common/src/main/java/common/entity/item/EntityCart.java index 862716f2..1643b9f9 100755 --- a/common/src/main/java/common/entity/item/EntityCart.java +++ b/common/src/main/java/common/entity/item/EntityCart.java @@ -1,7 +1,6 @@ package common.entity.item; -import common.block.tech.BlockRailBase; -import common.block.tech.BlockRailPowered; +import common.block.tech.BlockRail; import common.entity.DamageSource; import common.entity.Entity; import common.entity.types.EntityLiving; @@ -247,7 +246,7 @@ public abstract class EntityCart extends Entity int l = ExtMath.floord(this.posY); int i1 = ExtMath.floord(this.posZ); - if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(k, l - 1, i1))) + if (BlockRail.isRailBlock(this.worldObj, new BlockPos(k, l - 1, i1))) { --l; } @@ -255,14 +254,14 @@ public abstract class EntityCart extends Entity BlockPos blockpos = new BlockPos(k, l, i1); State iblockstate = this.worldObj.getState(blockpos); - if (BlockRailBase.isRailBlock(iblockstate)) + if (BlockRail.isRailBlock(iblockstate)) { - this.func_180460_a(blockpos, iblockstate); + this.moveRailedCart(blockpos, iblockstate); - if (iblockstate.getBlock() == Blocks.activator_rail) - { - this.onActivatorRailPass(k, l, i1, ((Boolean)iblockstate.getValue(BlockRailPowered.POWERED)).booleanValue()); - } +// if (iblockstate.getBlock() == Blocks.activator_rail) // TODO: activation +// { +// this.onActivatorRailPass(k, l, i1, ((Boolean)iblockstate.getValue(BlockRailPowered.POWERED)).booleanValue()); +// } } else { @@ -358,23 +357,23 @@ public abstract class EntityCart extends Entity } - protected void func_180460_a(BlockPos p_180460_1_, State p_180460_2_) + protected void moveRailedCart(BlockPos pos, State state) { this.fallDistance = 0.0F; Vec3 vec3 = this.func_70489_a(this.posX, this.posY, this.posZ); - this.posY = (double)p_180460_1_.getY(); - boolean flag = false; - boolean flag1 = false; - BlockRailBase blockrailbase = (BlockRailBase)p_180460_2_.getBlock(); + this.posY = (double)pos.getY(); + boolean accel = false; + boolean brake = false; + BlockRail blockrailbase = (BlockRail)state.getBlock(); - if (blockrailbase == Blocks.golden_rail) + if (true) // TODO: power! { - flag = ((Boolean)p_180460_2_.getValue(BlockRailPowered.POWERED)).booleanValue(); - flag1 = !flag; + accel = true; // ((Boolean)state.getValue(BlockRailPowered.POWERED)).booleanValue(); + brake = !accel; } double d0 = 0.0078125D; - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.getValue(blockrailbase.getShapeProperty()); + BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)state.getValue(BlockRail.SHAPE); switch (blockrailbase$enumraildirection) { @@ -434,12 +433,12 @@ public abstract class EntityCart extends Entity { this.motionX += d7 * 0.1D; this.motionZ += d8 * 0.1D; - flag1 = false; + brake = false; } } } - if (flag1) + if (brake) { double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); @@ -458,22 +457,22 @@ public abstract class EntityCart extends Entity } double d18 = 0.0D; - double d19 = (double)p_180460_1_.getX() + 0.5D + (double)aint[0][0] * 0.5D; - double d20 = (double)p_180460_1_.getZ() + 0.5D + (double)aint[0][2] * 0.5D; - double d21 = (double)p_180460_1_.getX() + 0.5D + (double)aint[1][0] * 0.5D; - double d10 = (double)p_180460_1_.getZ() + 0.5D + (double)aint[1][2] * 0.5D; + double d19 = (double)pos.getX() + 0.5D + (double)aint[0][0] * 0.5D; + double d20 = (double)pos.getZ() + 0.5D + (double)aint[0][2] * 0.5D; + double d21 = (double)pos.getX() + 0.5D + (double)aint[1][0] * 0.5D; + double d10 = (double)pos.getZ() + 0.5D + (double)aint[1][2] * 0.5D; d1 = d21 - d19; d2 = d10 - d20; if (d1 == 0.0D) { - this.posX = (double)p_180460_1_.getX() + 0.5D; - d18 = this.posZ - (double)p_180460_1_.getZ(); + this.posX = (double)pos.getX() + 0.5D; + d18 = this.posZ - (double)pos.getZ(); } else if (d2 == 0.0D) { - this.posZ = (double)p_180460_1_.getZ() + 0.5D; - d18 = this.posX - (double)p_180460_1_.getX(); + this.posZ = (double)pos.getZ() + 0.5D; + d18 = this.posX - (double)pos.getX(); } else { @@ -499,11 +498,11 @@ public abstract class EntityCart extends Entity d23 = ExtMath.clampd(d23, -d13, d13); this.moveEntity(d22, 0.0D, d23); - if (aint[0][1] != 0 && ExtMath.floord(this.posX) - p_180460_1_.getX() == aint[0][0] && ExtMath.floord(this.posZ) - p_180460_1_.getZ() == aint[0][2]) + if (aint[0][1] != 0 && ExtMath.floord(this.posX) - pos.getX() == aint[0][0] && ExtMath.floord(this.posZ) - pos.getZ() == aint[0][2]) { this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); } - else if (aint[1][1] != 0 && ExtMath.floord(this.posX) - p_180460_1_.getX() == aint[1][0] && ExtMath.floord(this.posZ) - p_180460_1_.getZ() == aint[1][2]) + else if (aint[1][1] != 0 && ExtMath.floord(this.posX) - pos.getX() == aint[1][0] && ExtMath.floord(this.posZ) - pos.getZ() == aint[1][2]) { this.setPosition(this.posX, this.posY + (double)aint[1][1], this.posZ); } @@ -528,14 +527,14 @@ public abstract class EntityCart extends Entity int j = ExtMath.floord(this.posX); int i = ExtMath.floord(this.posZ); - if (j != p_180460_1_.getX() || i != p_180460_1_.getZ()) + if (j != pos.getX() || i != pos.getZ()) { d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.motionX = d5 * (double)(j - p_180460_1_.getX()); - this.motionZ = d5 * (double)(i - p_180460_1_.getZ()); + this.motionX = d5 * (double)(j - pos.getX()); + this.motionZ = d5 * (double)(i - pos.getZ()); } - if (flag) + if (accel) { double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); @@ -545,24 +544,24 @@ public abstract class EntityCart extends Entity this.motionX += this.motionX / d15 * d16; this.motionZ += this.motionZ / d15 * d16; } - else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) + else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.EAST_WEST) { - if (this.worldObj.getState(p_180460_1_.west()).getBlock().isNormalCube()) + if (this.worldObj.getState(pos.west()).getBlock().isNormalCube()) { this.motionX = 0.02D; } - else if (this.worldObj.getState(p_180460_1_.east()).getBlock().isNormalCube()) + else if (this.worldObj.getState(pos.east()).getBlock().isNormalCube()) { this.motionX = -0.02D; } } - else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) + else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.NORTH_SOUTH) { - if (this.worldObj.getState(p_180460_1_.north()).getBlock().isNormalCube()) + if (this.worldObj.getState(pos.north()).getBlock().isNormalCube()) { this.motionZ = 0.02D; } - else if (this.worldObj.getState(p_180460_1_.south()).getBlock().isNormalCube()) + else if (this.worldObj.getState(pos.south()).getBlock().isNormalCube()) { this.motionZ = -0.02D; } @@ -605,16 +604,16 @@ public abstract class EntityCart extends Entity int j = ExtMath.floord(p_70495_3_); int k = ExtMath.floord(p_70495_5_); - if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) + if (BlockRail.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) { --j; } State iblockstate = this.worldObj.getState(new BlockPos(i, j, k)); - if (BlockRailBase.isRailBlock(iblockstate)) + if (BlockRail.isRailBlock(iblockstate)) { - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()); + BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)iblockstate.getValue(BlockRail.SHAPE); p_70495_3_ = (double)j; if (blockrailbase$enumraildirection.isAscending()) @@ -654,16 +653,16 @@ public abstract class EntityCart extends Entity int j = ExtMath.floord(p_70489_3_); int k = ExtMath.floord(p_70489_5_); - if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) + if (BlockRail.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) { --j; } State iblockstate = this.worldObj.getState(new BlockPos(i, j, k)); - if (BlockRailBase.isRailBlock(iblockstate)) + if (BlockRail.isRailBlock(iblockstate)) { - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()); + BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)iblockstate.getValue(BlockRail.SHAPE); int[][] aint = matrix[blockrailbase$enumraildirection.ordinal()]; double d0 = 0.0D; double d1 = (double)i + 0.5D + (double)aint[0][0] * 0.5D; diff --git a/common/src/main/java/common/entity/item/EntityLeashKnot.java b/common/src/main/java/common/entity/item/EntityLeashKnot.java index 34c71766..c53e51e5 100755 --- a/common/src/main/java/common/entity/item/EntityLeashKnot.java +++ b/common/src/main/java/common/entity/item/EntityLeashKnot.java @@ -133,48 +133,6 @@ public class EntityLeashKnot extends Entity } } -// /** -// * checks to make sure painting can be placed there -// */ -// public boolean onValidSurface() -// { -// if (!this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty()) -// { -// return false; -// } -// else -// { -// int i = Math.max(1, this.getWidthPixels() / 16); -// int j = Math.max(1, this.getHeightPixels() / 16); -// BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite()); -// Facing enumfacing = this.facingDirection.rotateYCCW(); -// -// for (int k = 0; k < i; ++k) -// { -// for (int l = 0; l < j; ++l) -// { -// BlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l); -// Block block = this.worldObj.getState(blockpos1).getBlock(); -// -// if (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block)) -// { -// return false; -// } -// } -// } -// -// for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox())) -// { -// if (entity instanceof EntityLeashKnot) -// { -// return false; -// } -// } -// -// return true; -// } -// } - /** * Returns true if other Entities should be prevented from moving through this Entity. */ diff --git a/common/src/main/java/common/entity/item/EntityTntCart.java b/common/src/main/java/common/entity/item/EntityTntCart.java index 4b6672f5..5c956ae1 100755 --- a/common/src/main/java/common/entity/item/EntityTntCart.java +++ b/common/src/main/java/common/entity/item/EntityTntCart.java @@ -1,6 +1,6 @@ package common.entity.item; -import common.block.tech.BlockRailBase; +import common.block.tech.BlockRail; import common.entity.DamageSource; import common.entity.Entity; import common.entity.EntityType; @@ -198,12 +198,12 @@ public class EntityTntCart extends EntityCart */ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, State blockStateIn) { - return !this.isIgnited() || !BlockRailBase.isRailBlock(blockStateIn) && !BlockRailBase.isRailBlock(worldIn, pos.up()) ? super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn) : 0.0F; + return !this.isIgnited() || !BlockRail.isRailBlock(blockStateIn) && !BlockRail.isRailBlock(worldIn, pos.up()) ? super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn) : 0.0F; } public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, State blockStateIn, float p_174816_5_) { - return !this.isIgnited() || !BlockRailBase.isRailBlock(blockStateIn) && !BlockRailBase.isRailBlock(worldIn, pos.up()) ? super.verifyExplosion(explosionIn, worldIn, pos, blockStateIn, p_174816_5_) : false; + return !this.isIgnited() || !BlockRail.isRailBlock(blockStateIn) && !BlockRail.isRailBlock(worldIn, pos.up()) ? super.verifyExplosion(explosionIn, worldIn, pos, blockStateIn, p_174816_5_) : false; } protected void readEntity(TagObject tagCompund) diff --git a/common/src/main/java/common/entity/npc/EntityNPC.java b/common/src/main/java/common/entity/npc/EntityNPC.java index 0580a779..0d1ef854 100755 --- a/common/src/main/java/common/entity/npc/EntityNPC.java +++ b/common/src/main/java/common/entity/npc/EntityNPC.java @@ -66,6 +66,7 @@ import common.item.tool.ItemArmor; import common.item.tool.ItemBow; import common.item.tool.ItemGunBase; import common.item.tool.ItemHoe; +import common.item.tool.ItemKey; import common.item.tool.ItemPotion; import common.item.tool.ItemShears; import common.item.tool.ItemSword; @@ -4138,7 +4139,7 @@ public abstract class EntityNPC extends EntityLiving public boolean canOpen(String code) { ItemStack stack = this.getCurrentEquippedItem(); - return stack != null && stack.getItem() == Items.key && + return stack != null && stack.getItem() instanceof ItemKey && stack.hasDisplayName() && stack.getDisplayName().equals(code); } diff --git a/common/src/main/java/common/init/BlockRegistry.java b/common/src/main/java/common/init/BlockRegistry.java index 1f23d782..f8bcab09 100755 --- a/common/src/main/java/common/init/BlockRegistry.java +++ b/common/src/main/java/common/init/BlockRegistry.java @@ -11,7 +11,7 @@ import common.block.artificial.BlockBed; import common.block.artificial.BlockBookshelf; import common.block.artificial.BlockCake; import common.block.artificial.BlockCarpet; -import common.block.artificial.BlockCompressedPowered; +import common.block.artificial.BlockMagnetic; import common.block.artificial.BlockDoor; import common.block.artificial.BlockDragonEgg; import common.block.artificial.BlockFence; @@ -82,7 +82,6 @@ import common.block.natural.BlockObsidian; import common.block.natural.BlockOre; import common.block.natural.BlockPackedIce; import common.block.natural.BlockPodzol; -import common.block.natural.BlockRedstoneOre; import common.block.natural.BlockSandStone; import common.block.natural.BlockSlime; import common.block.natural.BlockSnow; @@ -116,18 +115,14 @@ import common.block.tech.BlockPistonMoving; import common.block.tech.BlockPressurePlate; import common.block.tech.BlockPressurePlateWeighted; import common.block.tech.BlockRail; -import common.block.tech.BlockRailDetector; -import common.block.tech.BlockRailPowered; -import common.block.tech.BlockRedstoneComparator; -import common.block.tech.BlockRedstoneLight; -import common.block.tech.BlockRedstoneRepeater; -import common.block.tech.BlockRedstoneTorch; -import common.block.tech.BlockRedstoneWire; +import common.block.tech.BlockToggleableLight; +import common.block.tech.BlockLitTorch; +import common.block.tech.BlockWire; import common.block.tech.BlockTNT; import common.block.tech.BlockTianReactor; -import common.block.tech.BlockTorch; import common.block.tech.BlockTripWire; import common.block.tech.BlockTripWireHook; +import common.block.tech.BlockUnlitTorch; import common.block.tech.BlockWarpChest; import common.block.tech.BlockWorkbench; import common.block.tile.BlockStandingSign; @@ -317,11 +312,9 @@ public abstract class BlockRegistry { .setDisplay("Quarzerz")); register("black_quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) .setDisplay("Schwarzes Quarzerz")); - - register("redstone_ore", (new BlockRedstoneOre(false)).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) - .setDisplay("Redstone-Erz").setTab(CheatTab.GEMS).setMiningLevel(2)); - register("lit_redstone_ore", (new BlockRedstoneOre(true)).setLightLevel(0.625F).setHardness(3.0F).setResistance(5.0F) - .setStepSound(SoundType.STONE).setDisplay("Redstone-Erz").setMiningLevel(2)); + register("charge_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) + .setDisplay("Geladenes Erz").setMiningLevel(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) @@ -414,8 +407,8 @@ public abstract class BlockRegistry { .setStepSound(SoundType.STONE).setDisplay("Lapislazuliblock").setTab(CheatTab.GEMS).setMiningLevel(1)); register("emerald_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) .setStepSound(SoundType.STONE).setDisplay("Smaragdblock").setTab(CheatTab.GEMS).setMiningLevel(2)); - register("redstone_block", (new BlockCompressedPowered(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) - .setStepSound(SoundType.STONE).setDisplay("Redstone-Block").setTab(CheatTab.TECHNOLOGY)); + register("charged_block", (new BlockMagnetic(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) + .setStepSound(SoundType.STONE).setDisplay("Geladener Block").setTab(CheatTab.GEMS)); register("glass", (new BlockGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glas")); for(DyeColor color : DyeColor.values()) { @@ -439,9 +432,6 @@ public abstract class BlockRegistry { } register("ladder", (new BlockLadder()).setHardness(0.4F).setStepSound(SoundType.LADDER).setDisplay("Leiter").setAxeHarvestable()); - register("torch", (new BlockTorch()).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(SoundType.WOOD).setDisplay("Fackel")); - register("lamp", (new Block(Material.TRANSLUCENT)).setHardness(0.3F).setStepSound(SoundType.GLASS).setLightLevel(1.0F) - .setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY)); register("bookshelf", (new BlockBookshelf()).setHardness(1.5F).setStepSound(SoundType.WOOD).setDisplay("Bücherregal")); register("cake", (new BlockCake()).setHardness(0.5F).setStepSound(SoundType.CLOTH).setDisplay("Kuchen")); register("dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(SoundType.STONE) @@ -645,9 +635,6 @@ public abstract class BlockRegistry { register("tian_reactor", (new BlockTianReactor()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Tianreaktor")); register("rail", (new BlockRail()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Schiene").setMiningLevel(0)); - register("golden_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Antriebsschiene").setMiningLevel(0)); - register("detector_rail", (new BlockRailDetector()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Sensorschiene").setMiningLevel(0)); - register("activator_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Aktivierungsschiene").setMiningLevel(0)); register("lever", (new BlockLever()).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Hebel")); @@ -664,18 +651,21 @@ public abstract class BlockRegistry { register("wooden_button", (new BlockButton(true, 30, "oak_planks")).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Knopf")); register("red_button", (new BlockButton(true, 10, "red_button")).setHardness(0.5F).setStepSound(SoundType.STONE).setDisplay("Knopf")); - register("redstone", (new BlockRedstoneWire()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Redstone-Staub")); - register("unlit_redstone_torch", (new BlockRedstoneTorch(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Fackel")); - register("redstone_torch", (new BlockRedstoneTorch(true)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(SoundType.WOOD) - .setDisplay("Redstone-Fackel").setTab(CheatTab.TECHNOLOGY)); - register("repeater", (new BlockRedstoneRepeater(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Verstärker")); - register("powered_repeater", (new BlockRedstoneRepeater(true)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Verstärker")); - register("comparator", (new BlockRedstoneComparator(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Komparator")); - register("powered_comparator", (new BlockRedstoneComparator(true)).setHardness(0.0F).setLightLevel(0.625F) - .setStepSound(SoundType.WOOD).setDisplay("Redstone-Komparator")); - register("redstone_lamp", (new BlockRedstoneLight(false)).setHardness(0.3F).setStepSound(SoundType.GLASS) - .setDisplay("Redstone-Lampe").setTab(CheatTab.TECHNOLOGY)); - register("lit_redstone_lamp", (new BlockRedstoneLight(true)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Redstone-Lampe")); + register("wire", (new BlockWire()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Kabel")); + BlockUnlitTorch torch; + register("torch", (torch = new BlockUnlitTorch(0xffffffff)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Fackel")); + register("lit_torch", (new BlockLitTorch(torch)).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(SoundType.WOOD).setDisplay("Fackel")); + BlockUnlitTorch tianTorch; + register("tian_torch", (tianTorch = new BlockUnlitTorch(0x7f00ff)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Tian-Fackel")); + register("lit_tian_torch", (new BlockLitTorch(tianTorch)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(SoundType.WOOD) + .setDisplay("Tian-Fackel")); + BlockUnlitTorch soulTorch; + register("soul_torch", (soulTorch = new BlockUnlitTorch(0x1f1fff)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Seelenfackel")); + register("lit_soul_torch", (new BlockLitTorch(soulTorch)).setHardness(0.0F).setLightLevel(0.75F).setStepSound(SoundType.WOOD) + .setDisplay("Seelenfackel")); + register("lamp", (new BlockToggleableLight(false)).setHardness(0.3F).setStepSound(SoundType.GLASS) + .setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY)); + register("lit_lamp", (new BlockToggleableLight(true)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Lampe")); register("daylight_detector", new BlockDaylightDetector(false).setDisplay("Tageslichtsensor")); register("daylight_detector_inverted", new BlockDaylightDetector(true).setDisplay("Tageslichtsensor")); register("tripwire_hook", (new BlockTripWireHook()).setDisplay("Haken")); diff --git a/common/src/main/java/common/init/Blocks.java b/common/src/main/java/common/init/Blocks.java index f1edf0b1..5bc7f8d8 100755 --- a/common/src/main/java/common/init/Blocks.java +++ b/common/src/main/java/common/init/Blocks.java @@ -35,7 +35,6 @@ public abstract class Blocks { public static final BlockSlab acacia_slab = get("acacia_slab"); public static final BlockStairs acacia_stairs = get("acacia_stairs"); public static final BlockStaticLiquid acid = get("acid"); - public static final BlockRailPowered activator_rail = get("activator_rail"); public static final BlockFlower allium = get("allium"); public static final Block aluminium_block = get("aluminium_block"); public static final BlockOre aluminium_ore = get("aluminium_ore"); @@ -166,7 +165,6 @@ public abstract class Blocks { public static final BlockStairs cobblestone_stairs = get("cobblestone_stairs"); public static final BlockWall cobblestone_wall = get("cobblestone_wall"); public static final BlockCocoa cocoa = get("cocoa"); - public static final BlockRedstoneComparator comparator = get("comparator"); public static final BlockWorkbench construction_table = get("construction_table"); public static final Block copper_block = get("copper_block"); public static final BlockOre copper_ore = get("copper_ore"); @@ -196,7 +194,6 @@ public abstract class Blocks { public static final BlockDaylightDetector daylight_detector_inverted = get("daylight_detector_inverted"); public static final BlockTallGrass dead_bush = get("dead_bush"); public static final BlockDeadBush deadbush = get("deadbush"); - public static final BlockRailDetector detector_rail = get("detector_rail"); public static final Block diamond_block = get("diamond_block"); public static final BlockOre diamond_ore = get("diamond_ore"); public static final Block dirt = get("dirt"); @@ -246,7 +243,6 @@ public abstract class Blocks { public static final BlockGlowstone glowstone = get("glowstone"); public static final Block gold_block = get("gold_block"); public static final BlockOre gold_ore = get("gold_ore"); - public static final BlockRailPowered golden_rail = get("golden_rail"); public static final BlockStaticLiquid goo = get("goo"); public static final BlockGrass grass = get("grass"); public static final BlockGravel gravel = get("gravel"); @@ -291,7 +287,6 @@ public abstract class Blocks { public static final BlockSlab jungle_slab = get("jungle_slab"); public static final BlockStairs jungle_stairs = get("jungle_stairs"); public static final BlockLadder ladder = get("ladder"); - public static final Block lamp = get("lamp"); public static final Block lapis_block = get("lapis_block"); public static final BlockOre lapis_ore = get("lapis_ore"); public static final BlockDoublePlant large_fern = get("large_fern"); @@ -313,8 +308,6 @@ public abstract class Blocks { public static final BlockWool lime_wool = get("lime_wool"); public static final BlockFurnace lit_furnace = get("lit_furnace"); public static final BlockPumpkin lit_pumpkin = get("lit_pumpkin"); - public static final BlockRedstoneLight lit_redstone_lamp = get("lit_redstone_lamp"); - public static final BlockRedstoneOre lit_redstone_ore = get("lit_redstone_ore"); public static final Block lithium_block = get("lithium_block"); public static final BlockOre lithium_ore = get("lithium_ore"); public static final BlockCarpet magenta_carpet = get("magenta_carpet"); @@ -407,8 +400,6 @@ public abstract class Blocks { public static final Block potassium_block = get("potassium_block"); public static final BlockOre potassium_ore = get("potassium_ore"); public static final BlockPotato potato = get("potato"); - public static final BlockRedstoneComparator powered_comparator = get("powered_comparator"); - public static final BlockRedstoneRepeater powered_repeater = get("powered_repeater"); public static final Block praseodymium_block = get("praseodymium_block"); public static final BlockOre praseodymium_ore = get("praseodymium_ore"); public static final BlockPumpkin pumpkin = get("pumpkin"); @@ -439,13 +430,9 @@ public abstract class Blocks { public static final BlockFalling red_sand = get("red_sand"); public static final BlockFlower red_tulip = get("red_tulip"); public static final BlockWool red_wool = get("red_wool"); - public static final BlockRedstoneWire redstone = get("redstone"); - public static final BlockCompressedPowered redstone_block = get("redstone_block"); - public static final BlockRedstoneLight redstone_lamp = get("redstone_lamp"); - public static final BlockRedstoneOre redstone_ore = get("redstone_ore"); - public static final BlockRedstoneTorch redstone_torch = get("redstone_torch"); + public static final BlockMagnetic charged_block = get("charged_block"); + public static final BlockOre charge_ore = get("charge_ore"); public static final BlockReed reeds = get("reeds"); - public static final BlockRedstoneRepeater repeater = get("repeater"); public static final Block rock = get("rock"); public static final BlockFlower rose = get("rose"); public static final BlockDoublePlant rose_bush = get("rose_bush"); @@ -539,12 +526,10 @@ public abstract class Blocks { public static final BlockTNT tnt_5 = get("tnt_5"); public static final BlockTNT tnt_6 = get("tnt_6"); public static final BlockTNT tnt_7 = get("tnt_7"); - public static final BlockTorch torch = get("torch"); public static final BlockTrapDoor trapdoor = get("trapdoor"); public static final BlockTripWireHook tripwire_hook = get("tripwire_hook"); public static final Block tungsten_block = get("tungsten_block"); public static final BlockOre tungsten_ore = get("tungsten_ore"); - public static final BlockRedstoneTorch unlit_redstone_torch = get("unlit_redstone_torch"); public static final Block uranium_block = get("uranium_block"); public static final BlockOre uranium_ore = get("uranium_ore"); public static final Block vanadium_block = get("vanadium_block"); @@ -599,6 +584,15 @@ public abstract class Blocks { public static final BlockChest xlarge_chest = get("xlarge_chest"); public static final BlockChest xxlarge_chest = get("xxlarge_chest"); public static final BlockChest xxxlarge_chest = get("xxxlarge_chest"); + public static final BlockUnlitTorch torch = get("torch"); + public static final BlockLitTorch lit_torch = get("lit_torch"); + public static final BlockUnlitTorch tian_torch = get("tian_torch"); + public static final BlockLitTorch lit_tian_torch = get("lit_tian_torch"); + public static final BlockUnlitTorch soul_torch = get("soul_torch"); + public static final BlockLitTorch lit_soul_torch = get("lit_soul_torch"); + public static final BlockToggleableLight lamp = get("lamp"); + public static final BlockToggleableLight lit_lamp = get("lit_lamp"); + public static final BlockWire wire = get("wire"); private static T get(String id) { T block = (T)BlockRegistry.byNameExact(id); diff --git a/common/src/main/java/common/init/CraftingRegistry.java b/common/src/main/java/common/init/CraftingRegistry.java index 7243c871..5e816ae6 100755 --- a/common/src/main/java/common/init/CraftingRegistry.java +++ b/common/src/main/java/common/init/CraftingRegistry.java @@ -33,7 +33,7 @@ public abstract class CraftingRegistry private static final Object[][] COMPRESSED = new Object[][] { {Items.emerald_block, new ItemStack(Items.emerald, 9)}, {Items.lapis_block, new ItemStack(Items.lapis_lazuli, 9)}, - {Items.redstone_block, new ItemStack(Items.redstone, 9)}, + {Items.charged_block, new ItemStack(Items.charged_powder, 9)}, {Items.coal_block, new ItemStack(Items.coal, 9)}, {Items.hay_block, new ItemStack(Items.wheats, 9)}, {Items.slime_block, new ItemStack(Items.slime_ball, 9)} @@ -153,12 +153,11 @@ public abstract class CraftingRegistry addShapeless(new ItemStack(Items.mossy_cobblestone), Items.cobblestone, Items.vine); add(new ItemStack(Items.iron_bars, 16), "###", "###", '#', Items.iron_ingot); add(new ItemStack(Items.glass_pane, 16), "###", "###", '#', Items.glass); - add(new ItemStack(Items.redstone_lamp, 1), " R ", "RGR", " R ", 'R', Items.redstone, 'G', Items.glowstone); + add(new ItemStack(Items.lamp, 1), " R ", "RGR", " R ", 'R', Items.charged_powder, 'G', Items.glowstone); + add(new ItemStack(Items.lamp, 1), " R ", "RGR", " R ", 'R', Items.glass, 'G', Items.glowstone); add(new ItemStack(Items.effect_generator, 1), "GGG", "GSG", "OOO", 'G', Items.glass, 'S', Items.charge_crystal, 'O', Items.obsidian); add(new ItemStack(Items.blood_brick, 1), "NN", "NN", 'N', Items.bloodbrick); add(new ItemStack(Items.coarse_dirt, 4), "DG", "GD", 'D', Items.dirt, 'G', Items.gravel); - - add(new ItemStack(Items.lamp, 1), " R ", "RGR", " R ", 'R', Items.glass, 'G', Items.glowstone); for (DyeColor color : DyeColor.values()) { @@ -235,7 +234,7 @@ public abstract class CraftingRegistry add(new ItemStack(Items.tripwire_hook, 2), "I", "S", "#", '#', planks, 'S', Items.stick, 'I', Items.iron_ingot); add(new ItemStack(Items.wooden_button, 1), "#", '#', planks); add(new ItemStack(Items.wooden_pressure_plate, 1), "##", '#', planks); - add(new ItemStack(Items.piston, 1), "TTT", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.iron_ingot, 'R', Items.redstone, 'T', planks); + add(new ItemStack(Items.piston, 1), "TTT", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.iron_ingot, 'R', Items.charged_powder, 'T', planks); for(DyeColor color : BlockBed.COLORS) { add(new ItemStack(ItemRegistry.byName(color.getName() + "_bed"), 1), "###", "XXX", '#', BlockWool.getByColor(color).getItem(), 'X', planks); } @@ -275,9 +274,6 @@ public abstract class CraftingRegistry add(new ItemStack(Items.torch, 4), "X", "#", 'X', Items.charcoal, '#', Items.stick); add(new ItemStack(Items.glass_bottle, 3), "# #", " # ", '#', Items.glass); add(new ItemStack(Items.rail, 16), "X X", "X#X", "X X", 'X', Items.iron_ingot, '#', Items.stick); - add(new ItemStack(Items.golden_rail, 6), "X X", "X#X", "XRX", 'X', Items.gold_ingot, 'R', Items.redstone, '#', Items.stick); - add(new ItemStack(Items.activator_rail, 6), "XSX", "X#X", "XSX", 'X', Items.iron_ingot, '#', Items.redstone_torch, 'S', Items.stick); - add(new ItemStack(Items.detector_rail, 6), "X X", "X#X", "XRX", 'X', Items.iron_ingot, 'R', Items.redstone, '#', Items.stone_pressure_plate); add(new ItemStack(Items.minecart, 1), "# #", "###", '#', Items.iron_ingot); add(new ItemStack(Items.cauldron, 1), "# #", "# #", "###", '#', Items.iron_ingot); add(new ItemStack(Items.brewing_stand, 1), " B ", "###", '#', Items.cobblestone, 'B', Items.demon_rod); @@ -301,16 +297,13 @@ public abstract class CraftingRegistry add(new ItemStack(Items.golden_carrot, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.carrot); add(new ItemStack(Items.speckled_melon, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.melon); add(new ItemStack(Items.lever, 1), "X", "#", '#', Items.cobblestone, 'X', Items.stick); - add(new ItemStack(Items.redstone_torch, 1), "X", "#", '#', Items.stick, 'X', Items.redstone); - add(new ItemStack(Items.repeater, 1), "#X#", "III", '#', Items.redstone_torch, 'X', Items.redstone, 'I', Items.stone); - add(new ItemStack(Items.comparator, 1), " # ", "#X#", "III", '#', Items.redstone_torch, 'X', Items.quartz, 'I', Items.stone); - add(new ItemStack(Items.navigator, 1), " # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.redstone); + add(new ItemStack(Items.navigator, 1), " # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.charged_powder); add(new ItemStack(Items.stone_button, 1), "#", '#', Items.stone); add(new ItemStack(Items.stone_pressure_plate, 1), "##", '#', Items.stone); add(new ItemStack(Items.heavy_weighted_pressure_plate, 1), "##", '#', Items.iron_ingot); add(new ItemStack(Items.light_weighted_pressure_plate, 1), "##", '#', Items.gold_ingot); - add(new ItemStack(Items.dispenser, 1), "###", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.bow, 'R', Items.redstone); - add(new ItemStack(Items.dropper, 1), "###", "# #", "#R#", '#', Items.cobblestone, 'R', Items.redstone); + add(new ItemStack(Items.dispenser, 1), "###", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.bow, 'R', Items.charged_powder); + add(new ItemStack(Items.dropper, 1), "###", "# #", "#R#", '#', Items.cobblestone, 'R', Items.charged_powder); add(new ItemStack(Items.sticky_piston, 1), "S", "P", 'S', Items.slime_ball, 'P', Items.piston); add(new ItemStack(Items.enchanting_table, 1), " B ", "D#D", "###", '#', Items.obsidian, 'B', Items.book, 'D', Items.diamond); add(new ItemStack(Items.anvil, 1), "III", " i ", "iii", 'I', Items.iron_block, 'i', Items.iron_ingot); @@ -334,9 +327,9 @@ public abstract class CraftingRegistry add(new ItemStack(Items.mob_spawner, 1), "###", "#X#", "###", 'X', Items.charge_crystal, '#', Items.iron_bars); add(new ItemStack(Items.dragon_egg, 1), "###", "#X#", "#D#", 'X', Items.charge_crystal, 'D', Items.diamond, '#', Items.obsidian); - add(new ItemStack(Items.red_button, 1), "#", '#', Items.redstone); + add(new ItemStack(Items.red_button, 1), "#", '#', Items.charged_powder); add(new ItemStack(Items.chick_magnet, 1), "A A", "N N", " C ", 'A', Items.aluminium_ingot, 'N', Items.nickel_ingot, 'C', Items.cobalt_ingot); - add(new ItemStack(Items.magnet, 1), "I I", "N N", " R ", 'I', Items.iron_ingot, 'N', Items.neodymium_ingot, 'R', Items.redstone); + add(new ItemStack(Items.magnet, 1), "I I", "N N", " R ", 'I', Items.iron_ingot, 'N', Items.neodymium_ingot, 'R', Items.charged_powder); add(new ItemStack(Items.construction_table), "---", "-#-", "---", '#', Items.workbench, '-', Items.iron_ingot); add(new ItemStack(Items.bedrock), "#####", "#####", "#####", "#####", "#####", '#', Items.obsidian); diff --git a/common/src/main/java/common/init/ItemRegistry.java b/common/src/main/java/common/init/ItemRegistry.java index 5fc11d11..a5a1765d 100755 --- a/common/src/main/java/common/init/ItemRegistry.java +++ b/common/src/main/java/common/init/ItemRegistry.java @@ -207,7 +207,15 @@ public abstract class ItemRegistry { register("scanner", (new ItemScanner()).setDisplay("Infowerkzeug")); register("trident", (new ItemTrident()).setDisplay("Geladenes Zepter")); register("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung")); - register("key", (new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); + ItemKey key; + register("key", (key = new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); + register("black_key", (new ItemKey()).setDisplay("Schwarzer Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); + register("shiny_key", (new ItemKey()).setDisplay("Glänzender Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); + register("rusty_key", (new ItemKey()).setDisplay("Rostiger Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); + register("red_keycard", (new ItemKey()).setDisplay("Rote Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); + register("green_keycard", (new ItemKey()).setDisplay("Grüne Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); + register("blue_keycard", (new ItemKey()).setDisplay("Blaue Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); + register("black_keycard", (new ItemKey()).setDisplay("Schwarze Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); for(Pair sides : ItemDie.DIE_SIDES) { register("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setMaxAmount(StackSize.L)); } @@ -335,6 +343,8 @@ public abstract class ItemRegistry { register("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(TextColor.RED)); } register("chain", (new ItemMagnetic()).setDisplay("Kette").setTab(CheatTab.MATERIALS)); + Item chargedPowder = (new ItemMagnetic()).setDisplay("Geladener Staub").setTab(CheatTab.METALS); + register("charged_powder", chargedPowder); for(OreType ore : OreType.values()) { Item itm = (new Item()).setDisplay(ore.itemDisplay).setTab(CheatTab.METALS); @@ -376,11 +386,14 @@ public abstract class ItemRegistry { register("record_delay", (new ItemRecord()).setDisplay("Protokoll #13 - Verzögerung der Umsetzung")); register("record_extend", (new ItemRecord()).setDisplay("Protokoll #14 - Explosive Erweiterung unseres Labors")); - ((BlockOre)BlockRegistry.byName("coal_ore")).setDropItem(new ItemStack(coal), 0); - ((BlockOre)BlockRegistry.byName("emerald_ore")).setDropItem(new ItemStack(emerald), 3); - ((BlockOre)BlockRegistry.byName("lapis_ore")).setDropItem(new ItemStack(lapis, 4), 4, 2); - ((BlockOre)BlockRegistry.byName("quartz_ore")).setDropItem(new ItemStack(quartz), 2); - ((BlockOre)BlockRegistry.byName("black_quartz_ore")).setDropItem(new ItemStack(bquartz), 3); + Blocks.coal_ore.setDropItem(new ItemStack(coal), 0); + Blocks.emerald_ore.setDropItem(new ItemStack(emerald), 3); + Blocks.lapis_ore.setDropItem(new ItemStack(lapis, 4), 4, 2); + Blocks.quartz_ore.setDropItem(new ItemStack(quartz), 2); + Blocks.black_quartz_ore.setDropItem(new ItemStack(bquartz), 3); + Blocks.charge_ore.setDropItem(new ItemStack(chargedPowder, 4), 2, 1); + Blocks.iron_door.setKeyItem(key); + Blocks.iron_trapdoor.setKeyItem(key); Log.SYSTEM.debug("%d Gegenstände registriert", ITEM_MAP.size()); } diff --git a/common/src/main/java/common/init/Items.java b/common/src/main/java/common/init/Items.java index 355e9839..ab5ed645 100755 --- a/common/src/main/java/common/init/Items.java +++ b/common/src/main/java/common/init/Items.java @@ -23,7 +23,7 @@ import common.item.block.ItemLilyPad; import common.item.block.ItemMetalBlock; import common.item.block.ItemPiston; import common.item.block.ItemPressurePlate; -import common.item.block.ItemRedstone; +import common.item.block.ItemWire; import common.item.block.ItemSeedFood; import common.item.block.ItemSeeds; import common.item.block.ItemSign; @@ -104,7 +104,6 @@ public abstract class Items { public static final ItemSlab acacia_slab = get("acacia_slab"); public static final ItemBlock acacia_stairs = get("acacia_stairs"); public static final ItemBucket acid_bucket = get("acid_bucket"); - public static final ItemBlock activator_rail = get("activator_rail"); public static final Item ahrd_fragment = get("ahrd_fragment"); public static final ItemBlock allium = get("allium"); public static final ItemMetalBlock aluminium_block = get("aluminium_block"); @@ -290,7 +289,6 @@ public abstract class Items { public static final ItemBlock cobblestone_stairs = get("cobblestone_stairs"); public static final ItemWall cobblestone_wall = get("cobblestone_wall"); public static final ItemDye cocoa = get("cocoa"); - public static final ItemSmallBlock comparator = get("comparator"); public static final ItemBlock construction_table = get("construction_table"); public static final ItemFood cooked_beef = get("cooked_beef"); public static final ItemFood cooked_chicken = get("cooked_chicken"); @@ -326,7 +324,6 @@ public abstract class Items { public static final ItemBlock daylight_detector = get("daylight_detector"); public static final ItemColored dead_bush = get("dead_bush"); public static final ItemBlock deadbush = get("deadbush"); - public static final ItemBlock detector_rail = get("detector_rail"); public static final Item diamond = get("diamond"); public static final ItemAxe diamond_axe = get("diamond_axe"); public static final ItemBlock diamond_block = get("diamond_block"); @@ -406,7 +403,6 @@ public abstract class Items { public static final ItemAppleGold golden_apple = get("golden_apple"); public static final ItemAppleGold charged_apple = get("charged_apple"); public static final ItemFood golden_carrot = get("golden_carrot"); - public static final ItemBlock golden_rail = get("golden_rail"); public static final ItemBucket goo_bucket = get("goo_bucket"); public static final ItemColored grass = get("grass"); public static final ItemBlock gravel = get("gravel"); @@ -471,9 +467,7 @@ public abstract class Items { public static final ItemBlock jungle_sapling = get("jungle_sapling"); public static final ItemSlab jungle_slab = get("jungle_slab"); public static final ItemBlock jungle_stairs = get("jungle_stairs"); - public static final ItemKey key = get("key"); public static final ItemBlock ladder = get("ladder"); - public static final ItemBlock lamp = get("lamp"); public static final ItemBlock lapis_block = get("lapis_block"); public static final ItemDye lapis_lazuli = get("lapis_lazuli"); public static final ItemBlock lapis_ore = get("lapis_ore"); @@ -693,13 +687,7 @@ public abstract class Items { public static final ItemBlock red_sand = get("red_sand"); public static final ItemBlock red_tulip = get("red_tulip"); public static final ItemBlock red_wool = get("red_wool"); - public static final ItemRedstone redstone = get("redstone"); - public static final ItemBlock redstone_block = get("redstone_block"); - public static final ItemBlock redstone_lamp = get("redstone_lamp"); - public static final ItemBlock redstone_ore = get("redstone_ore"); - public static final ItemBlock redstone_torch = get("redstone_torch"); public static final ItemSmallBlock reeds = get("reeds"); - public static final ItemSmallBlock repeater = get("repeater"); public static final ItemBlock rock = get("rock"); public static final ItemBlock rose = get("rose"); public static final ItemDoublePlant rose_bush = get("rose_bush"); @@ -825,7 +813,6 @@ public abstract class Items { public static final ItemBlock tnt_6 = get("tnt_6"); public static final ItemBlock tnt_7 = get("tnt_7"); public static final ItemMinecart tnt_minecart = get("tnt_minecart"); - public static final ItemBlock torch = get("torch"); public static final ItemBlock trapdoor = get("trapdoor"); public static final ItemBlock tripwire_hook = get("tripwire_hook"); public static final ItemMetalBlock tungsten_block = get("tungsten_block"); @@ -1008,6 +995,22 @@ public abstract class Items { public static final ItemChest xlarge_chest = get("xlarge_chest"); public static final ItemChest xxlarge_chest = get("xxlarge_chest"); public static final ItemChest xxxlarge_chest = get("xxxlarge_chest"); + public static final ItemKey key = get("key"); + public static final ItemKey black_key = get("black_key"); + public static final ItemKey black_keycard = get("black_keycard"); + public static final ItemKey blue_keycard = get("blue_keycard"); + public static final ItemKey green_keycard = get("green_keycard"); + public static final ItemKey red_keycard = get("red_keycard"); + public static final ItemKey rusty_key = get("rusty_key"); + public static final ItemKey shiny_key = get("shiny_key"); + public static final ItemBlock lamp = get("lamp"); + public static final ItemMagnetic charged_powder = get("charged_powder"); + public static final ItemWire wire = get("wire"); + public static final ItemBlock charged_block = get("charged_block"); + public static final ItemBlock charge_ore = get("charge_ore"); + public static final ItemBlock torch = get("torch"); + public static final ItemBlock soul_torch = get("soul_torch"); + public static final ItemBlock tian_torch = get("tian_torch"); private static T get(String id) { T item = (T)ItemRegistry.byName(id); diff --git a/common/src/main/java/common/init/SmeltingRegistry.java b/common/src/main/java/common/init/SmeltingRegistry.java index 60764346..1cfc03ef 100755 --- a/common/src/main/java/common/init/SmeltingRegistry.java +++ b/common/src/main/java/common/init/SmeltingRegistry.java @@ -47,7 +47,7 @@ public abstract class SmeltingRegistry add(Items.coal_ore, new ItemStack(Items.coal), 0.1F); add(Items.lapis_ore, new ItemStack(Items.lapis_lazuli), 0.2F); add(Items.quartz_ore, new ItemStack(Items.quartz), 0.2F); - add(Items.redstone_ore, new ItemStack(Items.redstone), 0.7F); + add(Items.charge_ore, new ItemStack(Items.charged_powder), 0.7F); for(OreType ore : OreType.values()) { Item item = ItemRegistry.byName(ore.item); diff --git a/common/src/main/java/common/init/TradeRegistry.java b/common/src/main/java/common/init/TradeRegistry.java index b060397f..dcdf1b4a 100755 --- a/common/src/main/java/common/init/TradeRegistry.java +++ b/common/src/main/java/common/init/TradeRegistry.java @@ -55,7 +55,7 @@ public abstract class TradeRegistry { new ItemForGem(Items.name_tag, new PriceInfo(20, 22)), new GemForItem(Items.rotten_flesh, new PriceInfo(36, 40)), new GemForItem(Items.gold_ingot, new PriceInfo(8, 10)), - new ItemForGem(Items.redstone, new PriceInfo(-4, -1)), + new ItemForGem(Items.charged_powder, new PriceInfo(-4, -1)), new ItemForGem(Items.ink_sack, new PriceInfo(-2, -1)), new ItemForGem(Items.charged_orb, new PriceInfo(7, 11)), new ItemForGem(Items.glowstone, new PriceInfo(-3, -1)), diff --git a/common/src/main/java/common/init/UniverseRegistry.java b/common/src/main/java/common/init/UniverseRegistry.java index 537b5068..7abbc139 100755 --- a/common/src/main/java/common/init/UniverseRegistry.java +++ b/common/src/main/java/common/init/UniverseRegistry.java @@ -331,7 +331,7 @@ public abstract class UniverseRegistry { .addOre(Blocks.gravel.getState(), 8, 0, 33, 0, 256, false) .addOre(Blocks.rock.getState(), 6, 0, 22, 24, 72, false) .addOre(Blocks.coal_ore.getState(), 20, 0, 17, 0, 128, false) - .addOre(Blocks.redstone_ore.getState(), 8, 0, 8, 0, 16, false) + .addOre(Blocks.charge_ore.getState(), 8, 0, 8, 0, 16, false) .addOre(Blocks.lapis_ore.getState(), 1, 0, 7, 16, 16, true) .addOre(Blocks.diamond_ore.getState(), 1, 0, 8, 0, 16, false) .addOre(Blocks.ruby_ore.getState(), 1, 0, 4, 12, 8, true) diff --git a/common/src/main/java/common/inventory/Container.java b/common/src/main/java/common/inventory/Container.java index 1a8e72ab..629713f6 100755 --- a/common/src/main/java/common/inventory/Container.java +++ b/common/src/main/java/common/inventory/Container.java @@ -776,12 +776,12 @@ public abstract class Container /** * Like the version that takes an inventory. If the given TileEntity is not an Inventory, 0 is returned instead. */ - public static int calcRedstone(TileEntity te) + public static int calcSignal(TileEntity te) { - return te instanceof IInventory ? calcRedstoneFromInventory((IInventory)te) : 0; + return te instanceof IInventory ? calcSignalFrom((IInventory)te) : 0; } - public static int calcRedstoneFromInventory(IInventory inv) + public static int calcSignalFrom(IInventory inv) { if (inv == null) { diff --git a/common/src/main/java/common/item/CheatTab.java b/common/src/main/java/common/item/CheatTab.java index a7b923ac..50d26d9a 100755 --- a/common/src/main/java/common/item/CheatTab.java +++ b/common/src/main/java/common/item/CheatTab.java @@ -47,7 +47,7 @@ public enum CheatTab { return Items.hay_block; } }, - TECHNOLOGY("Redstone & Technik", true) { + TECHNOLOGY("Technik", true) { protected Item getIconItem() { return Items.tnt; } diff --git a/common/src/main/java/common/item/block/ItemRedstone.java b/common/src/main/java/common/item/block/ItemWire.java similarity index 85% rename from common/src/main/java/common/item/block/ItemRedstone.java rename to common/src/main/java/common/item/block/ItemWire.java index e93a5721..eac65892 100755 --- a/common/src/main/java/common/item/block/ItemRedstone.java +++ b/common/src/main/java/common/item/block/ItemWire.java @@ -1,24 +1,27 @@ package common.item.block; import common.block.Block; -import common.block.tech.BlockRedstoneWire; +import common.block.tech.BlockWire; import common.entity.Entity; import common.entity.npc.EntityNPC; import common.item.CheatTab; import common.item.Item; import common.item.ItemStack; +import common.item.StackSize; import common.util.BlockPos; import common.util.Facing; import common.world.World; -public class ItemRedstone extends Item +public class ItemWire extends Item { - private final BlockRedstoneWire block; + private final BlockWire block; - public ItemRedstone(BlockRedstoneWire block) + public ItemWire(BlockWire block) { this.block = block; this.setTab(CheatTab.TECHNOLOGY); + this.setDisplay(block.getDisplay()); + this.setMaxAmount(StackSize.XL); } public Block getBlock() @@ -26,9 +29,6 @@ public class ItemRedstone extends Item return this.block; } - /** - * 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) { boolean flag = worldIn.getState(pos).getBlock().isReplaceable(worldIn, pos); diff --git a/common/src/main/java/common/item/spawner/ItemMinecart.java b/common/src/main/java/common/item/spawner/ItemMinecart.java index eedf80c7..66b57c0a 100755 --- a/common/src/main/java/common/item/spawner/ItemMinecart.java +++ b/common/src/main/java/common/item/spawner/ItemMinecart.java @@ -1,6 +1,6 @@ package common.item.spawner; -import common.block.tech.BlockRailBase; +import common.block.tech.BlockRail; import common.entity.item.EntityCart; import common.entity.item.EntityMinecart; import common.entity.item.EntityTntCart; @@ -39,7 +39,7 @@ public class ItemMinecart extends Item { State iblockstate = worldIn.getState(pos); - if (BlockRailBase.isRailBlock(iblockstate)) + if (BlockRail.isRailBlock(iblockstate)) { if (!worldIn.client) { @@ -52,7 +52,7 @@ public class ItemMinecart extends Item // entityitem.setOwner(playerIn.getUser()); // } // } - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + BlockRail.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRail ? (BlockRail.EnumRailDirection)iblockstate.getValue(BlockRail.SHAPE) : BlockRail.EnumRailDirection.NORTH_SOUTH; double d0 = 0.0D; if (blockrailbase$enumraildirection.isAscending()) @@ -91,10 +91,10 @@ public class ItemMinecart extends Item double d2 = blockpos.getZ() + 0.5 + (double)facing.getFrontOffsetZ() * 1.125D; BlockPos pos = blockpos.offset(facing); State iblockstate = world.getState(pos); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + BlockRail.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRail ? (BlockRail.EnumRailDirection)iblockstate.getValue(BlockRail.SHAPE) : BlockRail.EnumRailDirection.NORTH_SOUTH; double d3; - if (BlockRailBase.isRailBlock(iblockstate)) + if (BlockRail.isRailBlock(iblockstate)) { if (blockrailbase$enumraildirection.isAscending()) { @@ -107,13 +107,13 @@ public class ItemMinecart extends Item } else { - if (iblockstate.getBlock() != Blocks.air || !BlockRailBase.isRailBlock(world.getState(pos.down()))) + if (iblockstate.getBlock() != Blocks.air || !BlockRail.isRailBlock(world.getState(pos.down()))) { return super.dispenseStack(world, source, position, blockpos, facing, stack); } State iblockstate1 = world.getState(pos.down()); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection1 = iblockstate1.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate1.getValue(((BlockRailBase)iblockstate1.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + BlockRail.EnumRailDirection blockrailbase$enumraildirection1 = iblockstate1.getBlock() instanceof BlockRail ? (BlockRail.EnumRailDirection)iblockstate1.getValue(BlockRail.SHAPE) : BlockRail.EnumRailDirection.NORTH_SOUTH; if (facing != Facing.DOWN && blockrailbase$enumraildirection1.isAscending()) { diff --git a/common/src/main/java/common/item/tool/ItemChargedOrb.java b/common/src/main/java/common/item/tool/ItemChargedOrb.java index 54a83554..d528a3b2 100755 --- a/common/src/main/java/common/item/tool/ItemChargedOrb.java +++ b/common/src/main/java/common/item/tool/ItemChargedOrb.java @@ -58,7 +58,6 @@ public class ItemChargedOrb extends ItemFragile else { worldIn.setState(pos, iblockstate.withProperty(BlockPortalFrame.ORB, Boolean.valueOf(true)), 2); - worldIn.updateComparatorOutputLevel(pos, Blocks.portal_frame); stack.decrSize(); for (int i = 0; i < 16; ++i) diff --git a/common/src/main/java/common/item/tool/ItemShears.java b/common/src/main/java/common/item/tool/ItemShears.java index b33763a9..e64e89bd 100755 --- a/common/src/main/java/common/item/tool/ItemShears.java +++ b/common/src/main/java/common/item/tool/ItemShears.java @@ -2,6 +2,7 @@ package common.item.tool; import common.block.Block; import common.block.Material; +import common.block.tech.BlockWire; import common.entity.types.EntityLiving; import common.init.Blocks; import common.init.ToolMaterial; @@ -37,7 +38,7 @@ public class ItemShears extends Item public boolean canHarvestBlock(Block blockIn) { - return blockIn.getMaterial() == Material.FLUFF || blockIn == Blocks.redstone || blockIn == Blocks.string; + return blockIn.getMaterial() == Material.FLUFF || blockIn instanceof BlockWire || blockIn == Blocks.string; } public float getStrVsBlock(ItemStack stack, Block state) diff --git a/common/src/main/java/common/pathfinding/WalkNodeProcessor.java b/common/src/main/java/common/pathfinding/WalkNodeProcessor.java index cfe84a67..1bee0089 100755 --- a/common/src/main/java/common/pathfinding/WalkNodeProcessor.java +++ b/common/src/main/java/common/pathfinding/WalkNodeProcessor.java @@ -6,7 +6,7 @@ import common.block.artificial.BlockDoor; import common.block.artificial.BlockFence; import common.block.artificial.BlockFenceGate; import common.block.artificial.BlockWall; -import common.block.tech.BlockRailBase; +import common.block.tech.BlockRail; import common.entity.Entity; import common.init.Blocks; import common.util.BlockPos; @@ -231,9 +231,9 @@ public class WalkNodeProcessor extends NodeProcessor flag = true; } - if (entity.worldObj.getState(mpos).getBlock() instanceof BlockRailBase) + if (entity.worldObj.getState(mpos).getBlock() instanceof BlockRail) { - if (!(entity.worldObj.getState(blockpos).getBlock() instanceof BlockRailBase) && !(entity.worldObj.getState(blockpos.down()).getBlock() instanceof BlockRailBase)) + if (!(entity.worldObj.getState(blockpos).getBlock() instanceof BlockRail) && !(entity.worldObj.getState(blockpos.down()).getBlock() instanceof BlockRail)) { return -3; } diff --git a/common/src/main/java/common/tileentity/TileEntity.java b/common/src/main/java/common/tileentity/TileEntity.java index b2120dda..1d67988b 100755 --- a/common/src/main/java/common/tileentity/TileEntity.java +++ b/common/src/main/java/common/tileentity/TileEntity.java @@ -3,7 +3,6 @@ package common.tileentity; import common.block.Block; import common.block.ITileEntityProvider; import common.init.BlockRegistry; -import common.init.Blocks; import common.log.Log; import common.network.Packet; import common.tags.TagObject; @@ -94,11 +93,6 @@ public abstract class TileEntity this.blockState = this.worldObj.getState(this.pos); if(!this.worldObj.client) ((AWorldServer)this.worldObj).markChunkDirty(this.pos); - - if (this.getBlockType() != Blocks.air) - { - this.worldObj.updateComparatorOutputLevel(this.pos, this.getBlockType()); - } } } @@ -184,4 +178,12 @@ public abstract class TileEntity } public abstract int getColor(); + + public boolean hasPower() { + return true; + } + + public boolean decrPower() { + return true; + } } diff --git a/common/src/main/java/common/tileentity/TileEntityDispenser.java b/common/src/main/java/common/tileentity/TileEntityDispenser.java index 2349f3ee..efce439a 100755 --- a/common/src/main/java/common/tileentity/TileEntityDispenser.java +++ b/common/src/main/java/common/tileentity/TileEntityDispenser.java @@ -1,5 +1,6 @@ package common.tileentity; +import common.block.tech.BlockDispenser; import common.collect.Lists; import common.entity.npc.EntityNPC; import common.inventory.Container; @@ -8,12 +9,19 @@ import common.inventory.InventoryPlayer; import common.item.ItemStack; import common.rng.Random; import common.tags.TagObject; +import common.util.BlockPos; +import common.util.Facing; +import common.vars.Vars; +import common.world.State; +import common.world.World; + import java.util.List; -public class TileEntityDispenser extends TileEntityInventory +public class TileEntityDispenser extends TileEntityInventory implements ITickable { private static final Random RNG = new Random(); private ItemStack[] stacks = new ItemStack[9]; + private int cooldown = 0; /** * Returns the number of slots in the inventory. @@ -133,6 +141,7 @@ public class TileEntityDispenser extends TileEntityInventory public void readTags(TagObject compound) { super.readTags(compound); + this.cooldown = compound.getInt("Cooldown"); List nbttaglist = compound.getList("Items"); this.stacks = new ItemStack[this.getSizeInventory()]; @@ -151,6 +160,7 @@ public class TileEntityDispenser extends TileEntityInventory public void writeTags(TagObject compound) { super.writeTags(compound); + compound.setInt("Cooldown", this.cooldown); List nbttaglist = Lists.newArrayList(); for (int i = 0; i < this.stacks.length; ++i) @@ -229,4 +239,54 @@ public class TileEntityDispenser extends TileEntityInventory public int getColor() { return 0xffbf00; } + + protected ItemStack dispenseStack(ItemStack stack, World world, BlockPos pos) + { + Facing facing = world.getState(pos).getValue(BlockDispenser.FACING); + ItemStack nstack = stack.getItem().dispenseStack(world, world.getTileEntity(pos), BlockDispenser.getDispensePosition(pos, facing), pos, facing, stack); + int id = stack.getItem().getDispenseSoundId(); + if(id != 0) + world.playAuxSFX(id, pos, 0); + world.playAuxSFX(2000, pos, facing.getFrontOffsetX() + 1 + (facing.getFrontOffsetZ() + 1) * 3); + return nstack; + } + + protected void dispense(World worldIn, BlockPos pos) + { + TileEntity te = worldIn.getTileEntity(pos); + + if (te instanceof TileEntityDispenser tileentitydispenser) + { + int i = tileentitydispenser.getDispenseSlot(); + + if (i < 0) + { + return; + } + else + { + ItemStack itemstack = tileentitydispenser.getStackInSlot(i); + if(itemstack != null) { + ItemStack itemstack1 = this.dispenseStack(itemstack, worldIn, pos); + tileentitydispenser.setInventorySlotContents(i, itemstack1.isEmpty() ? null : itemstack1); + } + } + } + } + + public void update() { + if(this.worldObj != null && !this.worldObj.client) { + if (this.cooldown <= 0) + { + State state = this.getBlockState(); + if(!(state.getBlock() instanceof BlockDispenser) || !this.decrPower()) + return; + this.dispense(this.worldObj, this.pos); + this.cooldown = Vars.dispenserDelay; + } + else { + this.cooldown--; + } + } + } } diff --git a/common/src/main/java/common/tileentity/TileEntityDropper.java b/common/src/main/java/common/tileentity/TileEntityDropper.java index e6eab29b..b3b55902 100755 --- a/common/src/main/java/common/tileentity/TileEntityDropper.java +++ b/common/src/main/java/common/tileentity/TileEntityDropper.java @@ -1,5 +1,77 @@ package common.tileentity; +import common.block.tech.BlockDispenser; +import common.inventory.IInventory; +import common.item.ItemStack; +import common.util.BlockPos; +import common.util.Facing; +import common.world.World; + public class TileEntityDropper extends TileEntityDispenser { + protected ItemStack dispenseStack(ItemStack stack, World world, BlockPos pos) + { + Facing facing = world.getState(pos).getValue(BlockDispenser.FACING); + BlockDispenser.dispense(world, 6.0, facing, BlockDispenser.getDispensePosition(pos, facing), stack.split(1)); + world.playAuxSFX(1000, pos, 0); + world.playAuxSFX(2000, pos, facing.getFrontOffsetX() + 1 + (facing.getFrontOffsetZ() + 1) * 3); + return stack; + } + + protected void dispense(World worldIn, BlockPos pos) + { + TileEntity te = worldIn.getTileEntity(pos); + + if (te instanceof TileEntityDispenser tileentitydispenser) + { + int i = tileentitydispenser.getDispenseSlot(); + + if (i < 0) + { + return; + } + else + { + ItemStack itemstack = tileentitydispenser.getStackInSlot(i); + + if (itemstack != null) + { + Facing enumfacing = (Facing)worldIn.getState(pos).getValue(BlockDispenser.FACING); + BlockPos blockpos = pos.offset(enumfacing); + IInventory iinventory = TileEntityHopper.getInventoryAtPosition(worldIn, (double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ()); + ItemStack itemstack1; + + if (iinventory == null) + { + itemstack1 = this.dispenseStack(itemstack, worldIn, pos); + + if (itemstack1 != null && itemstack1.isEmpty()) + { + itemstack1 = null; + } + } + else + { + itemstack1 = TileEntityHopper.putStackInInventoryAllSlots(iinventory, itemstack.copy().split(1), enumfacing.getOpposite()); + + if (itemstack1 == null) + { + itemstack1 = itemstack.copy(); + + if (itemstack1.decrSize()) + { + itemstack1 = null; + } + } + else + { + itemstack1 = itemstack.copy(); + } + } + + tileentitydispenser.setInventorySlotContents(i, itemstack1); + } + } + } + } } diff --git a/common/src/main/java/common/tileentity/TileEntityHopper.java b/common/src/main/java/common/tileentity/TileEntityHopper.java index 816dc874..2cfe5fb0 100755 --- a/common/src/main/java/common/tileentity/TileEntityHopper.java +++ b/common/src/main/java/common/tileentity/TileEntityHopper.java @@ -212,7 +212,7 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable if (!this.isOnTransferCooldown()) { State state = this.getBlockState(); - if(!(state.getBlock() instanceof BlockHopper) || !state.getValue(BlockHopper.ENABLED)) + if(!(state.getBlock() instanceof BlockHopper) || !this.decrPower()) return false; boolean flag = false; diff --git a/common/src/main/java/common/vars/Vars.java b/common/src/main/java/common/vars/Vars.java index 9816d972..5dce0a3a 100755 --- a/common/src/main/java/common/vars/Vars.java +++ b/common/src/main/java/common/vars/Vars.java @@ -249,8 +249,8 @@ public abstract class Vars { public static int healChance = 5; @Var(name = "hopperCooldown", min = 0, max = 160) public static int hopperDelay = 2; - @Var(name = "hopperCartCooldown", min = 0, max = 160) - public static int hopperCartDelay = 1; + @Var(name = "dispenserCooldown", min = 0, max = 160) + public static int dispenserDelay = 1; @Var(name = "xpCooldown", min = 0, max = 10) public static int xpDelay = 0; // 2 @Var(name = "eggLayTime") @@ -263,6 +263,8 @@ public abstract class Vars { public static int distance = 8; @Var(name = "timeFlow", min = 1) public static int timeFlow = 1; + @Var(name = "torchBurnoutChance") + public static int torchBurnout = 30; @Var(name = "gravity", min = -10.0f, max = 10.0f) public static float gravity = 1.0f; diff --git a/common/src/main/java/common/world/World.java b/common/src/main/java/common/world/World.java index dad7b6db..3d48edd8 100755 --- a/common/src/main/java/common/world/World.java +++ b/common/src/main/java/common/world/World.java @@ -237,10 +237,6 @@ public abstract class World implements IWorldAccess { if(!this.client && (flags & 1) != 0) { this.notifyNeighborsOfStateChange(pos, iblockstate.getBlock()); - - if(block.hasSignalProcessing()) { - this.updateComparatorOutputLevel(pos, block); - } } return true; @@ -1835,89 +1831,6 @@ public abstract class World implements IWorldAccess { return 63; } - private int getStrongPower(BlockPos pos, Facing direction) { - State iblockstate = this.getState(pos); - return iblockstate.getBlock().getStrongPower(this, pos, iblockstate, direction); - } - - private int getStrongPower(BlockPos pos) { - int i = 0; - i = Math.max(i, this.getStrongPower(pos.down(), Facing.DOWN)); - - if(i >= 15) { - return i; - } - else { - i = Math.max(i, this.getStrongPower(pos.up(), Facing.UP)); - - if(i >= 15) { - return i; - } - else { - i = Math.max(i, this.getStrongPower(pos.north(), Facing.NORTH)); - - if(i >= 15) { - return i; - } - else { - i = Math.max(i, this.getStrongPower(pos.south(), Facing.SOUTH)); - - if(i >= 15) { - return i; - } - else { - i = Math.max(i, this.getStrongPower(pos.west(), Facing.WEST)); - - if(i >= 15) { - return i; - } - else { - i = Math.max(i, this.getStrongPower(pos.east(), Facing.EAST)); - return i >= 15 ? i : i; - } - } - } - } - } - } - - public boolean isSidePowered(BlockPos pos, Facing side) { - return this.getRedstonePower(pos, side) > 0; - } - - public int getRedstonePower(BlockPos pos, Facing facing) { - State iblockstate = this.getState(pos); - Block block = iblockstate.getBlock(); - return block.isNormalCube() ? this.getStrongPower(pos) : block.getWeakPower(this, pos, iblockstate, facing); - } - - public boolean isBlockPowered(BlockPos pos) { - return this.getRedstonePower(pos.down(), Facing.DOWN) > 0 ? true - : (this.getRedstonePower(pos.up(), Facing.UP) > 0 ? true - : (this.getRedstonePower(pos.north(), Facing.NORTH) > 0 ? true - : (this.getRedstonePower(pos.south(), Facing.SOUTH) > 0 ? true - : (this.getRedstonePower(pos.west(), Facing.WEST) > 0 ? true - : this.getRedstonePower(pos.east(), Facing.EAST) > 0)))); - } - - public int isBlockIndirectlyGettingPowered(BlockPos pos) { - int i = 0; - - for(Facing enumfacing : Facing.values()) { - int j = this.getRedstonePower(pos.offset(enumfacing), enumfacing); - - if(j >= 15) { - return 15; - } - - if(j > i) { - i = j; - } - } - - return i; - } - public EntityNPC getClosestPlayerToEntity(Entity entityIn, double distance) { return this.getClosestPlayer(entityIn.posX, entityIn.posY, entityIn.posZ, distance); } @@ -2076,47 +1989,10 @@ public abstract class World implements IWorldAccess { return Math.abs(gravity) < 0.075 ? 0.0 : gravity; } -// public void setItemData(String dataID, WorldSavedData worldSavedDataIn) { -// } -// -// public WorldSavedData loadItemData(Class clazz, String dataID) { -// return null; -// } -// -// public int getNextMapId() { -// return 0; -// } - public final void playAuxSFX(int type, BlockPos pos, int data) { this.playAuxSFX(null, type, pos, data); } - public void updateComparatorOutputLevel(BlockPos pos, Block blockIn) { - for(Facing enumfacing : Facing.Plane.HORIZONTAL) { - BlockPos blockpos = pos.offset(enumfacing); - - if(this.isBlockLoaded(blockpos)) { - State iblockstate = this.getState(blockpos); - - if(Blocks.comparator.isAssociated(iblockstate.getBlock())) { - iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); - } - else if(iblockstate.getBlock().isNormalCube()) { - blockpos = blockpos.offset(enumfacing); - iblockstate = this.getState(blockpos); - - if(Blocks.comparator.isAssociated(iblockstate.getBlock())) { - iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); - } - } - } - } - } - -// public DifficultyInstance getDifficultyForLocation(BlockPos pos) { -// return null; -// } - public void scheduleUpdate(BlockPos pos, Block blockIn, int delay) { } @@ -2127,14 +2003,6 @@ public abstract class World implements IWorldAccess { this.spawnParticle(particleType, xCoord, yCoord, zCoord, 0); } -// public Difficulty getDifficulty() { -// return this.difficulty; -// } - -// public void setDifficulty(Difficulty diff) { -// this.difficulty = diff; -// } - public abstract Chunk getChunk(int x, int z); public abstract void markBlockForUpdate(BlockPos pos); protected abstract void notifyLightSet(BlockPos pos); @@ -2142,7 +2010,6 @@ public abstract class World implements IWorldAccess { public abstract void playSound(SoundEvent sound, double x, double y, double z, float volume); protected abstract void onEntityAdded(Entity entityIn); protected abstract void onEntityRemoved(Entity entityIn); -// public abstract void broadcastSound(int soundID, BlockPos pos, int data); public abstract void playAuxSFX(EntityNPC player, int sfxType, BlockPos blockPosIn, int data); public abstract void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress); } diff --git a/server/src/main/java/server/clipboard/ClipboardPlacer.java b/server/src/main/java/server/clipboard/ClipboardPlacer.java index f69acfa0..33d21101 100755 --- a/server/src/main/java/server/clipboard/ClipboardPlacer.java +++ b/server/src/main/java/server/clipboard/ClipboardPlacer.java @@ -11,7 +11,7 @@ import java.util.Set; import common.block.Block; import common.block.ITileEntityProvider; import common.block.artificial.BlockDoor; -import common.block.tech.BlockRailBase; +import common.block.tech.BlockRail; import common.collect.Lists; import common.init.Blocks; import common.inventory.IInventory; @@ -125,7 +125,7 @@ public class ClipboardPlacer { } } } - else if(type instanceof BlockRailBase) { + else if(type instanceof BlockRail) { // Here, rails are hardcoded to be attached to the block below them. // They're also attached to the block they're ascending towards via BlockType.getAttachment. BlockPos lowerBlock = current.add(0, -1, 0); diff --git a/server/src/main/java/server/clipboard/ReorderRegistry.java b/server/src/main/java/server/clipboard/ReorderRegistry.java index 8a98aef3..3f695067 100755 --- a/server/src/main/java/server/clipboard/ReorderRegistry.java +++ b/server/src/main/java/server/clipboard/ReorderRegistry.java @@ -42,7 +42,7 @@ public abstract class ReorderRegistry { // return STATE_ATTACH.get(state); // } - public static void register() { + public static void register() { // TODO: FIX this mess later for(WoodType wood : WoodType.values()) { PLACE_LAST.add(BlockRegistry.byName(wood.getName() + "_sapling")); } @@ -50,8 +50,6 @@ public abstract class ReorderRegistry { for(DyeColor color : BlockBed.COLORS) { PLACE_LAST.add(BlockRegistry.byName(color.getName() + "_bed")); } - PLACE_LAST.add(Blocks.golden_rail); - PLACE_LAST.add(Blocks.detector_rail); PLACE_LAST.add(Blocks.tallgrass); PLACE_LAST.add(Blocks.deadbush); PLACE_LAST.add(Blocks.piston_head); @@ -60,24 +58,22 @@ public abstract class ReorderRegistry { } PLACE_LAST.add(Blocks.brown_mushroom); PLACE_LAST.add(Blocks.red_mushroom_block); - PLACE_LAST.add(Blocks.torch); +// PLACE_LAST.add(Blocks.torch); PLACE_LAST.add(Blocks.fire); PLACE_LAST.add(Blocks.soul_fire); PLACE_LAST.add(Blocks.black_fire); - PLACE_LAST.add(Blocks.redstone); +// PLACE_LAST.add(Blocks.wire); PLACE_LAST.add(Blocks.wheat); PLACE_LAST.add(Blocks.ladder); PLACE_LAST.add(Blocks.rail); PLACE_LAST.add(Blocks.lever); PLACE_LAST.add(Blocks.stone_pressure_plate); PLACE_LAST.add(Blocks.wooden_pressure_plate); - PLACE_LAST.add(Blocks.unlit_redstone_torch); - PLACE_LAST.add(Blocks.redstone_torch); +// PLACE_LAST.add(Blocks.unlit__torch); +// PLACE_LAST.add(Blocks.lit_t); PLACE_LAST.add(Blocks.stone_button); PLACE_LAST.add(Blocks.snow_layer); PLACE_LAST.add(Blocks.portal); - PLACE_LAST.add(Blocks.repeater); - PLACE_LAST.add(Blocks.powered_repeater); PLACE_LAST.add(Blocks.trapdoor); PLACE_LAST.add(Blocks.vine); PLACE_LAST.add(Blocks.waterlily); @@ -100,9 +96,6 @@ public abstract class ReorderRegistry { } PLACE_LAST.add(Blocks.light_weighted_pressure_plate); PLACE_LAST.add(Blocks.heavy_weighted_pressure_plate); - PLACE_LAST.add(Blocks.comparator); - PLACE_LAST.add(Blocks.powered_comparator); - PLACE_LAST.add(Blocks.activator_rail); PLACE_LAST.add(Blocks.iron_trapdoor); for(BlockCarpet block : BlockCarpet.CARPETS) { PLACE_LAST.add(block); @@ -158,12 +151,12 @@ public abstract class ReorderRegistry { } addAttach(Blocks.brown_mushroom, Facing.DOWN); addAttach(Blocks.red_mushroom, Facing.DOWN); - for (Block blockId : new Block[] { Blocks.torch, Blocks.redstone_torch, Blocks.unlit_redstone_torch }) { + for (Block blockId : new Block[] { Blocks.torch, Blocks.u_torch, l_torch }) { addAttach(blockId.getStateFromMeta(0), Facing.DOWN); addAttach(blockId.getStateFromMeta(5), Facing.DOWN); // According to the wiki, this one is history. Keeping both, for now... addCardinals(blockId, 4, 1, 3, 2); } - addAttach(Blocks.redstone, Facing.DOWN); + addAttach(Blocks.wire, Facing.DOWN); addAttach(Blocks.wheat, Facing.DOWN); addAttach(Blocks.sign, Facing.DOWN); addCardinals(Blocks.ladder, 2, 5, 3, 4); @@ -178,7 +171,7 @@ public abstract class ReorderRegistry { addAttach(Blocks.stone_pressure_plate, Facing.DOWN); addAttach(Blocks.iron_door, Facing.DOWN); addAttach(Blocks.wooden_pressure_plate, Facing.DOWN); - // redstone torches: see torches + // other torches: see torches for (int offset = 0; offset < 16; offset += 8) { addCardinals(Blocks.stone_button, offset + 4, offset + 1, offset + 3, offset + 2); addCardinals(Blocks.wooden_button, offset + 4, offset + 1, offset + 3, offset + 2); diff --git a/server/src/main/java/server/world/Converter.java b/server/src/main/java/server/world/Converter.java index 9ef07465..00a7e657 100644 --- a/server/src/main/java/server/world/Converter.java +++ b/server/src/main/java/server/world/Converter.java @@ -75,16 +75,9 @@ import common.block.tech.BlockPistonHead.EnumPistonType; import common.block.tech.BlockPressurePlate; import common.block.tech.BlockPressurePlateWeighted; import common.block.tech.BlockRail; -import common.block.tech.BlockRailBase.EnumRailDirection; -import common.block.tech.BlockRailDetector; -import common.block.tech.BlockRailPowered; -import common.block.tech.BlockRedstoneComparator; -import common.block.tech.BlockRedstoneComparator.Mode; -import common.block.tech.BlockRedstoneRepeater; -import common.block.tech.BlockRedstoneTorch; -import common.block.tech.BlockRedstoneWire; -import common.block.tech.BlockTNT; +import common.block.tech.BlockRail.EnumRailDirection; import common.block.tech.BlockTorch; +import common.block.tech.BlockTNT; import common.block.tech.BlockTripWire; import common.block.tech.BlockTripWireHook; import common.block.tech.BlockWarpChest; @@ -479,18 +472,18 @@ public abstract class Converter { mapBlock(Blocks.glass, 20); mapBlock(Blocks.lapis_ore, 21); mapBlock(Blocks.lapis_block, 22); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.DOWN).withProperty(BlockDispenser.TRIGGERED, false), 23, 0, 6); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.UP).withProperty(BlockDispenser.TRIGGERED, false), 23, 1, 7); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.NORTH).withProperty(BlockDispenser.TRIGGERED, false), 23, 2); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.SOUTH).withProperty(BlockDispenser.TRIGGERED, false), 23, 3); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.WEST).withProperty(BlockDispenser.TRIGGERED, false), 23, 4); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.EAST).withProperty(BlockDispenser.TRIGGERED, false), 23, 5); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.DOWN).withProperty(BlockDispenser.TRIGGERED, true), 23, 8, 14); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.UP).withProperty(BlockDispenser.TRIGGERED, true), 23, 9, 15); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.NORTH).withProperty(BlockDispenser.TRIGGERED, true), 23, 10); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.SOUTH).withProperty(BlockDispenser.TRIGGERED, true), 23, 11); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.WEST).withProperty(BlockDispenser.TRIGGERED, true), 23, 12); - mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.EAST).withProperty(BlockDispenser.TRIGGERED, true), 23, 13); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.DOWN), 23, 0, 6); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.UP), 23, 1, 7); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.NORTH), 23, 2); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.SOUTH), 23, 3); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.WEST), 23, 4); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.EAST), 23, 5); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.DOWN), 23, 8, 14); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.UP), 23, 9, 15); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.NORTH), 23, 10); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.SOUTH), 23, 11); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.WEST), 23, 12); + mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.EAST), 23, 13); mapBlock(Blocks.sandstone, 24); mapBlock(Blocks.carved_sandstone, 24, 1); mapBlock(Blocks.smooth_sandstone, 24, 2); @@ -503,30 +496,30 @@ public abstract class Converter { mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.WEST).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 9, 13); mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.NORTH).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 10, 14); mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.EAST).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 11, 15); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.NORTH_SOUTH), 27, 0, 6, 7); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.EAST_WEST), 27, 1); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_EAST), 27, 2); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_WEST), 27, 3); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_NORTH), 27, 4); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 27, 5); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.NORTH_SOUTH), 27, 8, 14, 15); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.EAST_WEST), 27, 9); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_EAST), 27, 10); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_WEST), 27, 11); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_NORTH), 27, 12); - mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 27, 13); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.NORTH_SOUTH), 28, 0, 6, 7); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.EAST_WEST), 28, 1); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_EAST), 28, 2); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_WEST), 28, 3); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_NORTH), 28, 4); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 28, 5); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.NORTH_SOUTH), 28, 8, 14, 15); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.EAST_WEST), 28, 9); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_EAST), 28, 10); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_WEST), 28, 11); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_NORTH), 28, 12); - mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 28, 13); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 27, 0, 6, 7); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 27, 1); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 27, 2); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 27, 3); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 27, 4); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 27, 5); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 27, 8, 14, 15); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 27, 9); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 27, 10); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 27, 11); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 27, 12); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 27, 13); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 28, 0, 6, 7); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 28, 1); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 28, 2); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 28, 3); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 28, 4); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 28, 5); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 28, 8, 14, 15); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 28, 9); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 28, 10); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 28, 11); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 28, 12); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 28, 13); mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.DOWN), 29, 0, 7); mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.UP), 29, 1, 6); mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.NORTH), 29, 2); @@ -655,11 +648,11 @@ public abstract class Converter { mapBlock(Blocks.bookshelf, 47); mapBlock(Blocks.mossy_cobblestone, 48); mapBlock(Blocks.obsidian, 49); - mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.UP), 50); - mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.EAST), 50, 1); - mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.WEST), 50, 2); - mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.SOUTH), 50, 3); - mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.NORTH), 50, 4); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP), 50); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.EAST), 50, 1); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.WEST), 50, 2); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.SOUTH), 50, 3); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.NORTH), 50, 4); mapBlock(new BlockFunction() { public State getState(int id, int data) { return Blocks.fire.getState().withProperty(BlockFire.AGE, data); @@ -678,22 +671,6 @@ public abstract class Converter { mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.SOUTH), 54, 3, 9, 15); mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.WEST), 54, 4, 10); mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.EAST), 54, 5, 11); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 0), 55, 0); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 1), 55, 1); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 2), 55, 2); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 3), 55, 3); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 4), 55, 4); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 5), 55, 5); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 6), 55, 6); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 7), 55, 7); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 8), 55, 8); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 9), 55, 9); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 10), 55, 10); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 11), 55, 11); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 12), 55, 12); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 13), 55, 13); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 14), 55, 14); - mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 15), 55, 15); mapBlock(Blocks.diamond_ore, 56); mapBlock(Blocks.diamond_block, 57); mapBlock(Blocks.workbench, 58); @@ -785,18 +762,18 @@ public abstract class Converter { mapBlock(Blocks.iron_door, 71); mapBlock(Blocks.wooden_pressure_plate.getState().withProperty(BlockPressurePlate.POWERED, false), 72); mapBlock(Blocks.wooden_pressure_plate.getState().withProperty(BlockPressurePlate.POWERED, true), 72, 1); - mapBlock(Blocks.redstone_ore, 73); - mapBlock(Blocks.lit_redstone_ore, 74); - mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.UP), 75); - mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.EAST), 75, 1); - mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.WEST), 75, 2); - mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.SOUTH), 75, 3); - mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.NORTH), 75, 4); - mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.UP), 76); - mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.EAST), 76, 1); - mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.WEST), 76, 2); - mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.SOUTH), 76, 3); - mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.NORTH), 76, 4); + mapBlock(Blocks.charge_ore, 73); + mapBlock(Blocks.charge_ore, 74); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP), 75); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.EAST), 75, 1); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.WEST), 75, 2); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.SOUTH), 75, 3); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.NORTH), 75, 4); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP), 76); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.EAST), 76, 1); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.WEST), 76, 2); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.SOUTH), 76, 3); + mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.NORTH), 76, 4); mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.DOWN).withProperty(BlockButton.POWERED, false), 77, 0); mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.EAST).withProperty(BlockButton.POWERED, false), 77, 1); mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.WEST).withProperty(BlockButton.POWERED, false), 77, 2); @@ -862,38 +839,6 @@ public abstract class Converter { mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 4), 92, 4); mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 5), 92, 5); mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 6), 92, 6); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 93, 0); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 93, 1); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 93, 2); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 93, 3); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 93, 4); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 93, 5); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 93, 6); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 93, 7); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 93, 8); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 93, 9); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 93, 10); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 93, 11); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 93, 12); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 93, 13); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 93, 14); - mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 93, 15); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 94, 0); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 94, 1); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 94, 2); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 94, 3); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 94, 4); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 94, 5); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 94, 6); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 94, 7); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 94, 8); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 94, 9); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 94, 10); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 94, 11); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 94, 12); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 94, 13); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 94, 14); - mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 94, 15); mapBlock(new BlockFunction() { public State getState(int id, int data) { return BlockStainedGlass.getByColor(COLOR_LOOKUP[data]).getState(); @@ -986,22 +931,22 @@ public abstract class Converter { mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, false), 106, 13); mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, false).withProperty(BlockVine.WEST, true), 106, 14); mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, true), 106, 15); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 107, 0); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 107, 1); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 107, 2); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 107, 3); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 107, 4); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 107, 5); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 107, 6); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 107, 7); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 107, 8); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 107, 9); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 107, 10); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 107, 11); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 107, 12); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 107, 13); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 107, 14); - mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 107, 15); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 107, 0); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 107, 1); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 107, 2); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 107, 3); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 107, 4); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 107, 5); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 107, 6); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 107, 7); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 107, 8); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 107, 9); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 107, 10); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 107, 11); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 107, 12); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 107, 13); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 107, 14); + mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 107, 15); mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 0, 8); mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 1, 9); mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 2, 10); @@ -1051,8 +996,8 @@ public abstract class Converter { mapBlock(Blocks.obsidian, 120); mapBlock(Blocks.cell_rock, 121); mapBlock(Blocks.dragon_egg, 122); - mapBlock(Blocks.redstone_lamp, 123); - mapBlock(Blocks.lit_redstone_lamp, 124); + mapBlock(Blocks.lamp, 123); + mapBlock(Blocks.lit_lamp, 124); mapBlock(Blocks.oak_planks, 125); mapBlock(Blocks.spruce_planks, @@ -1248,38 +1193,6 @@ public abstract class Converter { mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 13), 148, 13); mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 14), 148, 14); mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 15), 148, 15); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 149, 0); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 149, 1); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 149, 2); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 149, 3); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 149, 4); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 149, 5); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 149, 6); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 149, 7); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 149, 8); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 149, 9); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 149, 10); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 149, 11); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 149, 12); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 149, 13); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 149, 14); - mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 149, 15); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 150, 0); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 150, 1); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 150, 2); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 150, 3); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 150, 4); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 150, 5); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 150, 6); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 150, 7); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 150, 8); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 150, 9); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 150, 10); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 150, 11); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 150, 12); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 150, 13); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 150, 14); - mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 150, 15); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 0), 151, 0); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 1), 151, 1); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 2), 151, 2); @@ -1296,18 +1209,18 @@ public abstract class Converter { mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 13), 151, 13); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 14), 151, 14); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 15), 151, 15); - mapBlock(Blocks.redstone_block, 152); + mapBlock(Blocks.charged_block, 152); mapBlock(Blocks.quartz_ore, 153); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.DOWN), 154, 0, 1, 6, 7); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.NORTH), 154, 2); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.SOUTH), 154, 3); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.WEST), 154, 4); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.EAST), 154, 5); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.DOWN), 154, 8, 9, 14, 15); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.NORTH), 154, 10); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.SOUTH), 154, 11); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.WEST), 154, 12); - mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.EAST), 154, 13); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.DOWN), 154, 0, 1, 6, 7); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.NORTH), 154, 2); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.SOUTH), 154, 3); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.WEST), 154, 4); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.EAST), 154, 5); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.DOWN), 154, 8, 9, 14, 15); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.NORTH), 154, 10); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.SOUTH), 154, 11); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.WEST), 154, 12); + mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.EAST), 154, 13); mapBlock(Blocks.quartz_block, 155); mapBlock(Blocks.quartz_ornaments, 155, 1); mapBlock(Blocks.quartz_pillar.getState().withProperty(BlockQuartzPillar.AXIS, Facing.Axis.Y), 155, 2); @@ -1321,30 +1234,30 @@ public abstract class Converter { mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 5, 13); mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 6, 14); mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.NORTH).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 7, 15); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.NORTH_SOUTH), 157, 0, 6, 7); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.EAST_WEST), 157, 1); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_EAST), 157, 2); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_WEST), 157, 3); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_NORTH), 157, 4); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 157, 5); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.NORTH_SOUTH), 157, 8, 14, 15); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.EAST_WEST), 157, 9); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_EAST), 157, 10); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_WEST), 157, 11); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_NORTH), 157, 12); - mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 157, 13); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN).withProperty(BlockDropper.TRIGGERED, false), 158, 0, 6); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP).withProperty(BlockDropper.TRIGGERED, false), 158, 1, 7); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH).withProperty(BlockDropper.TRIGGERED, false), 158, 2); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH).withProperty(BlockDropper.TRIGGERED, false), 158, 3); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST).withProperty(BlockDropper.TRIGGERED, false), 158, 4); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST).withProperty(BlockDropper.TRIGGERED, false), 158, 5); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN).withProperty(BlockDropper.TRIGGERED, true), 158, 8, 14); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP).withProperty(BlockDropper.TRIGGERED, true), 158, 9, 15); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH).withProperty(BlockDropper.TRIGGERED, true), 158, 10); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH).withProperty(BlockDropper.TRIGGERED, true), 158, 11); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST).withProperty(BlockDropper.TRIGGERED, true), 158, 12); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST).withProperty(BlockDropper.TRIGGERED, true), 158, 13); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 157, 0, 6, 7); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 157, 1); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 157, 2); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 157, 3); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 157, 4); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 157, 5); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 157, 8, 14, 15); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 157, 9); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 157, 10); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 157, 11); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 157, 12); + mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 157, 13); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN), 158, 0, 6); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP), 158, 1, 7); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH), 158, 2); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH), 158, 3); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST), 158, 4); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST), 158, 5); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN), 158, 8, 14); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP), 158, 9, 15); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH), 158, 10); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH), 158, 11); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST), 158, 12); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST), 158, 13); mapBlock(new BlockFunction() { public State getState(int id, int data) { return BlockColoredClay.getByColor(COLOR_LOOKUP[data]).getState(); @@ -1414,7 +1327,7 @@ public abstract class Converter { mapBlock(Blocks.stonebrick, 168); mapBlock(Blocks.smooth_rock, 168, 1); mapBlock(Blocks.black_brick, 168, 2); - mapBlock(Blocks.lamp, 169); + mapBlock(Blocks.lit_lamp, 169); mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.Y), 170); mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.X), 170, 4, 5, 6, 7); mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.Z), 170, 8, 9, 10, 11); @@ -1465,86 +1378,86 @@ public abstract class Converter { Facing.DOWN), 182); mapBlock(Blocks.sandstone_slab.getState().withProperty(BlockSlab.FACING, Facing.UP), 182, 8); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 183, 0); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 183, 1); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 183, 2); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 183, 3); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 183, 4); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 183, 5); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 183, 6); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 183, 7); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 183, 8); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 183, 9); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 183, 10); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 183, 11); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 183, 12); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 183, 13); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 183, 14); - mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 183, 15); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 184, 0); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 184, 1); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 184, 2); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 184, 3); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 184, 4); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 184, 5); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 184, 6); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 184, 7); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 184, 8); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 184, 9); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 184, 10); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 184, 11); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 184, 12); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 184, 13); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 184, 14); - mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 184, 15); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 185, 0); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 185, 1); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 185, 2); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 185, 3); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 185, 4); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 185, 5); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 185, 6); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 185, 7); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 185, 8); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 185, 9); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 185, 10); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 185, 11); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 185, 12); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 185, 13); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 185, 14); - mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 185, 15); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 186, 0); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 186, 1); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 186, 2); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 186, 3); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 186, 4); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 186, 5); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 186, 6); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 186, 7); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 186, 8); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 186, 9); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 186, 10); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 186, 11); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 186, 12); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 186, 13); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 186, 14); - mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 186, 15); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 187, 0); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 187, 1); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 187, 2); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 187, 3); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 187, 4); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 187, 5); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 187, 6); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 187, 7); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 187, 8); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 187, 9); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 187, 10); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 187, 11); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 187, 12); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 187, 13); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 187, 14); - mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 187, 15); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 183, 0); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 183, 1); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 183, 2); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 183, 3); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 183, 4); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 183, 5); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 183, 6); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 183, 7); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 183, 8); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 183, 9); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 183, 10); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 183, 11); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 183, 12); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 183, 13); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 183, 14); + mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 183, 15); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 184, 0); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 184, 1); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 184, 2); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 184, 3); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 184, 4); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 184, 5); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 184, 6); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 184, 7); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 184, 8); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 184, 9); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 184, 10); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 184, 11); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 184, 12); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 184, 13); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 184, 14); + mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 184, 15); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 185, 0); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 185, 1); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 185, 2); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 185, 3); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 185, 4); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 185, 5); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 185, 6); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 185, 7); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 185, 8); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 185, 9); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 185, 10); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 185, 11); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 185, 12); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 185, 13); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 185, 14); + mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 185, 15); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 186, 0); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 186, 1); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 186, 2); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 186, 3); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 186, 4); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 186, 5); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 186, 6); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 186, 7); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 186, 8); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 186, 9); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 186, 10); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 186, 11); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 186, 12); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 186, 13); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 186, 14); + mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 186, 15); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 187, 0); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 187, 1); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 187, 2); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 187, 3); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 187, 4); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 187, 5); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 187, 6); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 187, 7); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 187, 8); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 187, 9); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 187, 10); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 187, 11); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 187, 12); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 187, 13); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 187, 14); + mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 187, 15); mapBlock(Blocks.spruce_fence, 188); mapBlock(Blocks.birch_fence, 189); mapBlock(Blocks.jungle_fence, 190); @@ -1593,18 +1506,18 @@ public abstract class Converter { mapBlock(Blocks.blood_brick, 215); mapBlock(Blocks.quartz_block, 216); mapBlock(Blocks.glass, 217); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN).withProperty(BlockDropper.TRIGGERED, false), 218, 0, 6); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP).withProperty(BlockDropper.TRIGGERED, false), 218, 1, 7); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH).withProperty(BlockDropper.TRIGGERED, false), 218, 2); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH).withProperty(BlockDropper.TRIGGERED, false), 218, 3); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST).withProperty(BlockDropper.TRIGGERED, false), 218, 4); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST).withProperty(BlockDropper.TRIGGERED, false), 218, 5); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN).withProperty(BlockDropper.TRIGGERED, true), 218, 8, 14); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP).withProperty(BlockDropper.TRIGGERED, true), 218, 9, 15); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH).withProperty(BlockDropper.TRIGGERED, true), 218, 10); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH).withProperty(BlockDropper.TRIGGERED, true), 218, 11); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST).withProperty(BlockDropper.TRIGGERED, true), 218, 12); - mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST).withProperty(BlockDropper.TRIGGERED, true), 218, 13); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN), 218, 0, 6); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP), 218, 1, 7); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH), 218, 2); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH), 218, 3); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST), 218, 4); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST), 218, 5); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN), 218, 8, 14); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP), 218, 9, 15); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH), 218, 10); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH), 218, 11); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST), 218, 12); + mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST), 218, 13); for(int id = 219; id <= 234; id++) { mapBlock(BlockWool.getByColor(COLOR_LOOKUP[id - 219]).getState(), id); } @@ -1752,7 +1665,6 @@ public abstract class Converter { else if(id == 64 || id == 71 || (id >= 193 && id <= 197)) return state.withProperty(BlockDoor.HALF, (meta & 8) > 0 ? BlockDoor.EnumDoorHalf.UPPER : BlockDoor.EnumDoorHalf.LOWER) .withProperty(BlockDoor.HINGE, (((meta & 8) > 0 ? meta : up) & 1) > 0 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT) - .withProperty(BlockDoor.POWERED, (((meta & 8) > 0 ? meta : up) & 2) > 0) .withProperty(BlockDoor.OPEN, (((meta & 8) > 0 ? down : meta) & 4) > 0) .withProperty(BlockDoor.FACING, Facing.getHorizontal(((meta & 8) > 0 ? down : meta) & 3).rotateYCCW()); else diff --git a/server/src/main/java/server/worldgen/LootConstants.java b/server/src/main/java/server/worldgen/LootConstants.java index 264e537f..03e96cdd 100755 --- a/server/src/main/java/server/worldgen/LootConstants.java +++ b/server/src/main/java/server/worldgen/LootConstants.java @@ -15,7 +15,7 @@ public abstract class LootConstants { new RngLoot(Items.diamond_horse_armor, 1, 1, 1)); public static final WeightedList STRONGHOLD_CHEST = new WeightedList(new RngLoot(Items.orb, 1, 1, 10), new RngLoot(Items.diamond, 1, 3, 3), new RngLoot(Items.iron_ingot, 1, 5, 10), new RngLoot(Items.gold_ingot, 1, 3, 5), - new RngLoot(Items.redstone, 4, 9, 5), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.apple, 1, 3, 15), + new RngLoot(Items.charged_powder, 4, 9, 5), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.apple, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 5), new RngLoot(Items.iron_sword, 1, 1, 5), new RngLoot(Items.iron_chestplate, 1, 1, 5), new RngLoot(Items.iron_helmet, 1, 1, 5), new RngLoot(Items.iron_leggings, 1, 1, 5), new RngLoot(Items.iron_boots, 1, 1, 5), new RngLoot(Items.golden_apple, 1, 1, 1), new RngLoot(Items.saddle, 1, 1, 1), new RngLoot(Items.iron_horse_armor, 1, 1, 1), @@ -23,7 +23,7 @@ public abstract class LootConstants { public static final WeightedList STRONGHOLD_LIBRARY = new WeightedList(new RngLoot(Items.book, 1, 3, 20), new RngLoot(Items.paper, 2, 7, 20), new RngLoot(Items.string, 1, 1, 1), new RngLoot(Items.navigator, 1, 1, 1)); public static final WeightedList STRONGHOLD_CROSS = new WeightedList(new RngLoot(Items.iron_ingot, 1, 5, 10), - new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.redstone, 4, 9, 5), new RngLoot(Items.coal, 3, 8, 10), + new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.charged_powder, 4, 9, 5), new RngLoot(Items.coal, 3, 8, 10), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.apple, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 1)); public static final WeightedList DESERT_PYRAMID = new WeightedList(new RngLoot(Items.diamond, 1, 3, 3), new RngLoot(Items.iron_ingot, 1, 5, 10), new RngLoot(Items.gold_ingot, 2, 7, 15), new RngLoot(Items.emerald, 1, 3, 2), @@ -37,7 +37,7 @@ public abstract class LootConstants { new RngLoot(Items.diamond_horse_armor, 1, 1, 1)); public static final WeightedList JUNGLE_TRAP = new WeightedList(new RngLoot(Items.arrow, 2, 7, 30)); public static final WeightedList MINESHAFT_CHEST = new WeightedList(new RngLoot(Items.iron_ingot, 1, 5, 10), - new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.redstone, 4, 9, 5), + new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.charged_powder, 4, 9, 5), new RngLoot(Items.lapis_lazuli, 4, 9, 5), new RngLoot(Items.diamond, 1, 2, 3), new RngLoot(Items.coal, 3, 8, 10), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 1), new RngLoot(Items.rail, 4, 8, 1), new RngLoot(Items.melon_stem, 2, 4, 10), @@ -51,7 +51,7 @@ public abstract class LootConstants { public static final WeightedList DUNGEON_CHEST = new WeightedList(new RngLoot(Items.saddle, 1, 1, 11), new RngLoot(Items.iron_ingot, 1, 4, 11), new RngLoot(Items.bread, 1, 1, 11), new RngLoot(Items.wheats, 1, 4, 11), new RngLoot(Items.gunpowder, 1, 4, 11), new RngLoot(Items.string, 1, 4, 11), new RngLoot(Items.bucket, 1, 1, 11), - new RngLoot(Items.golden_apple, 1, 1, 1), new RngLoot(Items.redstone, 1, 4, 11), new RngLoot(Items.aluminium_ingot, 1, 1, 5), + new RngLoot(Items.golden_apple, 1, 1, 1), new RngLoot(Items.charged_powder, 1, 4, 11), new RngLoot(Items.aluminium_ingot, 1, 1, 5), new RngLoot(Items.copper_ingot, 1, 1, 5), new RngLoot(Items.name_tag, 1, 1, 11), new RngLoot(Items.gold_horse_armor, 1, 1, 3), new RngLoot(Items.iron_horse_armor, 1, 1, 6), new RngLoot(Items.diamond_horse_armor, 1, 1, 2), new RngLoot(Items.record_13, 1, 1, 1), new RngLoot(Items.record_cat, 1, 1, 1), new RngLoot(Items.record_blocks, 1, 1, 1), diff --git a/server/src/main/java/server/worldgen/structure/StructureComponent.java b/server/src/main/java/server/worldgen/structure/StructureComponent.java index d652bc35..cddc3647 100755 --- a/server/src/main/java/server/worldgen/structure/StructureComponent.java +++ b/server/src/main/java/server/worldgen/structure/StructureComponent.java @@ -11,7 +11,6 @@ import common.block.tech.BlockDispenser; import common.block.tech.BlockLever; import common.block.tech.BlockPistonBase; import common.block.tech.BlockRail; -import common.block.tech.BlockRailBase; import common.init.Blocks; import common.item.RngLoot; import common.item.block.ItemDoor; @@ -265,12 +264,12 @@ public abstract class StructureComponent { if (this.coordBaseMode == Facing.WEST || this.coordBaseMode == Facing.EAST) { - if (state.getValue(BlockRail.SHAPE) == BlockRailBase.EnumRailDirection.EAST_WEST) + if (state.getValue(BlockRail.SHAPE) == BlockRail.EnumRailDirection.EAST_WEST) { - return state.withProperty(BlockRail.SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH); + return state.withProperty(BlockRail.SHAPE, BlockRail.EnumRailDirection.NORTH_SOUTH); } - return state.withProperty(BlockRail.SHAPE, BlockRailBase.EnumRailDirection.EAST_WEST); + return state.withProperty(BlockRail.SHAPE, BlockRail.EnumRailDirection.EAST_WEST); } } else if (blockIn instanceof Rotatable) diff --git a/server/src/main/java/server/worldgen/structure/StructureMineshaft.java b/server/src/main/java/server/worldgen/structure/StructureMineshaft.java index f0182d83..f49ed292 100755 --- a/server/src/main/java/server/worldgen/structure/StructureMineshaft.java +++ b/server/src/main/java/server/worldgen/structure/StructureMineshaft.java @@ -5,7 +5,6 @@ import java.util.List; import common.block.tech.BlockChest; import common.block.tech.BlockRail; -import common.block.tech.BlockRailBase; import common.block.tech.BlockTorch; import common.entity.npc.EntityArachnoid; import common.init.Blocks; @@ -352,8 +351,8 @@ public class StructureMineshaft this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k1 - 2, Blocks.web.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 0, 2, k1 + 2, Blocks.web.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k1 + 2, Blocks.web.getState()); - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 - 1, Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.UP)); - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 + 1, Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.UP)); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 - 1, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP)); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 + 1, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP)); if (randomIn.zrange(100) == 0) { @@ -407,7 +406,7 @@ public class StructureMineshaft if (iblockstate.getBlock() != Blocks.air && iblockstate.getBlock().isFullBlock()) { - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.7F, 1, 0, l2, this.getMetadataWithOffset(Blocks.rail.getState().withProperty(BlockRail.SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH))); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.7F, 1, 0, l2, this.getMetadataWithOffset(Blocks.rail.getState().withProperty(BlockRail.SHAPE, BlockRail.EnumRailDirection.NORTH_SOUTH))); } } } diff --git a/server/src/main/java/server/worldgen/structure/StructureScattered.java b/server/src/main/java/server/worldgen/structure/StructureScattered.java index e7666445..9e2b98ae 100755 --- a/server/src/main/java/server/worldgen/structure/StructureScattered.java +++ b/server/src/main/java/server/worldgen/structure/StructureScattered.java @@ -4,7 +4,6 @@ import common.block.artificial.BlockStairs; import common.block.foliage.BlockVine; import common.block.tech.BlockLever; import common.block.tech.BlockPistonBase; -import common.block.tech.BlockRedstoneRepeater; import common.block.tech.BlockTripWire; import common.block.tech.BlockTripWireHook; import common.entity.npc.EntityMage; @@ -354,7 +353,7 @@ public class StructureScattered private boolean placedHiddenChest; private boolean placedTrap1; private boolean placedTrap2; - private static StructureScattered.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new StructureScattered.JunglePyramid.Stones(); + private static StructureScattered.JunglePyramid.Stones scattered = new StructureScattered.JunglePyramid.Stones(); public JunglePyramid() { @@ -395,19 +394,19 @@ public class StructureScattered State j = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH)); State k = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST)); State l = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST)); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 9, 2, 2, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 12, 9, 2, 12, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 3, 2, 2, 11, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 1, 3, 9, 2, 11, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 1, 10, 6, 1, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 13, 10, 6, 13, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 2, 1, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, 3, 2, 10, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 3, 2, 9, 3, 12, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 6, 2, 9, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 3, 7, 3, 8, 7, 11, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 8, 4, 7, 8, 10, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 9, 2, 2, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 12, 9, 2, 12, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 3, 2, 2, 11, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 1, 3, 9, 2, 11, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 1, 10, 6, 1, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 13, 10, 6, 13, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 2, 1, 6, 12, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, 3, 2, 10, 6, 12, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 3, 2, 9, 3, 12, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 6, 2, 9, 6, 12, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 3, 7, 3, 8, 7, 11, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 8, 4, 7, 8, 10, false, randomIn, scattered); this.fillWithAir(worldIn, structureBoundingBoxIn, 3, 1, 3, 8, 2, 11); this.fillWithAir(worldIn, structureBoundingBoxIn, 4, 3, 6, 7, 3, 9); this.fillWithAir(worldIn, structureBoundingBoxIn, 2, 4, 2, 9, 5, 12); @@ -424,34 +423,34 @@ public class StructureScattered for (int i1 = 0; i1 <= 14; i1 += 14) { - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 4, i1, 2, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 4, i1, 4, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 4, i1, 7, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 4, i1, 9, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 4, i1, 2, 5, i1, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 4, i1, 4, 5, i1, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 4, i1, 7, 5, i1, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 4, i1, 9, 5, i1, false, randomIn, scattered); } - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 6, 0, 6, 6, 0, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 6, 0, 6, 6, 0, false, randomIn, scattered); for (int k1 = 0; k1 <= 11; k1 += 11) { for (int j1 = 2; j1 <= 12; j1 += 2) { - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 4, j1, k1, 5, j1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 4, j1, k1, 5, j1, false, randomIn, scattered); } - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 5, k1, 6, 5, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 9, k1, 6, 9, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 5, k1, 6, 5, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 9, k1, 6, 9, false, randomIn, scattered); } - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 2, 2, 9, 2, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 2, 9, 9, 2, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 12, 2, 9, 12, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 12, 9, 9, 12, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 4, 4, 9, 4, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 4, 7, 9, 4, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 10, 4, 9, 10, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 10, 7, 9, 10, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 9, 7, 6, 9, 7, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 2, 2, 9, 2, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 2, 9, 9, 2, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 12, 2, 9, 12, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 12, 9, 9, 12, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 4, 4, 9, 4, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 4, 7, 9, 4, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 10, 4, 9, 10, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 10, 7, 9, 10, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 9, 7, 6, 9, 7, false, randomIn, scattered); this.setBlockState(worldIn, i, 5, 9, 6, structureBoundingBoxIn); this.setBlockState(worldIn, i, 6, 9, 6, structureBoundingBoxIn); this.setBlockState(worldIn, j, 5, 9, 8, structureBoundingBoxIn); @@ -466,10 +465,10 @@ public class StructureScattered this.setBlockState(worldIn, i, 7, 1, 8, structureBoundingBoxIn); this.setBlockState(worldIn, i, 7, 2, 9, structureBoundingBoxIn); this.setBlockState(worldIn, i, 7, 3, 10, structureBoundingBoxIn); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 4, 1, 9, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 1, 9, 7, 1, 9, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 10, 7, 2, 10, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, 6, 4, 5, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 4, 1, 9, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 1, 9, 7, 1, 9, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 10, 7, 2, 10, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, 6, 4, 5, false, randomIn, scattered); this.setBlockState(worldIn, k, 4, 4, 5, structureBoundingBoxIn); this.setBlockState(worldIn, l, 7, 4, 5, structureBoundingBoxIn); @@ -486,30 +485,22 @@ public class StructureScattered for (int i2 = 1; i2 <= 13; i2 += 2) { - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -3, i2, 1, -2, i2, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -3, i2, 1, -2, i2, false, randomIn, scattered); } for (int j2 = 2; j2 <= 12; j2 += 2) { - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -1, j2, 3, -1, j2, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -1, j2, 3, -1, j2, false, randomIn, scattered); } - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, -2, 1, 5, -2, 1, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, -2, 1, 9, -2, 1, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -3, 1, 6, -3, 1, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -1, 1, 6, -1, 1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, -2, 1, 5, -2, 1, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, -2, 1, 9, -2, 1, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -3, 1, 6, -3, 1, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -1, 1, 6, -1, 1, false, randomIn, scattered); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.FACING, Facing.EAST).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true))), 1, -3, 8, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.FACING, Facing.WEST).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true))), 4, -3, 8, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 2, -3, 8, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 3, -3, 8, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 7, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 6, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 5, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 4, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 3, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 2, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 4, -3, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 3, -3, 1, structureBoundingBoxIn); if (!this.placedTrap1) @@ -523,11 +514,7 @@ public class StructureScattered this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 3, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 4, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -3, 6, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -3, 6, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -3, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 9, -3, 4, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -2, 4, structureBoundingBoxIn); if (!this.placedTrap2) { @@ -551,7 +538,7 @@ public class StructureScattered this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 7, -2, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 7, -1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 8, -3, 5, structureBoundingBoxIn); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, -1, 1, 9, -1, 5, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, -1, 1, 9, -1, 5, false, randomIn, scattered); this.fillWithAir(worldIn, structureBoundingBoxIn, 8, -3, 8, 10, -1, 10); this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 8, -2, 11, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 9, -2, 11, structureBoundingBoxIn); @@ -559,16 +546,12 @@ public class StructureScattered this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 8, -2, 12, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 9, -2, 12, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 10, -2, 12, structureBoundingBoxIn); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, -3, 8, 8, -3, 10, false, randomIn, junglePyramidsRandomScatteredStones); - this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, -3, 8, 10, -3, 10, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, -3, 8, 8, -3, 10, false, randomIn, scattered); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, -3, 8, 10, -3, 10, false, randomIn, scattered); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 10, -2, 9, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -2, 9, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -2, 10, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.redstone.getState(), 10, -1, 9, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.UP), 9, -2, 8, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.WEST)), 10, -2, 8, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.WEST)), 10, -1, 8, structureBoundingBoxIn); - this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH)), 10, -2, 10, structureBoundingBoxIn); if (!this.placedHiddenChest) { diff --git a/server/src/main/java/server/worldgen/structure/StructureStronghold.java b/server/src/main/java/server/worldgen/structure/StructureStronghold.java index ab7a19cb..b76736b9 100755 --- a/server/src/main/java/server/worldgen/structure/StructureStronghold.java +++ b/server/src/main/java/server/worldgen/structure/StructureStronghold.java @@ -532,7 +532,7 @@ public class StructureStronghold this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 7, 4, 5, 9, Blocks.concrete_slab.getState(), Blocks.concrete_slab.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 7, 8, 5, 9, Blocks.concrete_slab.getState(), Blocks.concrete_slab.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 7, 7, 5, 9, Blocks.concrete.getState(), Blocks.concrete.getState(), false); - this.setBlockState(worldIn, Blocks.torch.getState(), 6, 5, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), 6, 5, 6, structureBoundingBoxIn); return true; } } @@ -668,8 +668,8 @@ public class StructureStronghold { this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, l, 1, 4, l, Blocks.oak_planks.getState(), Blocks.oak_planks.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, l, 12, 4, l, Blocks.oak_planks.getState(), Blocks.oak_planks.getState(), false); - this.setBlockState(worldIn, Blocks.torch.getState(), 2, 3, l, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), 11, 3, l, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), 2, 3, l, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), 11, 3, l, structureBoundingBoxIn); if (this.isLargeRoom) { @@ -735,12 +735,12 @@ public class StructureStronghold this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1 - 1, 7, j1 + 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1, 7, j1 - 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1, 7, j1 + 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), i1 - 2, 8, j1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), i1 + 1, 8, j1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), i1 - 1, 8, j1 - 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), i1 - 1, 8, j1 + 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), i1, 8, j1 - 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), i1, 8, j1 + 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1 - 2, 8, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1 + 1, 8, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1 - 1, 8, j1 - 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1 - 1, 8, j1 + 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1, 8, j1 - 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1, 8, j1 + 1, structureBoundingBoxIn); } this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, RngLoot.addToList(LootConstants.STRONGHOLD_LIBRARY, ItemEnchantedBook.getRandom(randomIn, 1, 5, 2)), 1 + randomIn.zrange(4)); @@ -1076,10 +1076,10 @@ public class StructureStronghold this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 2, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 3, 5, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), 4, 3, 5, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), 6, 3, 5, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), 5, 3, 4, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState(), 5, 3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), 4, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), 6, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), 5, 3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), 5, 3, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 4, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 6, structureBoundingBoxIn); @@ -1135,7 +1135,7 @@ public class StructureStronghold this.setBlockState(worldIn, Blocks.cobblestone.getState(), 6, k, 6, structureBoundingBoxIn); } - this.setBlockState(worldIn, Blocks.torch.getState(), 5, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState(), 5, 3, 5, structureBoundingBoxIn); for (int l = 2; l <= 8; ++l) { @@ -1440,10 +1440,10 @@ public class StructureStronghold this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStronghold.strongholdStones); this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0); this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStronghold.Stronghold.Door.OPENING, 1, 1, 6); - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 1, Blocks.torch.getState()); - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 1, Blocks.torch.getState()); - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 5, Blocks.torch.getState()); - this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 5, Blocks.torch.getState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 1, Blocks.lit_torch.getState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 1, Blocks.lit_torch.getState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 5, Blocks.lit_torch.getState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 5, Blocks.lit_torch.getState()); if (this.expandsX) { diff --git a/server/src/main/java/server/worldgen/structure/StructureVillage.java b/server/src/main/java/server/worldgen/structure/StructureVillage.java index db72caec..bf317ab2 100755 --- a/server/src/main/java/server/worldgen/structure/StructureVillage.java +++ b/server/src/main/java/server/worldgen/structure/StructureVillage.java @@ -342,10 +342,10 @@ public class StructureVillage this.setBlockState(worldIn, Blocks.glass_pane.getState(), 0, 3, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.glass_pane.getState(), 4, 3, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.glass_pane.getState(), 2, 3, 8, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 2, 4, 7, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), 1, 4, 6, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), 3, 4, 6, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 4, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 2, 4, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), 1, 4, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), 3, 4, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 4, 5, structureBoundingBoxIn); State i = this.getMetadataWithOffset(Blocks.ladder.getState().withProperty(BlockLadder.FACING, Facing.WEST)); for (int j = 1; j <= 9; ++j) @@ -679,7 +679,7 @@ public class StructureVillage this.setBlockState(worldIn, Blocks.concrete.getState(), 6, 1, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 2, 1, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 2, 2, 0, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH))); if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air) @@ -689,7 +689,7 @@ public class StructureVillage this.setBlockState(worldIn, Blocks.air.getState(), 6, 1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 6, 2, 5, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 6, 3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 6, 3, 4, structureBoundingBoxIn); this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 6, 1, 5, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH))); for (int i1 = 0; i1 < 5; ++i1) @@ -1075,7 +1075,7 @@ public class StructureVillage this.setBlockState(worldIn, Blocks.oak_planks.getState(), 5, 5, 10, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 2, 1, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 2, 2, 0, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH))); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, -1, 3, 2, -1, Blocks.air.getState(), Blocks.air.getState(), false); @@ -1220,7 +1220,7 @@ public class StructureVillage this.setBlockState(worldIn, i, 3, 4, 3, structureBoundingBoxIn); } - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); for (int k = 0; k < 5; ++k) { @@ -1479,10 +1479,10 @@ public class StructureVillage this.setBlockState(worldIn, Blocks.oak_fence.getState(), 1, 2, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.white_wool.getState(), 1, 3, 0, structureBoundingBoxIn); boolean flag = this.coordBaseMode == Facing.EAST || this.coordBaseMode == Facing.NORTH; - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), flag ? 2 : 0, 3, 0, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 1, 3, 1, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), flag ? 0 : 2, 3, 0, structureBoundingBoxIn); - this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 1, 3, -1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), flag ? 2 : 0, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 1, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), flag ? 0 : 2, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 1, 3, -1, structureBoundingBoxIn); return true; } }