Browse Source

Now the Cutters from AE should actually work

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

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

@@ -1480,6 +1480,7 @@ public class CS {
1480 1480
 		public static final ItemStackSet<ItemStackContainer> DEBUG_ITEMS = new ItemStackSet<>();
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
+		public static final ItemStackSet<ItemStackContainer> CONTAINER_DURABILITY = new ItemStackSet<>();
1483 1484
 		public static final ItemStackSet<ItemStackContainer> SHOW_RESISTANCE = new ItemStackSet<>();
1484 1485
 		public static final ItemStackSet<ItemStackContainer> RECIPE_REMOVED_USE_TRASH_BIN_INSTEAD = new ItemStackSet<>();
1485 1486
 		public static final ItemStackSet<ItemStackContainer> NEI_DONT_SHOW_FLUIDS = new ItemStackSet<>();

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

@@ -1371,8 +1371,8 @@ public class LoaderItemList implements Runnable {
1371 1371
 		
1372 1372
 		IL.AE_Wrench_Certus                     .set(ST.make(MD.AE, "item.ToolCertusQuartzWrench"           , 1, 0));
1373 1373
 		IL.AE_Wrench_Quartz                     .set(ST.make(MD.AE, "item.ToolNetherQuartzWrench"           , 1, 0));
1374
-		IL.AE_Cutter_Certus                     .set(ST.make(MD.AE, "item.ToolCertusQuartzCuttingKnife"     , 1, 0));
1375
-		IL.AE_Cutter_Quartz                     .set(ST.make(MD.AE, "item.ToolNetherQuartzCuttingKnife"     , 1, 0));
1374
+		IL.AE_Cutter_Certus                     .set(ST.make(MD.AE, "item.ToolCertusQuartzCuttingKnife"     , 1, 0)); ItemsGT.CONTAINER_DURABILITY.add(IL.AE_Cutter_Certus.wild(1));
1375
+		IL.AE_Cutter_Quartz                     .set(ST.make(MD.AE, "item.ToolNetherQuartzCuttingKnife"     , 1, 0)); ItemsGT.CONTAINER_DURABILITY.add(IL.AE_Cutter_Quartz.wild(1));
1376 1376
 		
1377 1377
 		
1378 1378
 		IL.FR_Wrench                            .set(ST.make(MD.FR, "wrench"                                , 1, 0));
@@ -1698,7 +1698,7 @@ public class LoaderItemList implements Runnable {
1698 1698
 		IL.IC2_Biochaff                         .set(ST.mkic("biochaff"                                     , 1   ));
1699 1699
 		IL.IC2_ShaftIron                        .set(ST.mkic("ironshaft"                                    , 1   ), new OreDictItemData(ANY.Fe, U*9));
1700 1700
 		IL.IC2_ShaftSteel                       .set(ST.mkic("steelshaft"                                   , 1   ), new OreDictItemData(ANY.Steel, U*9));
1701
-		IL.IC2_ForgeHammer                      .set(ST.mkic("ForgeHammer"                                  , 1   ));
1701
+		IL.IC2_ForgeHammer                      .set(ST.mkic("ForgeHammer"                                  , 1   )); ItemsGT.CONTAINER_DURABILITY.add(IL.IC2_ForgeHammer.wild(1));
1702 1702
 		IL.IC2_Debug                            .set(ST.mkic("debug"                                        , 1   )); ItemsGT.DEBUG_ITEMS.add(IL.IC2_Debug.wild(1)); ItemsGT.ILLEGAL_DROPS.add(IL.IC2_Debug.wild(1));
1703 1703
 		IL.IC2_AdvBattery                       .set(ST.mkic("advBattery"                                   , 1   ));
1704 1704
 		IL.Cell_Universal_Fluid                 .set(ST.mkic("FluidCell"                                    , 1   ), new OreDictItemData(MT.Sn, U*2, OM.stack(MT.Glass, 3*U8)));
@@ -1755,7 +1755,7 @@ public class LoaderItemList implements Runnable {
1755 1755
 		IL.Tool_Shovel_Bronze                   .set(ST.mkic("bronzeShovel"                                 , 1, 0), new OreDictItemData(MT.Bronze, OP.toolHeadShovel , ANY.Wood, U ).setUseVanillaDamage());
1756 1756
 		IL.Tool_Axe_Bronze                      .set(ST.mkic("bronzeAxe"                                    , 1, 0), new OreDictItemData(MT.Bronze, OP.toolHeadAxe    , ANY.Wood, U ).setUseVanillaDamage());
1757 1757
 		IL.Tool_Hoe_Bronze                      .set(ST.mkic("bronzeHoe"                                    , 1, 0), new OreDictItemData(MT.Bronze, OP.toolHeadHoe    , ANY.Wood, U ).setUseVanillaDamage());
1758
-		IL.IC2_WireCutter                       .set(ST.mkic("cutter"                                       , 1   ));
1758
+		IL.IC2_WireCutter                       .set(ST.mkic("cutter"                                       , 1   )); ItemsGT.CONTAINER_DURABILITY.add(IL.IC2_WireCutter.wild(1));
1759 1759
 		
1760 1760
 		IL.Credit_Iron                          .set(ST.mkic("coin"                                         , 1   ));
1761 1761
 		

+ 4
- 4
src/main/java/gregapi/util/ST.java View File

@@ -807,13 +807,15 @@ public class ST {
807 807
 	
808 808
 	public static ItemStack container(ItemStack aStack, boolean aCheckIFluidContainerItems) {
809 809
 		if (invalid(aStack)) return NI;
810
+		// Decrease Durability by 1 for these Items.
811
+		if (ItemsGT.CONTAINER_DURABILITY.contains(aStack, T)) return copyMeta(meta_(aStack) + 1, aStack);
812
+		// Use normal Container Item Mechanics.
810 813
 		if (item_(aStack).hasContainerItem(aStack)) return copy(item_(aStack).getContainerItem(aStack));
811
-		/** These are all special Cases, in which it is intended to have only GT Blocks outputting those Container Items */
814
+		// These are all special Cases, in which it is intended to have only GT Blocks outputting those Container Items.
812 815
 		if (IL.Cell_Empty.exists()) {
813 816
 			if (IL.Cell_Empty.equal(aStack, F, T)) return NI;
814 817
 			if (IL.Cell_Empty.equal(aStack, T, T)) return IL.Cell_Empty.get(1);
815 818
 		}
816
-		
817 819
 		if (aCheckIFluidContainerItems && item_(aStack) instanceof IFluidContainerItem && ((IFluidContainerItem)item_(aStack)).getCapacity(aStack) > 0) {
818 820
 			ItemStack tStack = amount(1, aStack);
819 821
 			((IFluidContainerItem)item_(aStack)).drain(tStack, Integer.MAX_VALUE, T);
@@ -822,8 +824,6 @@ public class ST {
822 824
 			if (tStack.getTagCompound().hasNoTags()) tStack.setTagCompound(null);
823 825
 			return tStack;
824 826
 		}
825
-		
826
-		if (IL.IC2_ForgeHammer.equal(aStack, T, T) || IL.IC2_WireCutter.equal(aStack, T, T) || IL.AE_Cutter_Quartz.equal(aStack, T, T) || IL.AE_Cutter_Certus.equal(aStack, T, T)) return copyMeta(meta_(aStack) + 1, aStack);
827 827
 		return NI;
828 828
 	}
829 829
 	

Loading…
Cancel
Save