Merge upstream

This commit is contained in:
skyboy 2013-11-06 18:19:31 -05:00
commit 7769a6e6a5
4 changed files with 16 additions and 6 deletions

View file

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

View file

@ -98,14 +98,14 @@ public class ItemRiftSignature extends Item
stack.stackSize--;
}
clearSource(stack);
player.sendChatToPlayer("Rift Created");
mod_pocketDim.sendChat(player,("Rift Created"));
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
}
else
{
//The link signature has not been used. Store its current target as the first location.
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);
}
return true;

View file

@ -57,7 +57,7 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
// or if the player can pay an Ender Pearl to create a rift.
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!");
// I won't do this, but this is the chance to localize chat
// messages sent to the player; look at ChatMessageComponent
// and how MFR does it with items like the safari net launcher
@ -90,14 +90,14 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
{
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);
}
else
{
//The link signature has not been used. Store its current target as the first location.
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);
}
return true;

View file

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