Not quite

This commit is contained in:
StevenRS11
2013-11-06 16:53:14 -05:00
parent d849071e8e
commit b4e0d53509
5 changed files with 19 additions and 8 deletions

View File

@@ -28,6 +28,6 @@ public class ItemBlockDimWall extends ItemBlock
public String getUnlocalizedName(ItemStack par1ItemStack) public String getUnlocalizedName(ItemStack par1ItemStack)
{ {
return subNames[getItemDamageFromStack(par1ItemStack)]; return subNames[(par1ItemStack.getItemDamage())];
} }
} }

View File

@@ -59,7 +59,7 @@ public class ItemRiftBlade extends ItemSword
} }
} }
@Override //@Override
public int getDamageVsEntity(Entity par1Entity) public int getDamageVsEntity(Entity par1Entity)
{ {
return 7; return 7;
@@ -72,7 +72,8 @@ public class ItemRiftBlade extends ItemSword
return true; return true;
} }
@Override //TODO fix damage
//@Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{ {
par1ItemStack.damageItem(1, par3EntityLiving); par1ItemStack.damageItem(1, par3EntityLiving);

View File

@@ -98,14 +98,14 @@ public class ItemRiftSignature extends Item
stack.stackSize--; stack.stackSize--;
} }
clearSource(stack); clearSource(stack);
player.sendChatToPlayer("Rift Created"); mod_pocketDim.sendChat(player,("Rift Created"));
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1); world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
} }
else else
{ {
//The link signature has not been used. Store its current target as the first location. //The link signature has not been used. Store its current target as the first location.
setSource(stack, x, adjustedY, z,orientation, PocketManager.getDimensionData(world)); setSource(stack, x, adjustedY, z,orientation, PocketManager.getDimensionData(world));
player.sendChatToPlayer("Location Stored in Rift Signature"); mod_pocketDim.sendChat(player,("Location Stored in Rift Signature"));
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1); world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
} }
return true; return true;

View File

@@ -56,7 +56,7 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
// or if the player can pay an Ender Pearl to create a rift. // or if the player can pay an Ender Pearl to create a rift.
if (!player.capabilities.isCreativeMode && !player.inventory.hasItem(Item.enderPearl.itemID)) if (!player.capabilities.isCreativeMode && !player.inventory.hasItem(Item.enderPearl.itemID))
{ {
player.sendChatToPlayer("You don't have any Ender Pearls!"); mod_pocketDim.sendChat(player,"You don't have any Ender Pearls!");
return true; return true;
} }
@@ -86,14 +86,14 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
{ {
player.inventory.consumeInventoryItem(Item.enderPearl.itemID); player.inventory.consumeInventoryItem(Item.enderPearl.itemID);
} }
player.sendChatToPlayer("Rift Created"); mod_pocketDim.sendChat(player,"Rift Created");
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1); world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
} }
else else
{ {
//The link signature has not been used. Store its current target as the first location. //The link signature has not been used. Store its current target as the first location.
setSource(stack, x, adjustedY, z, orientation, PocketManager.getDimensionData(world)); setSource(stack, x, adjustedY, z, orientation, PocketManager.getDimensionData(world));
player.sendChatToPlayer("Location Stored in Rift Signature"); mod_pocketDim.sendChat(player,"Location Stored in Rift Signature");
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1); world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
} }
return true; return true;

View File

@@ -8,9 +8,11 @@ import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityEggInfo; import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.ForgeChunkManager; import net.minecraftforge.common.ForgeChunkManager;
@@ -326,4 +328,12 @@ public class mod_pocketDim
ChunkLoaderHelper.loadChunkForcedWorlds(event); ChunkLoaderHelper.loadChunkForcedWorlds(event);
} }
public static void sendChat(EntityPlayer player, String message)
{
ChatMessageComponent cmp = new ChatMessageComponent();
cmp.addText(message);
player.sendChatToPlayer(cmp);
}
} }