@@ -965,7 +965,7 @@ private static void addBlocks(Texture texture, String... names) {
965965 addBlock ("mangrove_log" , (name , tag ) -> log (tag , Texture .mangroveLog , Texture .mangroveLogTop ));
966966 addBlock ("stripped_mangrove_log" , (name , tag ) -> log (tag , Texture .strippedMangroveLog , Texture .strippedMangroveLogTop ));
967967 addBlock ("mangrove_planks" , Texture .mangrovePlanks );
968- addBlock ("mangrove_pressure_plate" , (name , tag ) -> new PressurePlate ( name , Texture .mangrovePlanks ));
968+ addBlock ("mangrove_pressure_plate" , (name , tag ) -> pressurePlate ( tag , Texture .mangrovePlanks ));
969969 addBlock ("mangrove_sign" , (name , tag ) -> sign (tag , "mangrove" ));
970970 addBlock ("mangrove_wall_sign" , (name , tag ) -> wallSign (tag , "mangrove" ));
971971 addBlock ("mangrove_slab" , (name , tag ) -> slab (tag , Texture .mangrovePlanks ));
@@ -998,7 +998,7 @@ private static void addBlocks(Texture texture, String... names) {
998998 addBlock ("stripped_bamboo_block" , (name , tag ) -> log (tag , Texture .strippedBambooBlock , Texture .strippedBambooBlockTop ));
999999 addBlock ("bamboo_planks" , Texture .bambooPlanks );
10001000 addBlock ("bamboo_mosaic" , Texture .bambooMosaic );
1001- addBlock ("bamboo_pressure_plate" , (name , tag ) -> new PressurePlate ( name , Texture .bambooPlanks ));
1001+ addBlock ("bamboo_pressure_plate" , (name , tag ) -> pressurePlate ( tag , Texture .bambooPlanks ));
10021002 addBlock ("bamboo_sign" , (name , tag ) -> sign (tag , "bamboo" ));
10031003 addBlock ("bamboo_wall_sign" , (name , tag ) -> wallSign (tag , "bamboo" ));
10041004 addBlock ("bamboo_slab" , (name , tag ) -> slab (tag , Texture .bambooPlanks ));
@@ -1014,7 +1014,7 @@ private static void addBlocks(Texture texture, String... names) {
10141014 addBlock ("cherry_log" , (name , tag ) -> log (tag , Texture .cherryLog , Texture .cherryLogTop ));
10151015 addBlock ("stripped_cherry_log" , (name , tag ) -> log (tag , Texture .strippedCherryLog , Texture .strippedCherryLogTop ));
10161016 addBlock ("cherry_planks" , Texture .cherryPlanks );
1017- addBlock ("cherry_pressure_plate" , (name , tag ) -> new PressurePlate ( name , Texture .cherryPlanks ));
1017+ addBlock ("cherry_pressure_plate" , (name , tag ) -> pressurePlate ( tag , Texture .cherryPlanks ));
10181018 addBlock ("cherry_sign" , (name , tag ) -> sign (tag , "cherry" ));
10191019 addBlock ("cherry_wall_sign" , (name , tag ) -> wallSign (tag , "cherry" ));
10201020 addBlock ("cherry_slab" , (name , tag ) -> slab (tag , Texture .cherryPlanks ));
@@ -1132,7 +1132,7 @@ private static void addBlocks(Texture texture, String... names) {
11321132 addBlock ("pale_oak_planks" , Texture .paleOakPlanks );
11331133 addBlock ("pale_oak_slab" , (name , tag ) -> slab (tag , Texture .paleOakPlanks ));
11341134 addBlock ("pale_oak_stairs" , (name , tag ) -> stairs (tag , Texture .paleOakPlanks ));
1135- addBlock ("pale_oak_pressure_plate" , (name , tag ) -> new PressurePlate ( name , Texture .sprucePlanks ));
1135+ addBlock ("pale_oak_pressure_plate" , (name , tag ) -> pressurePlate ( tag , Texture .sprucePlanks ));
11361136 addBlock ("pale_oak_fence" , (name , tag ) -> fence (tag , Texture .paleOakPlanks ));
11371137 addBlock ("pale_oak_fence_gate" , (name , tag ) -> fenceGate (tag , Texture .paleOakPlanks ));
11381138 addBlock ("pale_oak_trapdoor" , (name , tag ) -> orientableTrapdoor (tag , Texture .paleOakTrapdoor ));
@@ -1640,19 +1640,19 @@ public Block getBlockByTag(String namespacedName, Tag tag) {
16401640 case "lever" :
16411641 return lever (tag );
16421642 case "stone_pressure_plate" :
1643- return new PressurePlate ( name , Texture .stone );
1643+ return pressurePlate ( tag , Texture .stone );
16441644 case "oak_pressure_plate" :
1645- return new PressurePlate ( name , Texture .oakPlanks );
1645+ return pressurePlate ( tag , Texture .oakPlanks );
16461646 case "spruce_pressure_plate" :
1647- return new PressurePlate ( name , Texture .sprucePlanks );
1647+ return pressurePlate ( tag , Texture .sprucePlanks );
16481648 case "birch_pressure_plate" :
1649- return new PressurePlate ( name , Texture .birchPlanks );
1649+ return pressurePlate ( tag , Texture .birchPlanks );
16501650 case "jungle_pressure_plate" :
1651- return new PressurePlate ( name , Texture .jungleTreePlanks );
1651+ return pressurePlate ( tag , Texture .jungleTreePlanks );
16521652 case "acacia_pressure_plate" :
1653- return new PressurePlate ( name , Texture .acaciaPlanks );
1653+ return pressurePlate ( tag , Texture .acaciaPlanks );
16541654 case "dark_oak_pressure_plate" :
1655- return new PressurePlate ( name , Texture .darkOakPlanks );
1655+ return pressurePlate ( tag , Texture .darkOakPlanks );
16561656 case "redstone_ore" :
16571657 return new MinecraftBlock (name , Texture .redstoneOre );
16581658 case "redstone_torch" :
@@ -1832,9 +1832,9 @@ public Block getBlockByTag(String namespacedName, Tag tag) {
18321832 case "trapped_chest" :
18331833 return chest (tag , Chest .Kind .TRAPPED );
18341834 case "light_weighted_pressure_plate" :
1835- return new PressurePlate ( name , Texture .goldBlock );
1835+ return pressurePlate ( tag , Texture .goldBlock );
18361836 case "heavy_weighted_pressure_plate" :
1837- return new PressurePlate ( name , Texture .ironBlock );
1837+ return pressurePlate ( tag , Texture .ironBlock );
18381838 case "daylight_detector" : {
18391839 String inverted = tag .get ("Properties" ).get ("inverted" ).stringValue ("false" );
18401840 return new DaylightDetector (inverted .equals ("true" ));
@@ -2846,9 +2846,9 @@ public Block getBlockByTag(String namespacedName, Tag tag) {
28462846 case "warped_planks" :
28472847 return new MinecraftBlock (name , Texture .warpedPlanks );
28482848 case "crimson_pressure_plate" :
2849- return new PressurePlate ( name , Texture .crimsonPlanks );
2849+ return pressurePlate ( tag , Texture .crimsonPlanks );
28502850 case "warped_pressure_plate" :
2851- return new PressurePlate ( name , Texture .warpedPlanks );
2851+ return pressurePlate ( tag , Texture .warpedPlanks );
28522852 case "crimson_slab" :
28532853 return slab (tag , Texture .crimsonPlanks );
28542854 case "warped_slab" :
@@ -2926,7 +2926,7 @@ public Block getBlockByTag(String namespacedName, Tag tag) {
29262926 case "polished_blackstone_button" :
29272927 return button (tag , Texture .polishedBlackstone );
29282928 case "polished_blackstone_pressure_plate" :
2929- return new PressurePlate ( name , Texture .polishedBlackstone );
2929+ return pressurePlate ( tag , Texture .polishedBlackstone );
29302930 case "quartz_bricks" :
29312931 return new MinecraftBlock (name , Texture .quartzBricks );
29322932 case "chain" : // < 25w35a
@@ -3584,12 +3584,13 @@ private Block vine(Tag tag) {
35843584
35853585 private Block tripwire (Tag tag ) {
35863586 Tag properties = tag .get ("Properties" );
3587- String north = properties .get ("north" ).stringValue ("false" );
3588- String south = properties .get ("south" ).stringValue ("false" );
3589- String east = properties .get ("east" ).stringValue ("false" );
3590- String west = properties .get ("west" ).stringValue ("false" );
35913587 return new Tripwire (
3592- north .equals ("true" ), south .equals ("true" ), east .equals ("true" ), west .equals ("true" ));
3588+ BlockProvider .stringToBoolean (properties .get ("attached" )),
3589+ BlockProvider .stringToBoolean (properties .get ("north" )),
3590+ BlockProvider .stringToBoolean (properties .get ("south" )),
3591+ BlockProvider .stringToBoolean (properties .get ("east" )),
3592+ BlockProvider .stringToBoolean (properties .get ("west" ))
3593+ );
35933594 }
35943595
35953596 private Block tripwireHook (Tag tag ) {
@@ -3739,6 +3740,14 @@ private static Block copperBars(Tag tag, Texture texture) {
37393740 );
37403741 }
37413742
3743+ private static Block pressurePlate (Tag tag , Texture texture ) {
3744+ return new PressurePlate (
3745+ BlockProvider .blockName (tag ),
3746+ texture ,
3747+ BlockProvider .stringToBoolean (tag .get ("Properties" ).get ("powered" ))
3748+ );
3749+ }
3750+
37423751 private static Block nonSolid (Block block ) {
37433752 block .solid = false ;
37443753 return block ;
0 commit comments