diff --git a/src/main/java/WayofTime/bloodmagic/BloodMagic.java b/src/main/java/WayofTime/bloodmagic/BloodMagic.java index ce2f8153..5ff8bdc4 100644 --- a/src/main/java/WayofTime/bloodmagic/BloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/BloodMagic.java @@ -36,14 +36,14 @@ public class BloodMagic { public static final String NAME = "Blood Magic: Alchemical Wizardry"; public static final String VERSION = "@VERSION@"; public static final String DEPEND = "required-after:guideapi;"; + public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); + public static final List> PLUGINS = Lists.newArrayList(); public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab") { @Override public ItemStack getTabIconItem() { return OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK); } }; - public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); - public static final List> PLUGINS = Lists.newArrayList(); public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome") { @Override public ItemStack getTabIconItem() { diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockString.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockString.java deleted file mode 100644 index 7afab9bd..00000000 --- a/src/main/java/WayofTime/bloodmagic/block/base/BlockString.java +++ /dev/null @@ -1,97 +0,0 @@ -package WayofTime.bloodmagic.block.base; - -import WayofTime.bloodmagic.block.property.PropertyString; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.NonNullList; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import org.apache.commons.lang3.ArrayUtils; - -/** - * Creates a block that has multiple meta-based states. - *

- * These states will be named after the given string array. Somewhere along the - * way, each value is {@code toLowerCase()}'ed, so the blockstate JSON needs all - * values to be lowercase. - */ -public class BlockString extends Block { - private final int maxMeta; - private final String[] types; - private final PropertyString property; - private final BlockStateContainer realStateContainer; - - public BlockString(Material material, String[] values, String propName) { - super(material); - - this.maxMeta = values.length; - this.types = values; - - this.property = PropertyString.create(propName, values); - this.realStateContainer = createStateContainer(); - setDefaultState(getBlockState().getBaseState()); - } - - public BlockString(Material material, String[] values) { - this(material, values, "type"); - } - - @Override - protected final BlockStateContainer createBlockState() { - return new BlockStateContainer.Builder(this).build(); // Blank to avoid crashes - } - - @Override - public final BlockStateContainer getBlockState() { - return realStateContainer; - } - - @Override - public IBlockState getStateFromMeta(int meta) { - return getDefaultState().withProperty(property, types[meta]); - } - - @Override - public int getMetaFromState(IBlockState state) { - return ArrayUtils.indexOf(types, state.getValue(property)); - } - - @Override - public int damageDropped(IBlockState state) { - return getMetaFromState(state); - } - - @SideOnly(Side.CLIENT) - @Override - public void getSubBlocks(CreativeTabs tab, NonNullList subBlocks) { - for (int i = 0; i < maxMeta; i++) - subBlocks.add(new ItemStack(this, 1, i)); - } - - protected BlockStateContainer createStateContainer() { - System.out.println(""); - BlockStateContainer ctn = new BlockStateContainer.Builder(this).add(property).build(); - System.out.println("Number of states: " + ctn.getValidStates().size()); - return ctn; - } - - public int getMaxMeta() { - return maxMeta; - } - - public String[] getTypes() { - return types; - } - - public PropertyString getProperty() { - return property; - } - - public BlockStateContainer getRealStateContainer() { - return realStateContainer; - } -} diff --git a/src/main/java/WayofTime/bloodmagic/block/property/PropertyString.java b/src/main/java/WayofTime/bloodmagic/block/property/PropertyString.java deleted file mode 100644 index 1706dcb4..00000000 --- a/src/main/java/WayofTime/bloodmagic/block/property/PropertyString.java +++ /dev/null @@ -1,41 +0,0 @@ -package WayofTime.bloodmagic.block.property; - -import com.google.common.base.Optional; -import com.google.common.collect.ImmutableSet; -import net.minecraft.block.properties.PropertyHelper; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.Collection; - -public class PropertyString extends PropertyHelper { - private final ImmutableSet allowedValues; - - protected PropertyString(String name, String[] values) { - super(name, String.class); - allowedValues = ImmutableSet.copyOf(values); - } - - @SideOnly(Side.CLIENT) - public Optional parseValue(String value) { - return allowedValues.contains(value) ? Optional.of(value) : Optional.absent(); - } - - @Override - public Collection getAllowedValues() { - return allowedValues; - } - - public String getName0(String value) { - return value; - } - - @Override - public String getName(String value) { - return this.getName0(value); - } - - public static PropertyString create(String name, String[] values) { - return new PropertyString(name, values); - } -} diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIPickUpAlly.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIPickUpAlly.java index bb120f4a..eb69d601 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIPickUpAlly.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIPickUpAlly.java @@ -1,6 +1,7 @@ package WayofTime.bloodmagic.entity.ai; import WayofTime.bloodmagic.entity.mob.EntityAspectedDemonBase; +import WayofTime.bloodmagic.util.BMLog; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.pathfinding.Path; @@ -142,7 +143,7 @@ public class EntityAIPickUpAlly extends EntityAIBase { double d0 = this.getAttackReachSqr(potentialPickup); if (distance <= d0 && this.attackTick <= 0 && !potentialPickup.isRiding()) { - System.out.println("Hai!"); + BMLog.DEBUG.info("Hai!"); potentialPickup.startRiding(this.entity, true); } } diff --git a/src/main/java/WayofTime/bloodmagic/inversion/InversionPillarHandler.java b/src/main/java/WayofTime/bloodmagic/inversion/InversionPillarHandler.java index b1b2517b..e988ba1f 100644 --- a/src/main/java/WayofTime/bloodmagic/inversion/InversionPillarHandler.java +++ b/src/main/java/WayofTime/bloodmagic/inversion/InversionPillarHandler.java @@ -1,6 +1,7 @@ package WayofTime.bloodmagic.inversion; import WayofTime.bloodmagic.soul.EnumDemonWillType; +import WayofTime.bloodmagic.util.BMLog; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -63,7 +64,7 @@ public class InversionPillarHandler { //Assume that it has been added already. private static void onPillarAdded(World world, EnumDemonWillType type, BlockPos pos) { - System.out.println("Adding..."); + BMLog.DEBUG.info("Adding..."); List closePosList = new ArrayList(); int dim = world.provider.getDimension(); @@ -114,7 +115,7 @@ public class InversionPillarHandler { } private static void onPillarRemoved(World world, EnumDemonWillType type, BlockPos pos) { - System.out.println("Removing..."); + BMLog.DEBUG.info("Removing..."); int dim = world.provider.getDimension(); if (nearPillarMap.containsKey(dim)) { Map>> willMap = nearPillarMap.get(dim); diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java b/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java index 9b1bd3f3..10c4776b 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java @@ -1,6 +1,7 @@ package WayofTime.bloodmagic.item; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.util.BMLog; import WayofTime.bloodmagic.util.helper.NBTHelper; import WayofTime.bloodmagic.client.IVariantProvider; import WayofTime.bloodmagic.util.helper.TextHelper; @@ -76,7 +77,7 @@ public class ItemExperienceBook extends Item implements IVariantProvider { int neededExp = (int) Math.ceil((1 - progress) * expToNext); float containedExp = (float) getStoredExperience(stack); - System.out.println("Needed: " + neededExp + ", contained: " + containedExp + ", exp to next: " + expToNext); + BMLog.DEBUG.info("Needed: " + neededExp + ", contained: " + containedExp + ", exp to next: " + expToNext); if (containedExp >= neededExp) { setStoredExperience(stack, containedExp - neededExp); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGrimReaperSprint.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGrimReaperSprint.java index 3d562a37..9a3830ad 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGrimReaperSprint.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGrimReaperSprint.java @@ -5,6 +5,7 @@ import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade; import WayofTime.bloodmagic.livingArmour.StatTracker; import WayofTime.bloodmagic.livingArmour.LivingArmour; import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeGrimReaperSprint; +import WayofTime.bloodmagic.util.BMLog; import WayofTime.bloodmagic.util.Utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -102,7 +103,7 @@ public class StatTrackerGrimReaperSprint extends StatTracker { StatTracker tracker = armour.getTracker(BloodMagic.MODID + ".tracker.grimReaper"); if (tracker instanceof StatTrackerGrimReaperSprint) { ((StatTrackerGrimReaperSprint) tracker).totalDeaths++; - System.out.println(((StatTrackerGrimReaperSprint) tracker).totalDeaths); + BMLog.DEBUG.info(String.valueOf(((StatTrackerGrimReaperSprint) tracker).totalDeaths)); tracker.markDirty(); } // changeMap.put(armour, changeMap.containsKey(armour) ? changeMap.get(armour) + 1 : 1); diff --git a/src/main/java/WayofTime/bloodmagic/structures/BuildTestStructure.java b/src/main/java/WayofTime/bloodmagic/structures/BuildTestStructure.java index 58b52194..bf1d7826 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/BuildTestStructure.java +++ b/src/main/java/WayofTime/bloodmagic/structures/BuildTestStructure.java @@ -1,6 +1,7 @@ package WayofTime.bloodmagic.structures; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.util.BMLog; import net.minecraft.server.MinecraftServer; import net.minecraft.util.Mirror; import net.minecraft.util.ResourceLocation; @@ -25,7 +26,7 @@ public class BuildTestStructure { Template template = templatemanager.getTemplate(minecraftserver, resource); if (template == null) { - System.out.println("Invalid template for location: " + resource); + BMLog.DEBUG.warn("Invalid template for location: " + resource); return false; } diff --git a/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java b/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java index 3ca1a305..c0137c5d 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java +++ b/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java @@ -1,6 +1,7 @@ package WayofTime.bloodmagic.structures; import WayofTime.bloodmagic.ritual.data.AreaDescriptor; +import WayofTime.bloodmagic.util.BMLog; import net.minecraft.util.EnumFacing; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; @@ -131,7 +132,7 @@ public class Dungeon { long endTime = System.nanoTime(); long duration = (endTime - startTime); //divide by 1000000 to get milliseconds. - System.out.println("Duration: " + duration + "(ns), " + duration / 1000000 + "(ms)"); + BMLog.DEBUG.info("Duration: " + duration + "(ns), " + duration / 1000000 + "(ms)"); //Building what I've got for (Entry> entry : roomMap.entrySet()) { diff --git a/src/main/java/WayofTime/bloodmagic/structures/DungeonStructure.java b/src/main/java/WayofTime/bloodmagic/structures/DungeonStructure.java index 8e06624f..198869e6 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/DungeonStructure.java +++ b/src/main/java/WayofTime/bloodmagic/structures/DungeonStructure.java @@ -1,5 +1,6 @@ package WayofTime.bloodmagic.structures; +import WayofTime.bloodmagic.util.BMLog; import net.minecraft.server.MinecraftServer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; @@ -27,7 +28,7 @@ public class DungeonStructure { Template template = templatemanager.getTemplate(minecraftserver, resource); if (template == null) { - System.out.println("Invalid template for location: " + resource); + BMLog.DEBUG.warn("Invalid template for location: " + resource); return false; } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java b/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java index 2c77e867..638930a3 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java @@ -1,6 +1,7 @@ package WayofTime.bloodmagic.tile; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.util.BMLog; import WayofTime.bloodmagic.util.Constants; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks; @@ -118,13 +119,13 @@ public class TileInversionPillar extends TileTicking { currentInfectionRadius++; consecutiveFailedChecks = 0; currentInversion -= inversionToIncreaseRadius; - System.out.println("Increasing radius!"); + BMLog.DEBUG.info("Increasing radius!"); } else if (consecutiveFailedAirChecks > 25 * currentInfectionRadius) //Change this to require a number of "creations" with the orbs in the air. { currentInfectionRadius++; consecutiveFailedChecks = 0; currentInversion -= inversionToIncreaseRadius; - System.out.println("Increasing radius due to being in the air!"); + BMLog.DEBUG.info("Increasing radius due to being in the air!"); } if (currentInfectionRadius >= 8 && currentInversion >= inversionToAddPillar) { @@ -304,7 +305,7 @@ public class TileInversionPillar extends TileTicking { public void handleEvents(float time, Iterable pastEvents) { for (Event event : pastEvents) { - System.out.println("Event: " + event.event() + " " + event.offset() + " " + getPos() + " " + time); + BMLog.DEBUG.info("Event: " + event.event() + " " + event.offset() + " " + getPos() + " " + time); } }