aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/items/behaviors
diff options
context:
space:
mode:
authorMuramasa <haydenkilloh@gmail.com>2016-09-24 23:05:18 +0100
committerMuramasa <haydenkilloh@gmail.com>2016-09-24 23:05:18 +0100
commitfed8109b17fd2b41de17ceef92f37e39dc1ffc53 (patch)
tree9806dc7273bfc03fbb7a6eff1f6d0f98ce3a5bc3 /src/main/java/gregtech/common/items/behaviors
parent291839871e1233ba0c72e48cf16847246a1ccc7c (diff)
parent380211de8a2aaeaa6b24bbde34625bba4e626d79 (diff)
downloadGT5-Unofficial-fed8109b17fd2b41de17ceef92f37e39dc1ffc53.tar.gz
GT5-Unofficial-fed8109b17fd2b41de17ceef92f37e39dc1ffc53.tar.bz2
GT5-Unofficial-fed8109b17fd2b41de17ceef92f37e39dc1ffc53.zip
Update with exp changes
Diffstat (limited to 'src/main/java/gregtech/common/items/behaviors')
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java2
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java4
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java4
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java3
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java3
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java3
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java2
7 files changed, 10 insertions, 11 deletions
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
index 995a438ff4..a339c5f35b 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
@@ -94,7 +94,7 @@ public class Behaviour_DataOrb
}
public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
- if (!getDataTitle(aStack).equals("")) {
+ if (!(getDataTitle(aStack).length() == 0)) {
aList.add(getDataTitle(aStack));
aList.add(getDataName(aStack));
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java
index 105c39022a..38a9f6facd 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java
@@ -24,8 +24,8 @@ public class Behaviour_DataStick
tString = GT_Utility.ItemNBT.getPunchCardData(aStack);
if (GT_Utility.isStringValid(tString)) {
aList.add("Punch Card Data");
- int i = 0;
- for (int j = tString.length(); i < j; i += 64) {
+ int i = 0;int j = tString.length();
+ for (; i < j; i += 64) {
aList.add(tString.substring(i, Math.min(i + 64, j)));
}
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java
index 049a5bfbcb..90d882f048 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java
@@ -14,8 +14,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import java.util.HashMap;
import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
public class Behaviour_Plunger_Item
extends Behaviour_None {
@@ -34,7 +34,7 @@ public class Behaviour_Plunger_Item
if ((aTileEntity instanceof IGregTechTileEntity)) {
IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aTileEntity).getMetaTileEntity();
if ((tMetaTileEntity instanceof IMetaTileEntityItemPipe)) {
- for (Object tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, new HashMap(), 0L, false, true)).keySet())
+ for (Object tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, new ConcurrentHashMap(), 0L, false, true)).keySet())
{
int i = 0;
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java
index 339a69433b..c950cc8fe1 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java
@@ -5,6 +5,7 @@ import gregtech.api.enums.Materials;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.ItemData;
+import gregtech.api.objects.XSTR;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
@@ -87,7 +88,7 @@ public class Behaviour_Prospecting
break;
}
}
- Random tRandom = new Random(aX ^ aY ^ aZ ^ aSide);
+ Random tRandom = new XSTR(aX ^ aY ^ aZ ^ aSide);
i = 0;
for (int j = 9 + 2 * tQuality; i < j; i++) {
tX = aX - 4 - tQuality + tRandom.nextInt(j);
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java
index efea09bce3..187027a563 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java
@@ -22,7 +22,8 @@ public class Behaviour_Scanner
if (((aPlayer instanceof EntityPlayerMP)) && (aItem.canUse(aStack, 20000.0D))) {
ArrayList<String> tList = new ArrayList();
if (aItem.use(aStack, GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ), aPlayer)) {
- for (int i = 0; i < tList.size(); i++) {
+ int tList_sS=tList.size();
+ for (int i = 0; i < tList_sS; i++) {
GT_Utility.sendChatToPlayer(aPlayer, (String) tList.get(i));
}
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java
index 90daed57dd..f256f036ca 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java
@@ -1,6 +1,5 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.items.GT_MetaBase_Item;
@@ -98,8 +97,6 @@ public class Behaviour_Sonictron
}
public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- if ((!aWorld.isRemote) && (aWorld.getBlock(aX, aY, aZ) == GregTech_API.sBlockMachines) && (aWorld.getBlockMetadata(aX, aY, aZ) == 6)) {
- }
setCurrentIndex(aStack, -1);
return false;
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java
index d8c42232dd..f111e9f0fc 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java
@@ -40,7 +40,7 @@ public class Behaviour_Wrench
byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ);
TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
try {
- if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) {
+ if (((aTileEntity instanceof IWrenchable))) {
if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
((IWrenchable) aTileEntity).setFacing((short) aTargetSide);