Some fixes

This commit is contained in:
pahimar 2012-12-31 03:14:44 -05:00
parent 50b822c15c
commit 984dcd7b4a
7 changed files with 14 additions and 32 deletions

View file

@ -234,28 +234,6 @@ public class EquivalencyHandler {
}
}
/* Ignores stack size for world transmutation */
public boolean areWorldEquivalent(Object obj1, Object obj2) {
ItemStack first = GeneralHelper.convertObjectToItemStack(obj1);
if(first == null) return false;
ItemStack second = GeneralHelper.convertObjectToItemStack(obj1);
if(second == null) return false;
if ((getEquivalencyList(first.itemID, first.getItemDamage()) != null) && (getEquivalencyList(second.itemID, second.getItemDamage()) != null)) {
if ((first.itemID == second.itemID) && (first.getItemDamage() == second.getItemDamage())) {
return true;
}
else {
return (getEquivalencyList(first.itemID, first.getItemDamage()).equals(getEquivalencyList(second.itemID, second.getItemDamage())));
}
}
else {
return false;
}
}
public void debug() {
int i = 0;

View file

@ -114,21 +114,19 @@ public class WorldTransmutationHandler {
int id = event.world.getBlockId(event.x, event.y, event.z);
int meta = event.world.getBlockMetadata(event.x, event.y, event.z);
Material material = event.world.getBlockMaterial(event.x, event.y, event.z);
boolean result = false;
if ((material == Material.leaves) && (id == Block.leaves.blockID)) {
meta = meta & 4;
}
else if ((material == Material.pumpkin) && (id == Block.pumpkin.blockID)) {
meta = 0;
Block currentBlock = Block.blocksList[id];
if (currentBlock != null) {
meta = currentBlock.damageDropped(meta);
}
ItemStack worldStack = new ItemStack(id, 1, meta);
ItemStack targetStack = new ItemStack(event.targetID, 1, event.targetMeta);
if (!worldStack.isItemEqual(targetStack)) {
if (EquivalencyHandler.instance().areWorldEquivalent(worldStack, targetStack)) {
if (EquivalencyHandler.instance().areEquivalent(worldStack, targetStack)) {
if (event.itemStack.getItemDamage() < event.itemStack.getMaxDamage()) {
result = TransmutationHelper.transmuteInWorld(event.world, event.player, event.player.getCurrentEquippedItem(), event.x, event.y, event.z, event.targetID, event.targetMeta);
}

View file

@ -18,6 +18,7 @@ public class Sounds {
SOUND_RESOURCE_LOCATION + "chargeDown.ogg",
SOUND_RESOURCE_LOCATION + "chargeUp.ogg",
SOUND_RESOURCE_LOCATION + "destruct.ogg",
SOUND_RESOURCE_LOCATION + "fail.ogg",
SOUND_RESOURCE_LOCATION + "gust.ogg",
SOUND_RESOURCE_LOCATION + "heal.ogg",
SOUND_RESOURCE_LOCATION + "kinesis.ogg",
@ -33,6 +34,7 @@ public class Sounds {
public static final String CHARGE_DOWN = SOUND_PREFIX + "chargeDown";
public static final String CHARGE_UP = SOUND_PREFIX + "chargeUp";
public static final String DESTRUCTION = SOUND_PREFIX + "destruct";
public static final String FAIL = SOUND_PREFIX + "fail";
public static final String GUST = SOUND_PREFIX + "gust";
public static final String HEAL = SOUND_PREFIX + "heal";
public static final String KINESIS = SOUND_PREFIX + "kinesis";
@ -46,5 +48,6 @@ public class Sounds {
public static final String WIND = SOUND_PREFIX + "wind";
public static final String CHARGE_FAIL = "mob.enderdragon.hit";
public static final String TRANSMUTE_FAIL = "mob.wither.hurt";
}

View file

@ -7,6 +7,7 @@ import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import com.pahimar.ee3.configuration.ConfigurationSettings;
import com.pahimar.ee3.network.PacketTypeHandler;
import cpw.mods.fml.common.network.Player;
@ -62,7 +63,9 @@ public class PacketSpawnParticle extends PacketEE {
EntityPlayer thePlayer = (EntityPlayer) player;
thePlayer.worldObj.spawnParticle(particleName, x, y, z, velocityX, velocityY, velocityZ);
if (ConfigurationSettings.ENABLE_PARTICLE_FX) {
thePlayer.worldObj.spawnParticle(particleName, x, y, z, velocityX, velocityY, velocityZ);
}
}
}

View file

@ -11,7 +11,7 @@
"x3n0ph0b3"
],
"credits": "By pahimar, based on Equivalent Exchange 1 & 2 by x3n0ph0b3",
"logoFile": "/ee3/art/logo.png",
"logoFile": "com/pahimar/ee3/art/logo.png",
"screenshots": [
],
"parent":"",

Binary file not shown.

View file

@ -6,5 +6,5 @@
<entry key="Minecraft 1.4.4">pre1b|http://goo.gl/Ria2V</entry>
<entry key="Minecraft 1.4.5">pre1d|http://goo.gl/Ria2V</entry>
<entry key="Minecraft 1.4.6">pre1e|http://goo.gl/Ria2V</entry>
<entry key="Minecraft 1.4.7">pre1e|http://goo.gl/Ria2V</entry>
<entry key="Minecraft 1.4.7">pre1f|http://goo.gl/Ria2V</entry>
</properties>