Browse Source

Fixed Railcraft Crowbars not removing Covers

Gregorius Techneticies 2 months ago
parent
commit
a62a515e52
Signed by: Gregorius Techneticies <gregoriustech@gmail.com> GPG Key ID: 1B693EA14F2FD70F

+ 1
- 0
CHANGELOG.md View File

@@ -11,6 +11,7 @@ Nothing (I tend to only add finished Stuff to the Changelog).
11 11
 
12 12
 6.14.09: (Not released yet, released whenever it needs to be)
13 13
 [COMPAT] Aroma1997's Mining Dimension is now Compatible with my Worldgen.
14
+[FIXED] Railcraft Crowbars should now be able to remove Covers again, even if they dont use the overlay for technical reasons.
14 15
 [FIXED] Applied Energistics Quartz Cutter in Advanced Crafting Tables.
15 16
 [FIXED] Forestry Backpacks didn't work with Autocollecting Tools, because the Magnetic Autocollect did not throw an Item Collect Event.
16 17
 [FIXED] Chainsaws used WAY too much durability for Treecapitation!

+ 13
- 1
src/main/java/gregapi/GT_API_Proxy.java View File

@@ -887,7 +887,19 @@ public abstract class GT_API_Proxy extends Abstract_Proxy implements IGuiHandler
887 887
 						}
888 888
 						return;
889 889
 					}
890
-					// Instant breaking for those Hammers.
890
+					// Instant breaking for those Soft Hammers.
891
+					if (IL.MFR_Hammer.equal(aStack, T, T)) {
892
+						List<String> tChatReturn = new ArrayListNoNulls<>();
893
+						long tDamage = IBlockToolable.Util.onToolClick(TOOL_softhammer, Long.MAX_VALUE, 3, aEvent.entityPlayer, tChatReturn, aEvent.entityPlayer.inventory, aEvent.entityPlayer.isSneaking(), aStack, aEvent.entityPlayer.worldObj, (byte)aEvent.face, aEvent.x, aEvent.y, aEvent.z, 0.5F, 0.5F, 0.5F);
894
+						UT.Entities.sendchat(aEvent.entityPlayer, tChatReturn, F);
895
+						if (tDamage > 0) {
896
+							ST.use(aEvent.entityPlayer, aStack);
897
+							UT.Sounds.send(SFX.MC_BREAK, aEvent.entityPlayer);
898
+							aEvent.setCanceled(T);
899
+						}
900
+						return;
901
+					}
902
+					// Instant breaking for those Hard Hammers.
891 903
 					if (IL.IE_Hammer.equal(aStack, T, T)) {
892 904
 						List<String> tChatReturn = new ArrayListNoNulls<>();
893 905
 						long tDamage = IBlockToolable.Util.onToolClick(TOOL_hammer, Long.MAX_VALUE, 3, aEvent.entityPlayer, tChatReturn, aEvent.entityPlayer.inventory, aEvent.entityPlayer.isSneaking(), aStack, aEvent.entityPlayer.worldObj, (byte)aEvent.face, aEvent.x, aEvent.y, aEvent.z, 0.5F, 0.5F, 0.5F);

+ 1
- 0
src/main/java/gregapi/data/CS.java View File

@@ -1481,6 +1481,7 @@ public class CS {
1481 1481
 		public static final ItemStackSet<ItemStackContainer> AMMO_ITEMS = new ItemStackSet<>();
1482 1482
 		public static final ItemStackSet<ItemStackContainer> NON_AUTO_INSERT_ITEMS = new ItemStackSet<>();
1483 1483
 		public static final ItemStackSet<ItemStackContainer> CONTAINER_DURABILITY = new ItemStackSet<>();
1484
+		public static final ItemStackSet<ItemStackContainer> SPECIAL_CASE_TOOLS = new ItemStackSet<>();
1484 1485
 		public static final ItemStackSet<ItemStackContainer> SHOW_RESISTANCE = new ItemStackSet<>();
1485 1486
 		public static final ItemStackSet<ItemStackContainer> RECIPE_REMOVED_USE_TRASH_BIN_INSTEAD = new ItemStackSet<>();
1486 1487
 		public static final ItemStackSet<ItemStackContainer> NEI_DONT_SHOW_FLUIDS = new ItemStackSet<>();

+ 1
- 0
src/main/java/gregapi/data/IL.java View File

@@ -97,6 +97,7 @@ public enum IL implements IItemContainer {
97 97
 	CHSL_Granite, CHSL_Diorite, CHSL_Andesite, CHSL_Granite_Smooth, CHSL_Diorite_Smooth, CHSL_Andesite_Smooth,
98 98
 	CHSL_Present,
99 99
 	TG_Ore_Cluster_1, TG_Ore_Cluster_2, TG_Spawner_Zombie, TG_Spawner_Bug,
100
+	MFR_Hammer,
100 101
 	MFR_Fertilizer,
101 102
 	MFR_Log_Rubber, MFR_Leaves_Rubber, MFR_Leaves_Rubber_Dry, MFR_Sapling_Rubber, MFR_Sapling_Rubber_Sacred, MFR_Sapling_Rubber_Mega, MFR_Sapling_Rubber_Sacred_Mega,
102 103
 	RoC_Propolis_Slippery,

+ 12
- 11
src/main/java/gregapi/load/LoaderItemList.java View File

@@ -624,8 +624,8 @@ public class LoaderItemList implements Runnable {
624 624
 		OP.cell.mContainerItem =                     ST.mkic("cell"                                         , 1   , OreDictManager.INSTANCE.getFirstOre("cellEmpty", 1));
625 625
 		
626 626
 		
627
-		IL.TE_Wrench                            .set(ST.make(MD.TE, "wrench"                                , 1, 0));
628
-		IL.TE_Wrench_Battle                     .set(ST.make(MD.TE, "tool.battleWrenchInvar"                , 1, 0));
627
+		IL.TE_Wrench                            .set(ST.make(MD.TE, "wrench"                                , 1, 0)); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.TE_Wrench.wild(1));
628
+		IL.TE_Wrench_Battle                     .set(ST.make(MD.TE, "tool.battleWrenchInvar"                , 1, 0)); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.TE_Wrench_Battle.wild(1));
629 629
 		IL.TE_Cinnabar                          .set(ST.make(MD.TE_FOUNDATION, "material"                   , 1,  20));
630 630
 		IL.TE_Rod_Blizz                         .set(ST.make(MD.TE_FOUNDATION, "material"                   , 1,1024));
631 631
 		IL.TE_Rod_Blitz                         .set(ST.make(MD.TE_FOUNDATION, "material"                   , 1,1026));
@@ -656,10 +656,10 @@ public class LoaderItemList implements Runnable {
656 656
 		IL.RC_Bed_Stone                         .set(ST.make(MD.RC, "part.railbed"                          , 1, 1), new OreDictItemData(MT.Stone, U*6));
657 657
 		IL.RC_Rebar                             .set(ST.make(MD.RC, "part.rebar"                            , 1, 0));
658 658
 		IL.RC_Firestone_Cut                     .set(ST.make(MD.RC, "firestone.cut"                         , 1, 0), new OreDictItemData(MT.Firestone, U));
659
-		IL.RC_Crowbar_Iron                      .set(ST.make(MD.RC, "tool.crowbar"                          , 1, 0), new OreDictItemData(ANY.Fe, U*3).setUseVanillaDamage());
660
-		IL.RC_Crowbar_Steel                     .set(ST.make(MD.RC, "tool.crowbar.reinforced"               , 1, 0), new OreDictItemData(ANY.Steel, U*3).setUseVanillaDamage());
661
-		IL.RC_Crowbar_Thaumium                  .set(ST.make(MD.RC, "tool.crowbar.magic"                    , 1, 0), new OreDictItemData(MT.Thaumium, U*3).setUseVanillaDamage());
662
-		IL.RC_Crowbar_Voidmetal                 .set(ST.make(MD.RC, "tool.crowbar.void"                     , 1, 0), new OreDictItemData(MT.VoidMetal, U*3).setUseVanillaDamage());
659
+		IL.RC_Crowbar_Iron                      .set(ST.make(MD.RC, "tool.crowbar"                          , 1, 0), new OreDictItemData(ANY.Fe      , U*3).setUseVanillaDamage()); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.RC_Crowbar_Iron.wild(1));
660
+		IL.RC_Crowbar_Steel                     .set(ST.make(MD.RC, "tool.crowbar.reinforced"               , 1, 0), new OreDictItemData(ANY.Steel   , U*3).setUseVanillaDamage()); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.RC_Crowbar_Steel.wild(1));
661
+		IL.RC_Crowbar_Thaumium                  .set(ST.make(MD.RC, "tool.crowbar.magic"                    , 1, 0), new OreDictItemData(MT.Thaumium , U*3).setUseVanillaDamage()); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.RC_Crowbar_Thaumium.wild(1));
662
+		IL.RC_Crowbar_Voidmetal                 .set(ST.make(MD.RC, "tool.crowbar.void"                     , 1, 0), new OreDictItemData(MT.VoidMetal, U*3).setUseVanillaDamage()); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.RC_Crowbar_Voidmetal.wild(1));
663 663
 		IL.Tool_Sword_Steel                     .set(ST.make(MD.RC, "tool.steel.sword"                      , 1, 0), new OreDictItemData(ANY.Steel, OP.toolHeadSword  , ANY.Wood, U2).setUseVanillaDamage());
664 664
 		IL.Tool_Pickaxe_Steel                   .set(ST.make(MD.RC, "tool.steel.pickaxe"                    , 1, 0), new OreDictItemData(ANY.Steel, OP.toolHeadPickaxe, ANY.Wood, U ).setUseVanillaDamage());
665 665
 		IL.Tool_Shovel_Steel                    .set(ST.make(MD.RC, "tool.steel.shovel"                     , 1, 0), new OreDictItemData(ANY.Steel, OP.toolHeadShovel , ANY.Wood, U ).setUseVanillaDamage());
@@ -679,7 +679,7 @@ public class LoaderItemList implements Runnable {
679 679
 		
680 680
 		IL.IE_Creosote_Bottle                   .set(ST.make(MD.IE, "fluidContainers"                       , 1, 0), null, "bottleCreosote", OD.container1000creosote);
681 681
 		IL.IE_Creosote_Bucket                   .set(ST.make(MD.IE, "fluidContainers"                       , 1, 1), new OreDictItemData(ANY.Fe, U*3), "bucketCreosote", OD.container1000creosote);
682
-		IL.IE_Hammer                            .set(ST.make(MD.IE, "tool"                                  , 1, 0), new OreDictItemData(ANY.Fe, U*2, ANY.Wood, U));
682
+		IL.IE_Hammer                            .set(ST.make(MD.IE, "tool"                                  , 1, 0), new OreDictItemData(ANY.Fe, U*2, ANY.Wood, U)); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.IE_Hammer.wild(1));
683 683
 		IL.IE_Slag                              .set(ST.make(MD.IE, "material"                              , 1,13), null, OD.itemSlag);
684 684
 		IL.IE_Blueprint_Projectiles_Common      .set(ST.make(MD.IE, "blueprint"                             , 1, 0), new OreDictItemData(MT.Paper, 3*U));
685 685
 		IL.IE_Blueprint_Projectiles_Specialized .set(ST.make(MD.IE, "blueprint"                             , 1, 1), new OreDictItemData(MT.Paper, 3*U));
@@ -1342,6 +1342,7 @@ public class LoaderItemList implements Runnable {
1342 1342
 		if (IL.TG_Ore_Cluster_2.block() != NB) IL.TG_Ore_Cluster_2.block().setHardness(1000).setResistance(6000000).setHarvestLevel(TOOL_pickaxe, 3);
1343 1343
 		
1344 1344
 		
1345
+		IL.MFR_Hammer                           .set(ST.make(MD.MFR, "hammer"                               , 1, 0)); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.MFR_Hammer.wild(1));
1345 1346
 		IL.MFR_Fertilizer                       .set(ST.make(MD.MFR, "fertilizer"                           , 1, 0), null, OD.itemFertilizer, DYE_OREDICTS_MIXABLE[DYE_INDEX_Brown]);
1346 1347
 		IL.MFR_Log_Rubber                       .set(ST.make(MD.MFR, "rubberwood.log"                       , 1, 0), null, OD.logRubber);
1347 1348
 		IL.MFR_Sapling_Rubber                   .set(ST.make(MD.MFR, "rubberwood.sapling"                   , 1, 0), null, OP.treeSapling);
@@ -1366,16 +1367,16 @@ public class LoaderItemList implements Runnable {
1366 1367
 		IL.ICBM_Concrete                        .set(ST.make(MD.ICBM, "icbmCConcrete"                       , 1, 0));
1367 1368
 		
1368 1369
 		
1369
-		IL.BC_Wrench                            .set(ST.make(MD.BC, "wrenchItem"                            , 1, 0));
1370
+		IL.BC_Wrench                            .set(ST.make(MD.BC, "wrenchItem"                            , 1, 0)); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.BC_Wrench.wild(1));
1370 1371
 		
1371 1372
 		
1372
-		IL.AE_Wrench_Certus                     .set(ST.make(MD.AE, "item.ToolCertusQuartzWrench"           , 1, 0));
1373
-		IL.AE_Wrench_Quartz                     .set(ST.make(MD.AE, "item.ToolNetherQuartzWrench"           , 1, 0));
1373
+		IL.AE_Wrench_Certus                     .set(ST.make(MD.AE, "item.ToolCertusQuartzWrench"           , 1, 0)); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.AE_Wrench_Certus.wild(1));
1374
+		IL.AE_Wrench_Quartz                     .set(ST.make(MD.AE, "item.ToolNetherQuartzWrench"           , 1, 0)); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.AE_Wrench_Quartz.wild(1));
1374 1375
 		IL.AE_Cutter_Certus                     .set(ST.make(MD.AE, "item.ToolCertusQuartzCuttingKnife"     , 1, 0)); ItemsGT.CONTAINER_DURABILITY.add(IL.AE_Cutter_Certus.wild(1));
1375 1376
 		IL.AE_Cutter_Quartz                     .set(ST.make(MD.AE, "item.ToolNetherQuartzCuttingKnife"     , 1, 0)); ItemsGT.CONTAINER_DURABILITY.add(IL.AE_Cutter_Quartz.wild(1));
1376 1377
 		
1377 1378
 		
1378
-		IL.FR_Wrench                            .set(ST.make(MD.FR, "wrench"                                , 1, 0));
1379
+		IL.FR_Wrench                            .set(ST.make(MD.FR, "wrench"                                , 1, 0)); ItemsGT.SPECIAL_CASE_TOOLS.add(IL.FR_Wrench.wild(1));
1379 1380
 		IL.FR_Planks_Fireproof                  .set(ST.make(MD.FR, "planksFireproof"                       , 1, 0));
1380 1381
 		IL.FR_Planks                            .set(ST.make(MD.FR, "planks"                                , 1, 0));
1381 1382
 		IL.FR_Slabs_Fireproof                   .set(ST.make(MD.FR, "slabsFireproof"                        , 1, 0));

+ 3
- 2
src/main/java/gregapi/tileentity/base/TileEntityBase09FacingSingle.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2020 GregTech-6 Team
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *
@@ -26,6 +26,7 @@ import java.util.List;
26 26
 import gregapi.block.multitileentity.IMultiTileEntity.IMTE_AddToolTips;
27 27
 import gregapi.block.multitileentity.IMultiTileEntity.IMTE_OnPlaced;
28 28
 import gregapi.block.multitileentity.MultiTileEntityContainer;
29
+import gregapi.data.CS.ItemsGT;
29 30
 import gregapi.data.LH;
30 31
 import gregapi.data.LH.Chat;
31 32
 import gregapi.tileentity.ITileEntityMachineBlockUpdateable;
@@ -81,7 +82,7 @@ public abstract class TileEntityBase09FacingSingle extends TileEntityBase08Direc
81 82
 	@Override public String getFacingTool() {return TOOL_wrench;}
82 83
 	@Override public short getFacing() {return mFacing;}
83 84
 	@Override public void setFacing(short aFacing) {setPrimaryFacing(UT.Code.side(aFacing));}
84
-	@Override public boolean wrenchCanSetFacing(EntityPlayer aPlayer, int aSide) {return TOOL_wrench.equals(getFacingTool()) && getValidSides()[aSide];}
85
+	@Override public boolean wrenchCanSetFacing(EntityPlayer aPlayer, int aSide) {return TOOL_wrench.equals(getFacingTool()) && getValidSides()[aSide] && (aPlayer == null || !ItemsGT.SPECIAL_CASE_TOOLS.contains(aPlayer.getHeldItem(), T));}
85 86
 	@Override public boolean isConnectedWrenchingOverlay(ItemStack aStack, byte aSide) {return aSide == mFacing;}
86 87
 	
87 88
 	public void setPrimaryFacing(byte aFacing) {if (isClientSide() || aFacing == mFacing) return; byte oFacing = mFacing; mFacing = aFacing; updateClientData(); causeBlockUpdate(); onFacingChange(oFacing); checkCoverValidity(); doEnetUpdate(); if (hasMultiBlockMachineRelevantData()) ITileEntityMachineBlockUpdateable.Util.causeMachineUpdate(this, F);}

+ 2
- 2
src/main/java/gregapi/tileentity/behavior/TE_Behavior_Energy_Stats.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2019 Gregorius Techneticies
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *
@@ -49,7 +49,7 @@ public class TE_Behavior_Energy_Stats extends TE_Behavior_Energy {
49 49
 	public Collection<TagData> getTypes() {return mType.AS_LIST;}
50 50
 	
51 51
 	public void addToolTips(List<String> aList, ItemStack aStack, boolean aF3_H, String aSides, boolean aEmitting) {
52
-		aList.add((aEmitting ? (Chat.RED + LH.get(LH.ENERGY_OUTPUT)) : (Chat.GREEN + LH.get(LH.ENERGY_INPUT))) + ": " + Chat.WHITE + mRec + " " + mType.getChatFormat() + mType.getLocalisedNameShort() + Chat.WHITE + "/t ("+mMin+" to "+mMax+(UT.Code.stringInvalid(aSides)?"":", "+aSides)+")");
52
+		aList.add((aEmitting ? (Chat.RED + LH.get(LH.ENERGY_OUTPUT)) : (Chat.GREEN + LH.get(LH.ENERGY_INPUT))) + ": " + Chat.WHITE + mRec + " " + mType.getChatFormat() + mType.getLocalisedNameShort() + Chat.WHITE + "/t ("+(mMin>1?mMin+" to ":"up to ")+mMax+(UT.Code.stringInvalid(aSides)?"":", "+aSides)+")");
53 53
 		aList.add(aEmitting ? LH.getToolTipRedstoneFluxEmit(mType) : LH.getToolTipRedstoneFluxAccept(mType));
54 54
 	}
55 55
 	

+ 1
- 1
src/main/java/gregapi/tileentity/energy/TileEntityBase10EnergyConverter.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2020 GregTech-6 Team
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *

+ 1
- 1
src/main/java/gregtech/items/tools/machine/GT_Tool_WireCutter.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2020 GregTech-6 Team
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *

+ 1
- 1
src/main/java/gregtech/items/tools/machine/GT_Tool_Wrench.java View File

@@ -71,7 +71,7 @@ public class GT_Tool_Wrench extends ToolStats {
71 71
 		if (tString != null && tString.equals(TOOL_wrench)) return T;
72 72
 		if (aBlock.getMaterial().isLiquid()) return F;
73 73
 		tString = ST.regName(aBlock);
74
-		return tString != null && (tString.startsWith("BuildCraft|") || tString.startsWith("progressiveautomation"));
74
+		return tString != null && (tString.startsWith("BuildCraft|") || tString.startsWith("progressiveautomation") || tString.startsWith("MineFactoryReloaded:machine") || tString.startsWith("MineFactoryReloaded:rednet"));
75 75
 	}
76 76
 	
77 77
 	@Override

Loading…
Cancel
Save