Add telepad recipe

This commit is contained in:
tterrag1098 committed 2015-03-19 21:49:40 -04:00
1 parent 537e18ab4d
commit d4b9c3fba3
2 files changed
+31 -49

No files matched your search

@@ -2,11 +2,13 @@ package crazypants.enderio.teleport;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.material.Alloy;
import crazypants.enderio.material.BlockFusedQuartz;
import crazypants.enderio.material.Material;
import crazypants.enderio.power.Capacitors;
@@ -21,8 +23,7 @@ public class TeleportRecipes {
if(Config.travelAnchorEnabled) {
ItemStack travelBlock = new ItemStack(EnderIO.blockTravelPlatform);
ItemStack pulsCry = new ItemStack(EnderIO.itemMaterial, 1, Material.PULSATING_CYSTAL.ordinal());
GameRegistry
.addShapedRecipe(travelBlock, "ibi", "bcb", "ibi", 'i', Items.iron_ingot, 'b', conduitBinder, 'c', pulsCry);
GameRegistry.addShapedRecipe(travelBlock, "ibi", "bcb", "ibi", 'i', Items.iron_ingot, 'b', conduitBinder, 'c', pulsCry);
}
if(Config.travelStaffEnabled) {
@@ -31,10 +32,16 @@ public class TeleportRecipes {
EnderIO.itemTravelStaff.setEnergy(travelStaff, 0);
ItemStack endCry = new ItemStack(EnderIO.itemMaterial, 1, Material.ENDER_CRYSTAL.ordinal());
ItemStack darkSteel = new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal());
IRecipe rec = GameRegistry
.addShapedRecipe(travelStaff, " e", " s ", "s ", 's', darkSteel, 'c', enderCapacitor, 'e', endCry);
GameRegistry.addShapedRecipe(travelStaff, " e", " s ", "s ", 's', darkSteel, 'c', enderCapacitor, 'e', endCry);
}
if(Config.travelAnchorEnabled && Config.travelStaffEnabled) {
ItemStack travelBlock = new ItemStack(EnderIO.blockTravelPlatform);
ItemStack telepad = new ItemStack(EnderIO.blockTelePad);
ItemStack octadic = new ItemStack(EnderIO.itemBasicCapacitor, 1, Capacitors.ENDER_CAPACITOR.ordinal());
ItemStack staff = new ItemStack(EnderIO.itemTravelStaff, 1, OreDictionary.WILDCARD_VALUE);
ItemStack fq = new ItemStack(EnderIO.blockFusedQuartz, 1, BlockFusedQuartz.Type.FUSED_QUARTZ.ordinal());
GameRegistry.addRecipe(new ShapedOreRecipe(telepad, "gSg", "dAd", "dod", 'g', fq, 'S', staff, 'd', "ingotDarkSteel", 'A', travelBlock, 'o', octadic));
}
}
}
+17 -42
View File
@@ -1,56 +1,31 @@
package crazypants.util;
import net.minecraftforge.common.UsernameCache;
import java.util.Map;
import java.util.UUID;
public class PlayerUtil {
public static UUID getPlayerUUID(String username) {
for (Map.Entry<UUID, String> entry : UsernameCache.getMap().entrySet()) {
public static UUID getPlayerUUID(String username)
{
/*
if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(username);
UUID uuid = null;
if (profile == null)
uuid = EntityPlayer.func_146094_a(new GameProfile(null, username));
else
uuid = profile.getId();
return uuid;
}
else
return PacketPlayerUUID.playerUUID.get(username);
*/
for (Map.Entry<UUID,String> entry : UsernameCache.getMap().entrySet())
{
if (entry.getValue().equalsIgnoreCase(username))
{
return entry.getKey();
}
}
return null;
if(entry.getValue().equalsIgnoreCase(username)) {
return entry.getKey();
}
}
return null;
}
public static UUID getPlayerUIDUnstable(String possibleUUID)
{
if(possibleUUID==null || possibleUUID.isEmpty())
return null;
UUID uuid=null;
try
{
uuid=UUID.fromString(possibleUUID);
}
catch(IllegalArgumentException e)
{
uuid=getPlayerUUID(possibleUUID);
}
return uuid;
public static UUID getPlayerUIDUnstable(String possibleUUID) {
if(possibleUUID == null || possibleUUID.isEmpty())
return null;
UUID uuid = null;
try {
uuid = UUID.fromString(possibleUUID);
} catch (IllegalArgumentException e) {
uuid = getPlayerUUID(possibleUUID);
}
return uuid;
}
}