aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java1
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java54
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java1
-rw-r--r--src/Java/gtPlusPlus/core/util/Utils.java4
-rw-r--r--src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java4
5 files changed, 37 insertions, 27 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index bcf8d73f86..5360331040 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -67,6 +67,7 @@ public class COMPAT_HANDLER {
GregtechIndustrialFuelRefinery.run();
GregtechTreeFarmerTE.run();
GregtechIndustrialTreeFarm.run();
+ GregtechIndustrialSifter.run();
}
}
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
index da152bb8d8..871c286bc7 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
@@ -31,20 +31,27 @@ public class MultiPickaxeBase extends StaballoyPickaxe{
return 0;
}
+ protected boolean canBreak = true;
protected final int colour;
protected final String materialName;
protected final String displayName;
public boolean isValid = true;
private final Pair<?, ?> enchantment;
- public MultiPickaxeBase(final String unlocalizedName, final ToolMaterial material, final int materialDurability, final int colour, final Object enchant) {
+ public MultiPickaxeBase(final String unlocalizedName, final ToolMaterial material, final long materialDurability, final int colour, final Object enchant) {
super(Utils.sanitizeString(unlocalizedName), material);
this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
//this.setTextureName(CORE.MODID + ":" + "itemPickaxe");
this.setTextureName("minecraft"+":"+"iron_pickaxe");
this.FACING_HORIZONTAL=true;
this.setMaxStackSize(1);
- this.setMaxDamage(materialDurability*3);
+ if ((materialDurability*3) <= Integer.MAX_VALUE){
+ this.setMaxDamage((int) (materialDurability*3));
+ }
+ else {
+ this.setMaxDamage(Integer.MAX_VALUE);
+ this.canBreak = false;
+ }
this.colour = colour;
this.materialName = material.name();
this.displayName = unlocalizedName;
@@ -132,25 +139,6 @@ public class MultiPickaxeBase extends StaballoyPickaxe{
@Override
public String getItemStackDisplayName(final ItemStack iStack) {
return this.displayName;
- /*String name;
- if (getUnlocalizedName().toLowerCase().contains("wood")){
- name = "Wooden";
- }
- else if (getUnlocalizedName().toLowerCase().contains("cobblestone")){
- name = "Cobblestone";
- }
- else if (getUnlocalizedName().toLowerCase().contains("iron")){
- name = "Iron";
- }
- else if (getUnlocalizedName().toLowerCase().contains("gold")){
- name = "Gold";
- }
- else if (getUnlocalizedName().toLowerCase().contains("diamond")){
- name = "Diamond";
- }
- else {
- }
- return name+" Multipickaxe";*/
}
@Override
@@ -230,12 +218,16 @@ public class MultiPickaxeBase extends StaballoyPickaxe{
@Override
public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer){
- item.damageItem(damage, localPlayer);
+ if (this.canBreak){
+ item.damageItem(damage, localPlayer);
+ }
}
@Override
public void setItemDamage(final ItemStack item, final int damage){
- item.setItemDamage(damage-1);
+ if (this.canBreak){
+ item.setItemDamage(damage-1);
+ }
}
@@ -295,5 +287,21 @@ public class MultiPickaxeBase extends StaballoyPickaxe{
}
}
+
+
+ /**
+ *
+ * Time to Override Minecraft stupid mechanics, allowing unbreakable stuff.
+ *
+ */
+ public boolean isDamageable(){
+ if (this.getMaxDamage() > 0 && !this.hasSubtypes){
+ if (this.canBreak){
+ return true;
+ }
+ }
+ return false;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index e4370accc4..6ec24862c0 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -137,6 +137,7 @@ public class CORE {
public static boolean enableMultiblock_LiquidFluorideThoriumReactor = true;
public static boolean enableMultiblock_NuclearFuelRefinery = true;
public static boolean enableMultiblock_TreeFarmer = true;
+ public static boolean enableMultiblock_IndustrialSifter = true;
//Visuals
public static boolean enableTreeFarmerParticles = true;
diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java
index f969d3e075..45dc2ce701 100644
--- a/src/Java/gtPlusPlus/core/util/Utils.java
+++ b/src/Java/gtPlusPlus/core/util/Utils.java
@@ -340,8 +340,8 @@ public class Utils {
return targetList;
}
- public static List<Object> convertArrayListToList(@SuppressWarnings("rawtypes") final ArrayList sourceArray) {
- final List<Object> targetList = new ArrayList<>(Arrays.asList(sourceArray));
+ public static List<Object> convertArrayListToList(final ArrayList<Object> sourceArray) {
+ final List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray));
return targetList;
}
diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java
index da68bfaaae..1150fe6602 100644
--- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java
+++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java
@@ -35,8 +35,8 @@ public class MaterialUtils {
public static List<?> oreDictValuesForEntry(final String oredictName){
List<?> oredictItemNames;
if(OreDictionary.doesOreNameExist(oredictName)){
- final ArrayList<ItemStack> oredictItems = OreDictionary.getOres(oredictName);
- oredictItemNames = Utils.convertArrayListToList(oredictItems);
+ final List<ItemStack> oredictItems = OreDictionary.getOres(oredictName);
+ oredictItemNames = oredictItems;
return oredictItemNames;
}
return null;