aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/items/behaviors
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2022-07-23 13:21:54 +0200
committerGitHub <noreply@github.com>2022-07-23 13:21:54 +0200
commit74464417fd78c389b9d84173a7f9aeb4443ae0b6 (patch)
tree84170a821c75e6198801438e7d5da71df48b2beb /src/main/java/gregtech/common/items/behaviors
parent4f4a5e495e5a71467fb22ae5694f508193bc5f13 (diff)
downloadGT5-Unofficial-74464417fd78c389b9d84173a7f9aeb4443ae0b6.tar.gz
GT5-Unofficial-74464417fd78c389b9d84173a7f9aeb4443ae0b6.tar.bz2
GT5-Unofficial-74464417fd78c389b9d84173a7f9aeb4443ae0b6.zip
add(api/enums): particle and sound effect enumerations (#1154)
* add(api/enums): particle and sound effect enumerations - Adds new GregTech API enumerations: - `ParticleFX`: Enumerates known EntityFX particles. - `SoundResource`: Enumerates known sounds with, id and ResourceLocation. - Refactors code to use the new enumerations instead of string literals. - Uses `ParticleFX` and `onRandomDisplayTick` to improve or implement new particle effects for these machines: - BBF: Adds random flames in front of the firebox. - Steam machines: Changes pressure-exhaust particles to white vapour, rather than dark smoke. - Magic Energy Absorber: Adds random effect, of absorbed magical purple particles, by the EnderDragon Egg siphon. - Forge Hammer: Adds sparse random sparks, ejected from the main face.
Diffstat (limited to 'src/main/java/gregtech/common/items/behaviors')
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java9
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java6
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java6
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java6
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java24
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java18
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java134
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java12
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java6
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java16
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java18
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java28
12 files changed, 143 insertions, 140 deletions
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java
index 4856c209fe..192acfc4a3 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java
@@ -1,6 +1,7 @@
package gregtech.common.items.behaviors;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.items.GT_MetaBase_Item;
@@ -36,18 +37,18 @@ public class Behaviour_Cover_Tool extends Behaviour_None {
initDataFromNBT(tNBT);
if (((aPlayer instanceof EntityPlayerMP)) && (aItem.canUse(aStack, 100.0D))) {
if (isCopyMode) {
- ArrayList<String> tList = new ArrayList();
+ ArrayList<String> tList = new ArrayList<>();
doCopy(tTileEntity, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ, tList);
aItem.discharge(aStack, 100.0D, Integer.MAX_VALUE, true, false, false);
writeListToNBT(tList, tNBT, aPlayer);
saveDataToNBT(tNBT);
}
else {
- doPaste(tTileEntity, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ, aPlayer);
+ doPaste(tTileEntity, aSide, hitX, hitY, hitZ, aPlayer);
aItem.discharge(aStack, 25.0D, Integer.MAX_VALUE, true, false, false);
}
}
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(108), 1, 1.0F, aX, aY, aZ);
+ GT_Utility.doSoundAtClient(SoundResource.IC2_TOOLS_OD_SCANNER, 1, 1.0F, aX, aY, aZ);
return aPlayer instanceof EntityPlayerMP;
}
@@ -121,7 +122,7 @@ public class Behaviour_Cover_Tool extends Behaviour_None {
}
}
- private void doPaste(TileEntity aTileEntity, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ, EntityPlayer aPlayer) {
+ private void doPaste(TileEntity aTileEntity, int aSide, float hitX, float hitY, float hitZ, EntityPlayer aPlayer) {
if (aTileEntity instanceof ICoverable) {
ICoverable tCoverable = (ICoverable) aTileEntity;
if (mCoverType == 0 || mStoredData == null) {
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java
index 4b6bd48a9e..afaa2f7016 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java
@@ -1,6 +1,6 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
@@ -37,7 +37,7 @@ public class Behaviour_Crowbar extends Behaviour_None {
aWorld.isRemote = true;
aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 1) % 10, 0);
aWorld.isRemote = false;
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(0)), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_BREAK, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -46,7 +46,7 @@ public class Behaviour_Crowbar extends Behaviour_None {
aWorld.isRemote = true;
aWorld.setBlock(aX, aY, aZ, aBlock, aMeta / 8 * 8 + (aMeta % 8 + 1) % 6, 0);
aWorld.isRemote = false;
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(0)), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_BREAK, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java
index a4a060074b..61081f060d 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java
@@ -1,7 +1,7 @@
package gregtech.common.items.behaviors;
import codechicken.lib.math.MathHelper;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
@@ -43,7 +43,7 @@ public class Behaviour_Lighter extends Behaviour_None {
prepare(aStack);
long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack);
if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) {
- GT_Utility.sendSoundToPlayers(aPlayer.worldObj, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, MathHelper.floor_double(aEntity.posX), MathHelper.floor_double(aEntity.posY), MathHelper.floor_double(aEntity.posZ));
+ GT_Utility.sendSoundToPlayers(aPlayer.worldObj, SoundResource.FIRE_IGNITE, 1.0F, 1.0F, MathHelper.floor_double(aEntity.posX), MathHelper.floor_double(aEntity.posY), MathHelper.floor_double(aEntity.posZ));
((EntityCreeper) aEntity).func_146079_cb();
if (!aPlayer.capabilities.isCreativeMode) {
tFuelAmount -= 1L;
@@ -80,7 +80,7 @@ public class Behaviour_Lighter extends Behaviour_None {
prepare(aStack);
long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack);
if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) {
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.FIRE_IGNITE, 1.0F, 1.0F, aX, aY, aZ);
aWorld.setBlock(aX, aY, aZ, Blocks.fire);
if (!aPlayer.capabilities.isCreativeMode) {
tFuelAmount -= 1L;
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java
index 63f922bcec..8aa3c86057 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java
@@ -1,6 +1,6 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.util.GT_LanguageManager;
@@ -29,8 +29,8 @@ public class Behaviour_Plunger_Essentia extends Behaviour_None {
}
TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (((aTileEntity instanceof IEssentiaTransport)) && (
- (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
for (ForgeDirection tDirection : ForgeDirection.VALID_DIRECTIONS) {
((IEssentiaTransport) aTileEntity).takeEssentia(((IEssentiaTransport) aTileEntity).getEssentiaType(tDirection), ((IEssentiaTransport) aTileEntity).getEssentiaAmount(tDirection), tDirection);
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java
index 16df231b43..56d7418d71 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java
@@ -1,6 +1,6 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaBase_Item;
@@ -36,24 +36,24 @@ public class Behaviour_Plunger_Fluid extends Behaviour_None {
if (((IFluidHandler) aTileEntity).drain(tDirection, 1000, false) != null) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
((IFluidHandler) aTileEntity).drain(tDirection, 1000, true);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
return true;
}
}
}
- }
+ }
if (aTileEntity instanceof IGregTechTileEntity) {
- IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aTileEntity;
- IMetaTileEntity mTileEntity = tTileEntity.getMetaTileEntity();
- if (mTileEntity instanceof GT_MetaTileEntity_BasicTank) {
- GT_MetaTileEntity_BasicTank machine = (GT_MetaTileEntity_BasicTank) mTileEntity;
- if(machine.mFluid!=null&&machine.mFluid.amount>0)
- machine.mFluid.amount = machine.mFluid.amount - Math.min(machine.mFluid.amount, 1000);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
- return true;
- }
+ IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aTileEntity;
+ IMetaTileEntity mTileEntity = tTileEntity.getMetaTileEntity();
+ if (mTileEntity instanceof GT_MetaTileEntity_BasicTank) {
+ GT_MetaTileEntity_BasicTank machine = (GT_MetaTileEntity_BasicTank) mTileEntity;
+ if (machine.mFluid != null && machine.mFluid.amount > 0)
+ machine.mFluid.amount = machine.mFluid.amount - Math.min(machine.mFluid.amount, 1000);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
+ return true;
}
+ }
return false;
}
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 ddb88b80c8..c5f231b3a8 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
@@ -1,6 +1,6 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.metatileentity.IMetaTileEntityItemPipe;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -34,22 +34,20 @@ public class Behaviour_Plunger_Item extends Behaviour_None {
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 (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, new HashMap<>(), 0L, false, true)).keySet()) {
int i = 0;
- for (int j = ((IMetaTileEntityItemPipe) tTileEntity).getSizeInventory(); i < j; i++) {
- if (((IMetaTileEntityItemPipe) tTileEntity).isValidSlot(i)) {
- if ((((IMetaTileEntityItemPipe) tTileEntity).getStackInSlot(i) != null) && (
- (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
- ItemStack tStack = ((IMetaTileEntityItemPipe) tTileEntity).decrStackSize(i, 64);
+ for (int j = tTileEntity.getSizeInventory(); i < j; i++) {
+ if (tTileEntity.isValidSlot(i)) {
+ if ((tTileEntity.getStackInSlot(i) != null) && (
+ (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
+ ItemStack tStack = tTileEntity.decrStackSize(i, 64);
if (tStack != null) {
EntityItem tEntity = new EntityItem(aWorld, ((IGregTechTileEntity) aTileEntity).getOffsetX((byte) aSide, 1) + 0.5D, ((IGregTechTileEntity) aTileEntity).getOffsetY((byte) aSide, 1) + 0.5D, ((IGregTechTileEntity) aTileEntity).getOffsetZ((byte) aSide, 1) + 0.5D, tStack);
tEntity.motionX = 0.0D;
tEntity.motionY = 0.0D;
tEntity.motionZ = 0.0D;
aWorld.spawnEntityInWorld(tEntity);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
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 3b6474edb9..5be17965cd 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java
@@ -2,6 +2,7 @@ package gregtech.common.items.behaviors;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
+import gregtech.api.enums.SoundResource;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.ItemData;
@@ -47,81 +48,84 @@ public class Behaviour_Prospecting extends Behaviour_None {
byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
- ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))){
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("100","This is ") + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + GT_Utility.trans("101"," Ore."));
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(1), 1.0F, -1.0F, aX, aY, aZ);
- return true;
- }
-
- if (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) ||
- aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack) ||
- aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone) ||
- aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockStones) ||
- aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) ||
- (aBlock == GregTech_API.sBlockOresUb1) ||
- (aBlock == GregTech_API.sBlockOresUb2) ||
- (aBlock == GregTech_API.sBlockOresUb3) ||
- (aBlock == GregTech_API.sBlockOres1)){
- if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(1), 1.0F, -1.0F, aX, aY, aZ);
- int tMetaID = 0;
- int tQuality = (aItem instanceof GT_MetaGenerated_Tool) ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") : 0;
- int tX = aX, tY = aY, tZ = aZ;
- Block tBlock;
- for (int i = 0, j = (int)(6 + tQuality); i < j; i++) {
- tX -= ForgeDirection.getOrientation(aSide).offsetX;
- tY -= ForgeDirection.getOrientation(aSide).offsetY;
- tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
-
- tBlock = aWorld.getBlock(tX, tY, tZ);
- if (tBlock == Blocks.lava || tBlock == Blocks.flowing_lava) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("102","There is Lava behind this Rock."));
- break;
- }
- if (tBlock instanceof BlockLiquid || tBlock instanceof IFluidBlock) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("103","There is a Liquid behind this Rock."));
- break;
- }
- if (tBlock == Blocks.monster_egg || !GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ)) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("104","There is an Air Pocket behind this Rock."));
- break;
- }
- if (tBlock != aBlock) {
- if (i < 4) GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("105","Material is changing behind this Rock."));
- break;
- }
- }
-
- Random tRandom = new XSTR(aX^aY^aZ^aSide);
- for (int i = 0, j = (int)(9+2*tQuality); i < j; i++) {
- tX = aX-4-tQuality+tRandom.nextInt(j);
- tY = aY-4-tQuality+tRandom.nextInt(j);
- tZ = aZ-4-tQuality+tRandom.nextInt(j);
- tBlock = aWorld.getBlock(tX, tY, tZ);
- if ((tBlock instanceof GT_Block_Ores_Abstract)) {
+ ItemData tAssociation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta));
+ if (tAssociation != null && tAssociation.mPrefix != null && tAssociation.mMaterial != null
+ && tAssociation.mPrefix.toString().startsWith("ore")) {
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("100", "This is ") + tAssociation.mMaterial.mMaterial.mDefaultLocalName + GT_Utility.trans("101", " Ore."));
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ);
+ return true;
+ }
+
+ if (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) ||
+ aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack) ||
+ aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone) ||
+ aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockStones) ||
+ aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites) ||
+ aBlock == GregTech_API.sBlockOresUb1 ||
+ aBlock == GregTech_API.sBlockOresUb2 ||
+ aBlock == GregTech_API.sBlockOresUb3 ||
+ aBlock == GregTech_API.sBlockOres1) {
+ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ);
+ int tMetaID;
+ int tQuality = aItem instanceof GT_MetaGenerated_Tool ? aItem.getHarvestLevel(aStack, "") : 0;
+ int tX = aX, tY = aY, tZ = aZ;
+ Block tBlock;
+ for (int i = 0, j = 6 + tQuality; i < j; i++) {
+ tX -= ForgeDirection.getOrientation(aSide).offsetX;
+ tY -= ForgeDirection.getOrientation(aSide).offsetY;
+ tZ -= ForgeDirection.getOrientation(aSide).offsetZ;
+
+ tBlock = aWorld.getBlock(tX, tY, tZ);
+ if (tBlock == Blocks.lava || tBlock == Blocks.flowing_lava) {
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("102", "There is Lava behind this Rock."));
+ break;
+ }
+ if (tBlock instanceof BlockLiquid || tBlock instanceof IFluidBlock) {
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("103", "There is a Liquid behind this Rock."));
+ break;
+ }
+ if (tBlock == Blocks.monster_egg || !GT_Utility.hasBlockHitBox(aWorld, tX, tY, tZ)) {
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("104", "There is an Air Pocket behind this Rock."));
+ break;
+ }
+ if (tBlock != aBlock) {
+ if (i < 4)
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("105", "Material is changing behind this Rock."));
+ break;
+ }
+ }
+
+ Random tRandom = new XSTR(aX ^ aY ^ aZ ^ aSide);
+ for (int i = 0, j = 9 + 2 * tQuality; i < j; i++) {
+ tX = aX - 4 - tQuality + tRandom.nextInt(j);
+ tY = aY - 4 - tQuality + tRandom.nextInt(j);
+ tZ = aZ - 4 - tQuality + tRandom.nextInt(j);
+ tBlock = aWorld.getBlock(tX, tY, tZ);
+ if (tBlock instanceof GT_Block_Ores_Abstract) {
TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ);
- if ((tTileEntity instanceof GT_TileEntity_Ores)) {
- Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
- if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("106","Found traces of ") + tMaterial.mDefaultLocalName + GT_Utility.trans("101"," Ore."));
+ if (tTileEntity instanceof GT_TileEntity_Ores) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000];
+ if (tMaterial != null && tMaterial != Materials._NULL) {
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("106", "Found traces of ") + tMaterial.mDefaultLocalName + GT_Utility.trans("101", " Ore."));
return true;
}
}
} else {
tMetaID = aWorld.getBlockMetadata(tX, tY, tZ);
- tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("106","Found traces of ") + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + GT_Utility.trans("101"," Ore."));
+ tAssociation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
+ if (tAssociation != null && tAssociation.mPrefix != null && tAssociation.mMaterial != null
+ && tAssociation.mPrefix.toString().startsWith("ore")) {
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("106", "Found traces of ") + tAssociation.mMaterial.mMaterial.mDefaultLocalName + GT_Utility.trans("101", " Ore."));
return true;
}
}
- }
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("107","No Ores found."));
- return true;
- }
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("107", "No Ores found."));
+ return true;
+ }
}
- return false;
+ return false;
}
@Override
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 065bdd2189..9f244a6162 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java
@@ -1,6 +1,6 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.util.GT_LanguageManager;
@@ -23,18 +23,18 @@ public class Behaviour_Scanner extends Behaviour_None {
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) {
NBTTagCompound tNBT = aStack.getTagCompound();
if (((aPlayer instanceof EntityPlayerMP)) && (aItem.canUse(aStack, 20000.0D))) {
- ArrayList<String> tList = new ArrayList();
+ ArrayList<String> tList = new ArrayList<>();
if (aItem.use(aStack, GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ), aPlayer)) {
int tList_sS=tList.size();
tNBT.setInteger("dataLinesCount",tList_sS);
for (int i = 0; i < tList_sS; i++) {
- tNBT.setString("dataLines"+Integer.toString(i),(String) tList.get(i));
- GT_Utility.sendChatToPlayer(aPlayer, (String) tList.get(i));
+ tNBT.setString("dataLines"+ i, tList.get(i));
+ GT_Utility.sendChatToPlayer(aPlayer, tList.get(i));
}
}
return true;
}
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(108), 1, 1.0F, aX, aY, aZ);
+ GT_Utility.doSoundAtClient(SoundResource.IC2_TOOLS_OD_SCANNER, 1, 1.0F, aX, aY, aZ);
//doGuiAtClient()
return aPlayer instanceof EntityPlayerMP;
}
@@ -47,7 +47,7 @@ public class Behaviour_Scanner extends Behaviour_None {
if(lines<1) throw new Exception();
aList.add(EnumChatFormatting.BLUE+"Block scan data result:");
for (int i = 0; i < lines; i++) {
- aList.add(EnumChatFormatting.RESET+tNBT.getString("dataLines" + Integer.toString(i)));
+ aList.add(EnumChatFormatting.RESET+tNBT.getString("dataLines" + i));
}
}catch(Exception e){
aList.add(this.mTooltip);
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java
index 8662dd7769..a6e047cb6d 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java
@@ -1,6 +1,6 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
@@ -32,14 +32,14 @@ public class Behaviour_Screwdriver extends Behaviour_None {
if ((aBlock == Blocks.unpowered_repeater) || (aBlock == Blocks.powered_repeater)) {
if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
if ((aBlock == Blocks.unpowered_comparator) || (aBlock == Blocks.powered_comparator)) {
if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java
index 43f10995ca..e4edc6b8e2 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java
@@ -1,6 +1,6 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.util.GT_LanguageManager;
@@ -36,7 +36,7 @@ public class Behaviour_SoftHammer extends Behaviour_None {
aWorld.isRemote = true;
aWorld.setBlock(aX, aY, aZ, Blocks.redstone_lamp, 0, 0);
aWorld.isRemote = false;
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -45,7 +45,7 @@ public class Behaviour_SoftHammer extends Behaviour_None {
aWorld.isRemote = true;
aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 0);
aWorld.isRemote = false;
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -54,7 +54,7 @@ public class Behaviour_SoftHammer extends Behaviour_None {
aWorld.isRemote = true;
aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 8) % 16, 0);
aWorld.isRemote = false;
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -63,7 +63,7 @@ public class Behaviour_SoftHammer extends Behaviour_None {
aWorld.isRemote = true;
aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 8) % 16, 0);
aWorld.isRemote = false;
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -76,21 +76,21 @@ public class Behaviour_SoftHammer extends Behaviour_None {
if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest)) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta - 1) % 4 + 2, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
if (aBlock == Blocks.hopper) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 1) % 6 != 1 ? (aMeta + 1) % 6 : 2, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(101), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java
index 5d316f009e..d2d1d60240 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java
@@ -1,8 +1,8 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.ItemList;
+import gregtech.api.enums.SoundResource;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
@@ -26,7 +26,7 @@ public class Behaviour_Spray_Color extends Behaviour_None {
private final ItemStack mFull;
private final long mUses;
private final byte mColor;
- private final Collection<Block> mAllowedVanillaBlocks = Arrays.asList(new Block[]{Blocks.glass, Blocks.glass_pane, Blocks.stained_glass, Blocks.stained_glass_pane, Blocks.carpet, Blocks.hardened_clay, ItemList.TE_Rockwool.getBlock()});
+ private final Collection<Block> mAllowedVanillaBlocks = Arrays.asList(Blocks.glass, Blocks.glass_pane, Blocks.stained_glass, Blocks.stained_glass_pane, Blocks.carpet, Blocks.hardened_clay, ItemList.TE_Rockwool.getBlock());
private final String mTooltip;
private final String mTooltipUses = GT_LanguageManager.addStringLocalization("gt.behaviour.paintspray.uses", "Remaining Uses:");
private final String mTooltipUnstackable = GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!");
@@ -60,7 +60,7 @@ public class Behaviour_Spray_Color extends Behaviour_None {
tUses = this.mUses;
}
if ((GT_Utility.areStacksEqual(aStack, this.mUsed, true)) && (colorize(aWorld, aX, aY, aZ, aSide))) {
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(102)), 1.0F, 1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_PAINTER, 1.0F, 1.0F, aX, aY, aZ);
if (!aPlayer.capabilities.isCreativeMode) {
tUses -= 1L;
}
@@ -90,24 +90,24 @@ public class Behaviour_Spray_Color extends Behaviour_None {
Block aBlock = aWorld.getBlock(aX, aY, aZ);
if ((aBlock != Blocks.air) && ((this.mAllowedVanillaBlocks.contains(aBlock)) || ((aBlock instanceof BlockColored)))) {
if (aBlock == Blocks.hardened_clay) {
- aWorld.setBlock(aX, aY, aZ, Blocks.stained_hardened_clay, (this.mColor ^ 0xFFFFFFFF) & 0xF, 3);
+ aWorld.setBlock(aX, aY, aZ, Blocks.stained_hardened_clay, (~this.mColor) & 0xF, 3);
return true;
}
if (aBlock == Blocks.glass_pane) {
- aWorld.setBlock(aX, aY, aZ, Blocks.stained_glass_pane, (this.mColor ^ 0xFFFFFFFF) & 0xF, 3);
+ aWorld.setBlock(aX, aY, aZ, Blocks.stained_glass_pane, (~this.mColor) & 0xF, 3);
return true;
}
if (aBlock == Blocks.glass) {
- aWorld.setBlock(aX, aY, aZ, Blocks.stained_glass, (this.mColor ^ 0xFFFFFFFF) & 0xF, 3);
+ aWorld.setBlock(aX, aY, aZ, Blocks.stained_glass, (~this.mColor) & 0xF, 3);
return true;
}
- if (aWorld.getBlockMetadata(aX, aY, aZ) == ((this.mColor ^ 0xFFFFFFFF) & 0xF)) {
+ if (aWorld.getBlockMetadata(aX, aY, aZ) == ((~this.mColor) & 0xF)) {
return false;
}
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (this.mColor ^ 0xFFFFFFFF) & 0xF, 3);
+ aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (~this.mColor) & 0xF, 3);
return true;
}
- return aBlock.recolourBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aSide), (this.mColor ^ 0xFFFFFFFF) & 0xF);
+ return aBlock.recolourBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aSide), (~this.mColor) & 0xF);
}
@Override
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 5bb89c9dd5..2a29578706 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java
@@ -1,6 +1,6 @@
package gregtech.common.items.behaviors;
-import gregtech.api.GregTech_API;
+import gregtech.api.enums.SoundResource;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.util.GT_LanguageManager;
@@ -43,14 +43,14 @@ public class Behaviour_Wrench extends Behaviour_None {
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);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ ((IWrenchable) aTileEntity).setFacing(aTargetSide);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) {
int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3;
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) {
+ if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, (long) tDamage * this.mCosts))) {
ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer);
for (ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) {
if (tOutput == null) {
@@ -61,7 +61,7 @@ public class Behaviour_Wrench extends Behaviour_None {
}
}
aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -72,21 +72,21 @@ public class Behaviour_Wrench extends Behaviour_None {
if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aMeta / 4 * 4 + (aMeta % 4 + 1) % 4, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -94,7 +94,7 @@ public class Behaviour_Wrench extends Behaviour_None {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta)));
aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -103,7 +103,7 @@ public class Behaviour_Wrench extends Behaviour_None {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0)));
aWorld.setBlockToAir(aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -111,21 +111,21 @@ public class Behaviour_Wrench extends Behaviour_None {
if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) {
if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) {
if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
if (aBlock == Blocks.hopper) {
if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) {
aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return true;
}
@@ -136,7 +136,7 @@ public class Behaviour_Wrench extends Behaviour_None {
if (!aPlayer.capabilities.isCreativeMode) {
((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts);
}
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(100), 1.0F, -1.0F, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(aWorld, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, aX, aY, aZ);
}
return false;
}