Fix things

This commit is contained in:
Arcaratus 2015-06-22 12:57:41 -04:00
commit 62879c48cb
9 changed files with 246 additions and 12 deletions

View file

@ -79,6 +79,12 @@ public class ItemType
return result;
}
@Override
public String toString()
{
return item.getUnlocalizedName() + "@" + meta;
}
public static ItemType fromStack(ItemStack stack)
{
return new ItemType(stack.getItem(), stack.getItemDamage(), stack.stackTagCompound);

View file

@ -40,7 +40,7 @@ public class BloodMagicGuide
registerAlchemyBook();
BookBuilder bmBookBuilder = new BookBuilder();
bmBookBuilder.setCategories(categories).setUnlocBookTitle("guide.BloodMagic.book.title").setUnlocWelcomeMessage("guide.BloodMagic.welcomeMessage").setUnlocDisplayName("guide.BloodMagic.book.name").setBookColor(new Color(190, 10, 0));
bmBookBuilder.setCategories(categories).setUnlocBookTitle("guide.BloodMagic.book.title").setUnlocWelcomeMessage("guide.BloodMagic.welcomeMessage").setUnlocDisplayName("guide.BloodMagic.book.name").setBookColor(new Color(190, 10, 0)).setAuthor("--Blood Magic");
// bloodMagicGuide = new Book(categories, "guide.BloodMagic.book.title", "guide.BloodMagic.welcomeMessage", "guide.BloodMagic.book.name", new Color(190, 10, 0));
bloodMagicGuide = bmBookBuilder.build();

View file

@ -36,6 +36,7 @@ public class CommandSN extends CommandBase
{
EntityPlayerMP targetPlayer = getPlayer(icommandsender, astring[0]);
String owner = targetPlayer.getDisplayName();
EntityPlayerMP proxyPlayerName = getPlayer(icommandsender, astring[0]);
if (astring.length >= 2 && astring.length <= 3)
{
@ -90,7 +91,7 @@ public class CommandSN extends CommandBase
else if ("create".equalsIgnoreCase(astring[1]))
{
int orbTier = parseIntBounded(icommandsender, astring[2], 1, 6);
SoulNetworkHandler.setMaxOrbToMax(owner, orbTier);
SoulNetworkHandler.setMaxOrbToMax(proxyPlayerName.getDisplayName(), orbTier);
func_152373_a(icommandsender, this, "commands.soulnetwork.create.success", owner, orbTier);
}
else

View file

@ -1,11 +1,14 @@
package WayofTime.alchemicalWizardry.common.rituals;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.block.BlockOre;
import net.minecraft.block.BlockRedstoneOre;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@ -16,6 +19,7 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
public class RitualEffectMagnetic extends RitualEffect
@ -24,15 +28,29 @@ public class RitualEffectMagnetic extends RitualEffect
private static final int terraeDrain = 10;
private static final int orbisTerraeDrain = 10;
private static final Map<ItemType, Boolean> oreBlockCache = new HashMap<ItemType, Boolean>();
public static boolean isBlockOre(Block block, int meta)
{
if (block == null)
if (block == null || Item.getItemFromBlock(block) == null)
return false;
if (block instanceof BlockOre || block instanceof BlockRedstoneOre)
return true;
ItemStack itemStack = new ItemStack(block, 1, meta);
ItemType type = new ItemType(block, meta);
Boolean result = oreBlockCache.get(type);
if (result == null)
{
result = computeIsItemOre(type);
oreBlockCache.put(type, result);
}
return result;
}
private static boolean computeIsItemOre(ItemType type)
{
ItemStack itemStack = type.createStack(1);
for (int id : OreDictionary.getOreIDs(itemStack))
{
String oreName = OreDictionary.getOreName(id);
@ -75,6 +93,7 @@ public class RitualEffectMagnetic extends RitualEffect
int zRep = 0;
boolean replace = false;
outer:
for (int j = 1; j <= 3; j++)
{
for (int i = -1; i <= 1; i++)
@ -87,7 +106,7 @@ public class RitualEffectMagnetic extends RitualEffect
yRep = y + j;
zRep = z + k;
replace = true;
break;
break outer;
}
}
}

View file

@ -18,7 +18,7 @@ import java.util.zip.ZipFile;
public class GAPIChecker
{
public static boolean doneChecking = false;
public static String onlineVersion = "";
public static String onlineVersion = "@VERSION@";
public static boolean triedToWarnPlayer = false;
public static boolean startedDownload = false;