diff --git a/build.gradle b/build.gradle
index 9947af35..f1ffc620 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,13 +15,18 @@ plugins {
id 'maven-publish'
}
-def build_number = 'CUSTOM'
-if (System.getenv('BUILD_NUMBER') != null)
- build_number = System.getenv('BUILD_NUMBER')
+sourceSets {
+ compat {
+ compileClasspath += sourceSets.main.runtimeClasspath + sourceSets.main.output
+ }
-def username = "${mod_name}"
-if (project.hasProperty('dev_username'))
- username = "${dev_username}"
+ main {
+ runtimeClasspath += sourceSets.compat.runtimeClasspath
+ }
+}
+
+def build_number = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : 'CUSTOM'
+def username = project.hasProperty('dev_username') ? "${dev_username}" : "${mod_name}"
group = package_group
archivesBaseName = mod_name
@@ -33,16 +38,17 @@ repositories {
}
dependencies {
- deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}"
- deobfCompile "mcp.mobius.waila:Hwyla:${waila_version}"
- deobfCompile "info.amerifrance.guideapi:Guide-API:${guideapi_version}"
+ deobfCompile "mcp.mobius.waila:Hwyla:${hwyla_version}:api"
+ runtime "mcp.mobius.waila:Hwyla:${hwyla_version}"
+ deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}:api"
+ runtime "mezz.jei:jei_${mc_version}:${jei_version}"
}
minecraft {
version = "${mc_version}-${forge_version}"
runDir = "run"
- replace "@VERSION@", project.version
+ replace '${VERSION}', project.version
replaceIn "BloodMagic.java"
clientRunArgs += "--username=${username}"
@@ -68,16 +74,11 @@ processResources {
}
}
-allprojects {
- tasks.withType(Javadoc) {
- options.addStringOption('Xdoclint:none', '-quiet')
- }
-}
-
jar {
classifier = ''
from sourceSets.main.output
from sourceSets.api.output
+ from sourceSets.compat.output
manifest.mainAttributes(
"Built-By": System.getProperty('user.name'),
"Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})",
@@ -97,18 +98,14 @@ task apiJar(type: Jar) {
from sourceSets.api.allJava
}
-task javadocJar(type: Jar, dependsOn: javadoc) {
- from javadoc.destinationDir
- classifier = 'javadoc'
-}
-
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
from sourceSets.api.allJava
+ from sourceSets.compat.allJava
}
-tasks.build.dependsOn javadoc, javadocJar, apiJar, sourcesJar
+tasks.build.dependsOn apiJar, sourcesJar
tasks.withType(JavaCompile) { task ->
task.options.encoding = 'UTF-8'
@@ -119,7 +116,6 @@ publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
- artifact javadocJar
artifact sourcesJar
artifact apiJar
}
@@ -175,7 +171,6 @@ curseforge {
relations curseRelations
- addArtifact javadocJar
addArtifact sourcesJar
addArtifact apiJar
}
diff --git a/gradle.properties b/gradle.properties
index b97442cd..d9286a61 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,12 +1,13 @@
mod_name=BloodMagic
package_group=com.wayoftime.bloodmagic
-mod_version=2.3.1
+mod_version=3.0.0
+
mc_version=1.12.2
-forge_version=14.23.2.2611
-curse_id=224791
+forge_version=14.23.4.2759
+mappings_version=stable_39
-mappings_version=snapshot_20180201
+jei_version=4.11.0.206
+hwyla_version=1.8.26-B41_1.12.2
+guideapi_version=1.12-2.1.4-57
-jei_version=4.8.5.147
-waila_version=1.8.23-B38_1.12
-guideapi_version=1.12-2.1.4-57
\ No newline at end of file
+curse_id=224791
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a5ffca25..9d7c377b 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
diff --git a/src/api/java/WayofTime/bloodmagic/api/BloodMagicPlugin.java b/src/api/java/com/wayoftime/bloodmagic/api/BloodMagicPlugin.java
similarity index 93%
rename from src/api/java/WayofTime/bloodmagic/api/BloodMagicPlugin.java
rename to src/api/java/com/wayoftime/bloodmagic/api/BloodMagicPlugin.java
index 3cbeb4b9..c9687fe1 100644
--- a/src/api/java/WayofTime/bloodmagic/api/BloodMagicPlugin.java
+++ b/src/api/java/com/wayoftime/bloodmagic/api/BloodMagicPlugin.java
@@ -1,4 +1,4 @@
-package WayofTime.bloodmagic.api;
+package com.wayoftime.bloodmagic.api;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -16,9 +16,9 @@ public @interface BloodMagicPlugin {
/**
* This annotation will inject the active {@link IBloodMagicAPI} into a {@code static} field of the same
* type. Fields with invalid types will be ignored and an error will be logged.
- *
+ *
* These fields are populated during {@link net.minecraftforge.fml.common.event.FMLPreInitializationEvent}.
- *
+ *
* {@code public static @BloodMagicPlugin.Inject IBloodMagicAPI API_INSTANCE = null;}
*/
@Retention(RetentionPolicy.RUNTIME)
diff --git a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicAPI.java b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicAPI.java
similarity index 96%
rename from src/api/java/WayofTime/bloodmagic/api/IBloodMagicAPI.java
rename to src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicAPI.java
index 11ce4bce..bf003608 100644
--- a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicAPI.java
+++ b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicAPI.java
@@ -1,4 +1,4 @@
-package WayofTime.bloodmagic.api;
+package com.wayoftime.bloodmagic.api;
import net.minecraft.block.state.IBlockState;
@@ -6,9 +6,9 @@ import javax.annotation.Nonnull;
/**
* The main interface between a plugin and Blood Magic's internals.
- *
+ *
* This API is intended for compatibility between other mods and Blood Magic. More advanced integration is out of the scope of this API and are considered "addons".
- *
+ *
* To get an instance of this without actually creating an {@link IBloodMagicPlugin}, use {@link BloodMagicPlugin.Inject}.
*/
public interface IBloodMagicAPI {
diff --git a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicBlacklist.java b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicBlacklist.java
similarity index 97%
rename from src/api/java/WayofTime/bloodmagic/api/IBloodMagicBlacklist.java
rename to src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicBlacklist.java
index e99c1609..329f98d7 100644
--- a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicBlacklist.java
+++ b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicBlacklist.java
@@ -1,4 +1,4 @@
-package WayofTime.bloodmagic.api;
+package com.wayoftime.bloodmagic.api;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
diff --git a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicPlugin.java b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicPlugin.java
similarity index 96%
rename from src/api/java/WayofTime/bloodmagic/api/IBloodMagicPlugin.java
rename to src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicPlugin.java
index c18d3c1d..9cd2546f 100644
--- a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicPlugin.java
+++ b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicPlugin.java
@@ -1,4 +1,4 @@
-package WayofTime.bloodmagic.api;
+package com.wayoftime.bloodmagic.api;
/**
* The main class to implement to create a Blood Magic plugin. Everything communicated between a mod and Blood Magic is through this class.
diff --git a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicRecipeRegistrar.java b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicRecipeRegistrar.java
similarity index 95%
rename from src/api/java/WayofTime/bloodmagic/api/IBloodMagicRecipeRegistrar.java
rename to src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicRecipeRegistrar.java
index 93e13c45..544c16a3 100644
--- a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicRecipeRegistrar.java
+++ b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicRecipeRegistrar.java
@@ -1,4 +1,4 @@
-package WayofTime.bloodmagic.api;
+package com.wayoftime.bloodmagic.api;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
@@ -11,8 +11,7 @@ import javax.annotation.Nullable;
/**
* Allows recipe addition and removal.
*/
-public interface IBloodMagicRecipeRegistrar
-{
+public interface IBloodMagicRecipeRegistrar {
/**
* Adds a new recipe to the Blood Altar.
@@ -55,7 +54,7 @@ public interface IBloodMagicRecipeRegistrar
/**
* Adds a new recipe to the Soul/Tartaric Forge.
- *
+ *
* @param output An output {@link ItemStack}.
* @param minimumSouls The minimum number of souls that must be contained in the Soul Gem.
* @param soulDrain The number of souls to drain from the Soul Gem.
@@ -66,8 +65,8 @@ public interface IBloodMagicRecipeRegistrar
/**
* Removes a Soul/Tartaric Forge recipe based on an input {@link ItemStack} array.
*
- * @param input The input items to remove the recipe of.
- * @return Whether or not a recipe was removed.
+ * @param input The input items to remove the recipe of.
+ * @return Whether or not a recipe was removed.
*/
boolean removeTartaricForge(@Nonnull ItemStack... input);
diff --git a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicValueManager.java b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicValueManager.java
similarity index 97%
rename from src/api/java/WayofTime/bloodmagic/api/IBloodMagicValueManager.java
rename to src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicValueManager.java
index f51db50c..1a5389ff 100644
--- a/src/api/java/WayofTime/bloodmagic/api/IBloodMagicValueManager.java
+++ b/src/api/java/com/wayoftime/bloodmagic/api/IBloodMagicValueManager.java
@@ -1,4 +1,4 @@
-package WayofTime.bloodmagic.api;
+package com.wayoftime.bloodmagic.api;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
diff --git a/src/api/java/WayofTime/bloodmagic/api/event/BloodMagicCraftedEvent.java b/src/api/java/com/wayoftime/bloodmagic/api/event/BloodMagicCraftedEvent.java
similarity index 92%
rename from src/api/java/WayofTime/bloodmagic/api/event/BloodMagicCraftedEvent.java
rename to src/api/java/com/wayoftime/bloodmagic/api/event/BloodMagicCraftedEvent.java
index 0b92284c..fe8125ac 100644
--- a/src/api/java/WayofTime/bloodmagic/api/event/BloodMagicCraftedEvent.java
+++ b/src/api/java/com/wayoftime/bloodmagic/api/event/BloodMagicCraftedEvent.java
@@ -1,4 +1,4 @@
-package WayofTime.bloodmagic.api.event;
+package com.wayoftime.bloodmagic.api.event;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Event;
@@ -34,19 +34,19 @@ public class BloodMagicCraftedEvent extends Event {
/**
* Fired whenever a craft is completed in a Blood Altar.
- *
+ *
* It is not cancelable, however you can modify the output stack.
*/
public static class Altar extends BloodMagicCraftedEvent {
public Altar(ItemStack output, ItemStack input) {
- super(output, new ItemStack[] { input }, true);
+ super(output, new ItemStack[]{input}, true);
}
}
/**
* Fired whenever a craft is completed in a Soul Forge.
- *
+ *
* It is not cancelable, however you can modify the output stack.
*/
public static class SoulForge extends BloodMagicCraftedEvent {
@@ -58,7 +58,7 @@ public class BloodMagicCraftedEvent extends Event {
/**
* Fired whenever a craft is completed in an Alchemy Table.
- *
+ *
* It is not cancelable, however you can modify the output stack.
*/
public static class AlchemyTable extends BloodMagicCraftedEvent {
diff --git a/src/api/java/WayofTime/bloodmagic/api/package-info.java b/src/api/java/com/wayoftime/bloodmagic/api/package-info.java
similarity index 75%
rename from src/api/java/WayofTime/bloodmagic/api/package-info.java
rename to src/api/java/com/wayoftime/bloodmagic/api/package-info.java
index 9d563054..462725c6 100644
--- a/src/api/java/WayofTime/bloodmagic/api/package-info.java
+++ b/src/api/java/com/wayoftime/bloodmagic/api/package-info.java
@@ -1,4 +1,4 @@
@API(owner = "bloodmagic", provides = "bloodmagic-api", apiVersion = "2.0.0")
-package WayofTime.bloodmagic.api;
+package com.wayoftime.bloodmagic.api;
import net.minecraftforge.fml.common.API;
\ No newline at end of file
diff --git a/src/compat/java/com/wayoftime/bloodmagic/compat/jei/BloodMagicJEIPlugin.java b/src/compat/java/com/wayoftime/bloodmagic/compat/jei/BloodMagicJEIPlugin.java
new file mode 100644
index 00000000..19f88ba3
--- /dev/null
+++ b/src/compat/java/com/wayoftime/bloodmagic/compat/jei/BloodMagicJEIPlugin.java
@@ -0,0 +1,35 @@
+package com.wayoftime.bloodmagic.compat.jei;
+
+import com.wayoftime.bloodmagic.api.impl.BloodMagicAPI;
+import com.wayoftime.bloodmagic.api.impl.recipe.RecipeBloodAltar;
+import com.wayoftime.bloodmagic.compat.jei.altar.RecipeCategoryAltar;
+import com.wayoftime.bloodmagic.compat.jei.altar.RecipeWrapperAltar;
+import com.wayoftime.bloodmagic.core.RegistrarBloodMagicBlocks;
+import mezz.jei.api.IJeiHelpers;
+import mezz.jei.api.IModPlugin;
+import mezz.jei.api.IModRegistry;
+import mezz.jei.api.JEIPlugin;
+import mezz.jei.api.recipe.IRecipeCategoryRegistration;
+import net.minecraft.item.ItemStack;
+
+@JEIPlugin
+public class BloodMagicJEIPlugin implements IModPlugin {
+
+ public static IJeiHelpers helper;
+
+ @Override
+ public void registerCategories(IRecipeCategoryRegistration registry) {
+ helper = registry.getJeiHelpers();
+
+ registry.addRecipeCategories(
+ new RecipeCategoryAltar()
+ );
+ }
+
+ @Override
+ public void register(IModRegistry registry) {
+ registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAltarRecipes(), RecipeCategoryAltar.CATEGORY_ID);
+ registry.handleRecipes(RecipeBloodAltar.class, RecipeWrapperAltar::new, RecipeCategoryAltar.CATEGORY_ID);
+ registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_ALTAR), RecipeCategoryAltar.CATEGORY_ID);
+ }
+}
diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeCategory.java b/src/compat/java/com/wayoftime/bloodmagic/compat/jei/altar/RecipeCategoryAltar.java
similarity index 61%
rename from src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeCategory.java
rename to src/compat/java/com/wayoftime/bloodmagic/compat/jei/altar/RecipeCategoryAltar.java
index 10f2f6a2..4bd8c397 100644
--- a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeCategory.java
+++ b/src/compat/java/com/wayoftime/bloodmagic/compat/jei/altar/RecipeCategoryAltar.java
@@ -1,37 +1,37 @@
-package WayofTime.bloodmagic.compat.jei.altar;
+package com.wayoftime.bloodmagic.compat.jei.altar;
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.util.Constants;
-import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
-import WayofTime.bloodmagic.util.helper.TextHelper;
+import com.wayoftime.bloodmagic.BloodMagic;
+import com.wayoftime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
-import net.minecraft.client.Minecraft;
+import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-public class AltarRecipeCategory implements IRecipeCategory {
+public class RecipeCategoryAltar implements IRecipeCategory {
+
+ public static final String CATEGORY_ID = "bloodmagic:blood_altar";
private static final int INPUT_SLOT = 0;
private static final int OUTPUT_SLOT = 1;
@Nonnull
- private final IDrawable background = BloodMagicJEIPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/altar.png"), 3, 4, 155, 65);
+ private final IDrawable background = BloodMagicJEIPlugin.helper.getGuiHelper().createDrawable(new ResourceLocation(BloodMagic.MODID, "textures/gui/jei/blood_altar.png"), 3, 4, 155, 65);
@Nonnull
@Override
public String getUid() {
- return Constants.Compat.JEI_CATEGORY_ALTAR;
+ return CATEGORY_ID;
}
@Nonnull
@Override
public String getTitle() {
- return TextHelper.localize("jei.bloodmagic.recipe.altar");
+ return I18n.format("jei.bloodmagic:blood_altar");
}
@Nonnull
@@ -40,11 +40,6 @@ public class AltarRecipeCategory implements IRecipeCategory {
return background;
}
- @Override
- public void drawExtras(Minecraft minecraft) {
-
- }
-
@Nullable
@Override
public IDrawable getIcon() {
@@ -52,7 +47,7 @@ public class AltarRecipeCategory implements IRecipeCategory {
}
@Override
- public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull AltarRecipeJEI recipeWrapper, @Nonnull IIngredients ingredients) {
+ public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RecipeWrapperAltar recipeWrapper, @Nonnull IIngredients ingredients) {
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0);
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30);
@@ -65,4 +60,4 @@ public class AltarRecipeCategory implements IRecipeCategory {
public String getModName() {
return BloodMagic.NAME;
}
-}
+}
\ No newline at end of file
diff --git a/src/compat/java/com/wayoftime/bloodmagic/compat/jei/altar/RecipeWrapperAltar.java b/src/compat/java/com/wayoftime/bloodmagic/compat/jei/altar/RecipeWrapperAltar.java
new file mode 100644
index 00000000..d36c4ad8
--- /dev/null
+++ b/src/compat/java/com/wayoftime/bloodmagic/compat/jei/altar/RecipeWrapperAltar.java
@@ -0,0 +1,49 @@
+package com.wayoftime.bloodmagic.compat.jei.altar;
+
+import com.google.common.collect.Lists;
+import com.wayoftime.bloodmagic.api.impl.recipe.RecipeBloodAltar;
+import mezz.jei.api.ingredients.IIngredients;
+import mezz.jei.api.recipe.IRecipeWrapper;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.NonNullList;
+
+import javax.annotation.Nonnull;
+import java.awt.Color;
+import java.util.List;
+
+public class RecipeWrapperAltar implements IRecipeWrapper {
+
+ private final RecipeBloodAltar recipe;
+
+ public RecipeWrapperAltar(RecipeBloodAltar recipe) {
+ this.recipe = recipe;
+ }
+
+ @Override
+ public void getIngredients(@Nonnull IIngredients ingredients) {
+ ingredients.setInputs(ItemStack.class, NonNullList.from(ItemStack.EMPTY, recipe.getInput().getMatchingStacks()));
+ ingredients.setOutput(ItemStack.class, recipe.getOutput());
+ }
+
+ @Nonnull
+ @Override
+ public List getTooltipStrings(int mouseX, int mouseY) {
+ List tooltip = Lists.newArrayList();
+ if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58) {
+ tooltip.add(I18n.format("jei.bloodmagic:consumption_rate", recipe.getConsumeRate()));
+ tooltip.add(I18n.format("jei.bloodmagic:drain_rate", recipe.getDrainRate()));
+ }
+ return tooltip;
+ }
+
+ @Override
+ public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
+ String line1 = I18n.format("jei.bloodmagic:required_tier", I18n.format("enchantment.level." + (recipe.getMinimumTier().ordinal() + 1)));
+ minecraft.fontRenderer.drawString(line1, 90 - minecraft.fontRenderer.getStringWidth(line1) / 2, 0, Color.GRAY.getRGB());
+
+ String line2 = I18n.format("jei.bloodmagic:required_lp", recipe.getSyphon());
+ minecraft.fontRenderer.drawString(line2, 90 - minecraft.fontRenderer.getStringWidth(line2) / 2, 10, Color.GRAY.getRGB());
+ }
+}
diff --git a/src/compat/java/com/wayoftime/bloodmagic/compat/waila/BloodMagicHwylaPlugin.java b/src/compat/java/com/wayoftime/bloodmagic/compat/waila/BloodMagicHwylaPlugin.java
new file mode 100644
index 00000000..7e7ddeda
--- /dev/null
+++ b/src/compat/java/com/wayoftime/bloodmagic/compat/waila/BloodMagicHwylaPlugin.java
@@ -0,0 +1,15 @@
+package com.wayoftime.bloodmagic.compat.waila;
+
+import com.wayoftime.bloodmagic.tile.TileBloodAltar;
+import mcp.mobius.waila.api.IWailaPlugin;
+import mcp.mobius.waila.api.IWailaRegistrar;
+import mcp.mobius.waila.api.WailaPlugin;
+
+@WailaPlugin
+public class BloodMagicHwylaPlugin implements IWailaPlugin {
+ @Override
+ public void register(IWailaRegistrar registrar) {
+ registrar.registerBodyProvider(DataProviderBloodAltar.INSTANCE, TileBloodAltar.class);
+ registrar.registerNBTProvider(DataProviderBloodAltar.INSTANCE, TileBloodAltar.class);
+ }
+}
diff --git a/src/compat/java/com/wayoftime/bloodmagic/compat/waila/DataProviderBloodAltar.java b/src/compat/java/com/wayoftime/bloodmagic/compat/waila/DataProviderBloodAltar.java
new file mode 100644
index 00000000..57c560e8
--- /dev/null
+++ b/src/compat/java/com/wayoftime/bloodmagic/compat/waila/DataProviderBloodAltar.java
@@ -0,0 +1,40 @@
+package com.wayoftime.bloodmagic.compat.waila;
+
+import com.wayoftime.bloodmagic.tile.TileBloodAltar;
+import mcp.mobius.waila.api.IWailaConfigHandler;
+import mcp.mobius.waila.api.IWailaDataAccessor;
+import mcp.mobius.waila.api.IWailaDataProvider;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.World;
+
+import javax.annotation.Nonnull;
+import java.util.List;
+
+public class DataProviderBloodAltar implements IWailaDataProvider {
+
+ static final IWailaDataProvider INSTANCE = new DataProviderBloodAltar();
+
+ @Nonnull
+ @Override
+ public List getWailaBody(ItemStack itemStack, List tooltip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ tooltip.add(I18n.format("tooltip.bloodmagic:tier", I18n.format("enchantment.level." + (accessor.getNBTData().getInteger("tier") + 1))));
+ if (accessor.getNBTData().hasKey("progress"))
+ tooltip.add(I18n.format("tooltip.bloodmagic:progress", String.valueOf(accessor.getNBTData().getFloat("progress") * 100)));
+ return tooltip;
+ }
+
+ @Nonnull
+ @Override
+ public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) {
+ TileBloodAltar altar = (TileBloodAltar) te;
+ tag.setInteger("tier", altar.getCurrentTier().ordinal());
+ if (altar.isCrafting())
+ tag.setFloat("progress", altar.getProgress());
+ return tag;
+ }
+}
diff --git a/src/main/java/WayofTime/bloodmagic/BloodMagic.java b/src/main/java/WayofTime/bloodmagic/BloodMagic.java
deleted file mode 100644
index c132d776..00000000
--- a/src/main/java/WayofTime/bloodmagic/BloodMagic.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package WayofTime.bloodmagic;
-
-import WayofTime.bloodmagic.api.BloodMagicPlugin;
-import WayofTime.bloodmagic.api.IBloodMagicPlugin;
-import WayofTime.bloodmagic.core.registry.OrbRegistry;
-import WayofTime.bloodmagic.ritual.RitualManager;
-import WayofTime.bloodmagic.client.gui.GuiHandler;
-import WayofTime.bloodmagic.command.CommandBloodMagic;
-import WayofTime.bloodmagic.core.RegistrarBloodMagic;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
-import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
-import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
-import WayofTime.bloodmagic.proxy.CommonProxy;
-import WayofTime.bloodmagic.registry.*;
-import WayofTime.bloodmagic.structures.ModDungeons;
-import WayofTime.bloodmagic.util.PluginUtil;
-import WayofTime.bloodmagic.util.handler.IMCHandler;
-import com.google.common.collect.Lists;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.ItemStack;
-import net.minecraft.launchwrapper.Launch;
-import net.minecraftforge.common.config.Configuration;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fml.common.Loader;
-import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.common.SidedProxy;
-import net.minecraftforge.fml.common.event.*;
-import net.minecraftforge.fml.common.network.NetworkRegistry;
-import org.apache.commons.lang3.tuple.Pair;
-
-import java.io.File;
-import java.util.List;
-
-@Mod(modid = BloodMagic.MODID, name = BloodMagic.NAME, version = BloodMagic.VERSION, dependencies = BloodMagic.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.GuiBloodMagicConfig$Factory")
-public class BloodMagic {
- public static final String MODID = "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 RitualManager RITUAL_MANAGER = new RitualManager(new Configuration(new File(Loader.instance().getConfigDir(), MODID + "/" + "rituals.cfg")));
- public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab") {
- @Override
- public ItemStack getTabIconItem() {
- return OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK);
- }
- };
- public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome") {
- @Override
- public ItemStack getTabIconItem() {
- return new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
- }
-
- @Override
- public boolean hasSearchBar() {
- return true;
- }
- }.setNoTitle().setBackgroundImageName("item_search.png");
-
- @SidedProxy(serverSide = "WayofTime.bloodmagic.proxy.CommonProxy", clientSide = "WayofTime.bloodmagic.proxy.ClientProxy")
- public static CommonProxy proxy;
- @Mod.Instance(BloodMagic.MODID)
- public static BloodMagic instance;
-
- static {
- FluidRegistry.enableUniversalBucket();
- }
-
- private File configDir;
-
- @Mod.EventHandler
- public void preInit(FMLPreInitializationEvent event) {
- configDir = new File(event.getModConfigurationDirectory(), "bloodmagic");
-
- PLUGINS.addAll(PluginUtil.gatherPlugins(event.getAsmData()));
- PluginUtil.injectAPIInstances(PluginUtil.gatherInjections(event.getAsmData()));
-
- ModTranquilityHandlers.init();
- ModDungeons.init();
- RITUAL_MANAGER.discover(event.getAsmData());
-
- proxy.preInit();
- }
-
- @Mod.EventHandler
- public void init(FMLInitializationEvent event) {
- BloodMagicPacketHandler.init();
-
- PluginUtil.handlePluginStep(PluginUtil.RegistrationStep.PLUGIN_REGISTER);
-
- ModRecipes.init();
- ModRituals.initHarvestHandlers();
- MeteorConfigHandler.init(new File(configDir, "meteors"));
- ModArmourTrackers.init();
- NetworkRegistry.INSTANCE.registerGuiHandler(BloodMagic.instance, new GuiHandler());
- ModCorruptionBlocks.init();
-
- proxy.init();
- }
-
- @Mod.EventHandler
- public void postInit(FMLPostInitializationEvent event) {
- ModRecipes.addCompressionHandlers();
-
- proxy.postInit();
- }
-
- @Mod.EventHandler
- public void modMapping(FMLModIdMappingEvent event) {
-
- }
-
- @Mod.EventHandler
- public void serverStarting(FMLServerStartingEvent event) {
- event.registerServerCommand(new CommandBloodMagic());
- }
-
- @Mod.EventHandler
- public void onIMCRecieved(FMLInterModComms.IMCEvent event) {
- IMCHandler.handleIMC(event);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/ConfigHandler.java b/src/main/java/WayofTime/bloodmagic/ConfigHandler.java
deleted file mode 100644
index 4bed50be..00000000
--- a/src/main/java/WayofTime/bloodmagic/ConfigHandler.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package WayofTime.bloodmagic;
-
-import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
-import net.minecraftforge.common.config.Config;
-import net.minecraftforge.common.config.ConfigManager;
-import net.minecraftforge.fml.client.event.ConfigChangedEvent;
-import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-
-@Config(modid = BloodMagic.MODID, name = BloodMagic.MODID + "/" + BloodMagic.MODID, category = "")
-@Mod.EventBusSubscriber(modid = BloodMagic.MODID)
-public class ConfigHandler
-{
-
- @Config.Comment({ "General settings" })
- public static ConfigGeneral general = new ConfigGeneral();
- @Config.Comment({ "Blacklist options for various features" })
- public static ConfigBlacklist blacklist = new ConfigBlacklist();
- @Config.Comment({ "Value modifiers for various features" })
- public static ConfigValues values = new ConfigValues();
- @Config.Comment({ "Settings that only pertain to the client" })
- public static ConfigClient client = new ConfigClient();
- @Config.Comment({ "Compatibility settings" })
- public static ConfigCompat compat = new ConfigCompat();
-
- @SubscribeEvent
- public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
- {
- if (event.getModID().equals(BloodMagic.MODID))
- {
- ConfigManager.sync(event.getModID(), Config.Type.INSTANCE); // Sync config values
- BloodMagic.RITUAL_MANAGER.syncConfig();
- MeteorConfigHandler.handleMeteors(false); // Reload meteors
- }
- }
-
- public static class ConfigGeneral
- {
- @Config.Comment({ "Enables extra information to be printed to the log.", "Warning: May drastically increase log size." })
- public boolean enableDebugLogging = false;
- @Config.Comment({ "Enables extra information to be printed to the log." })
- public boolean enableAPILogging = false;
- @Config.Comment({ "Enables extra information to be printed to the log.", "Warning: May drastically increase log size." })
- public boolean enableVerboseAPILogging = false;
- }
-
- public static class ConfigBlacklist
- {
- @Config.Comment({ "Stops listed blocks and entities from being teleposed.", "Use the registry name of the block or entity. Vanilla objects do not require the modid.", "If a block is specified, you can list the variants to only blacklist a given state." })
- public String[] teleposer = { "bedrock", "mob_spawner" };
- @Config.Comment({ "Stops listed blocks from being transposed.", "Use the registry name of the block. Vanilla blocks do not require the modid." })
- public String[] transposer = { "bedrock", "mob_spawner" };
- @Config.Comment({ "Stops the listed entities from being used in the Well of Suffering.", "Use the registry name of the entity. Vanilla entities do not require the modid." })
- public String[] wellOfSuffering = {};
- }
-
- public static class ConfigValues
- {
- @Config.Comment({ "Declares the amount of LP gained per HP sacrificed for the given entity.", "Setting the value to 0 will blacklist it.", "Use the registry name of the entity followed by a ';' and then the value you want.", "Vanilla entities do not require the modid." })
- public String[] sacrificialValues = { "villager;100", "slime;15", "enderman;10", "cow;100", "chicken;100", "horse;100", "sheep;100", "wolf;100", "ocelot;100", "pig;100", "rabbit;100" };
- @Config.Comment({ "Amount of LP the Coat of Arms should provide for each damage dealt." })
- @Config.RangeInt(min = 0, max = 100)
- public int coatOfArmsConversion = 20;
- @Config.Comment({ "Amount of LP the Sacrificial Dagger should provide for each damage dealt." })
- @Config.RangeInt(min = 0, max = 10000)
- public int sacrificialDaggerConversion = 100;
- @Config.Comment({ "Will rewrite any default meteor types with new versions.", "Disable this if you want any of your changes to stay, or do not want default meteor types regenerated." })
- public boolean shouldResyncMeteors = true;
- }
-
- public static class ConfigClient
- {
- @Config.Comment({ "Always render the beams between routing nodes.", "If disabled, the beams will only render while the Node Router is held." })
- public boolean alwaysRenderRoutingLines = false;
- @Config.Comment({ "Completely hide spectral blocks from view.", "If disabled, a transparent block will be displayed." })
- public boolean invisibleSpectralBlocks = true;
- @Config.Comment({ "When cycling through slots, the Sigil of Holding will skip over empty slots and move to the next occupied one.", "If disabled, it will behave identically to the default hotbar." })
- public boolean sigilHoldingSkipsEmptySlots = false;
- }
-
- public static class ConfigCompat
- {
- @Config.Comment({ "The display mode to use when looking at a Blood Altar.", "ALWAYS - Always display information.", "SIGIL_HELD - Only display information when a Divination or Seers sigil is held in either hand.", "SIGIL_CONTAINED - Only display information when a Divination or Seers sigil is somewhere in the inventory." })
- public AltarDisplayMode wailaAltarDisplayMode = AltarDisplayMode.SIGIL_HELD;
-
- public enum AltarDisplayMode
- {
- ALWAYS,
- SIGIL_HELD,
- SIGIL_CONTAINED, ;
- }
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffect.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffect.java
deleted file mode 100644
index 6bac1e53..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffect.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.iface.IAlchemyArray;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public abstract class AlchemyArrayEffect {
- public final String key;
-
- public AlchemyArrayEffect(String key) {
- this.key = key;
- }
-
- public abstract boolean update(TileEntity tile, int ticksActive);
-
- public abstract void writeToNBT(NBTTagCompound tag);
-
- public abstract void readFromNBT(NBTTagCompound tag);
-
- public abstract AlchemyArrayEffect getNewCopy();
-
- public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
-
- }
-
- public String getKey() {
- return key;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectArrowTurret.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectArrowTurret.java
deleted file mode 100644
index ccebac1f..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectArrowTurret.java
+++ /dev/null
@@ -1,243 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import java.util.List;
-
-import javax.vecmath.Vector2d;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.monster.EntityMob;
-import net.minecraft.entity.projectile.EntityTippedArrow;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemArrow;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.MathHelper;
-import net.minecraft.util.math.Vec3d;
-import net.minecraft.world.World;
-import net.minecraftforge.items.IItemHandler;
-import WayofTime.bloodmagic.util.Utils;
-
-public class AlchemyArrayEffectArrowTurret extends AlchemyArrayEffect
-{
- public EntityLiving target;
- public int arrowTimer;
- public static final int ARROW_WINDUP = 50;
- private int lastChestSlot = -1;
-
- private double pitch = 0;
- private double lastPitch = 0;
- private double yaw = 0;
- private double lastYaw = 0;
-
- public AlchemyArrayEffectArrowTurret(String key)
- {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive)
- {
- BlockPos pos = tile.getPos();
- World world = tile.getWorld();
-
- BlockPos chestPos = pos.down();
- TileEntity chestTile = world.getTileEntity(chestPos);
- if (chestTile == null)
- {
- return false;
- }
- IItemHandler itemHandler = Utils.getInventory(chestTile, EnumFacing.UP);
- if (itemHandler == null)
- {
- return false;
- }
-
- ItemStack arrowStack = new ItemStack(Items.AIR);
- if (lastChestSlot >= 0 && lastChestSlot < itemHandler.getSlots())
- {
- ItemStack testStack = itemHandler.extractItem(lastChestSlot, 1, true);
- if (testStack.isEmpty() || !(testStack.getItem() instanceof ItemArrow))
- {
- lastChestSlot = -1;
- } else
- {
- arrowStack = testStack;
- }
- }
-
- if (lastChestSlot < 0)
- {
- for (int i = 0; i < itemHandler.getSlots(); i++)
- {
- ItemStack testStack = itemHandler.extractItem(i, 1, true);
- if (!testStack.isEmpty() && testStack.getItem() instanceof ItemArrow)
- {
- arrowStack = testStack;
- lastChestSlot = i;
- break;
- }
- }
-
- }
-
- if (lastChestSlot < 0)
- {
- return false; //No arrows in the chest. Welp!
- }
-
- if (canFireOnMob(world, pos, target))
- {
- Vector2d pitchYaw = getPitchYaw(pos, target);
- lastPitch = pitch;
- lastYaw = yaw;
- pitch = pitchYaw.x;
- yaw = pitchYaw.y;
- arrowTimer++;
-
- if (arrowTimer >= ARROW_WINDUP)
- {
-// ItemStack arrowStack = new ItemStack(Items.ARROW);
- fireOnTarget(world, pos, arrowStack, target);
- if (!world.isRemote)
- {
- itemHandler.extractItem(lastChestSlot, 1, false);
- }
- arrowTimer = 0;
- }
- return false;
- } else
- {
- target = null;
- arrowTimer = -1;
- }
-
- List mobsInRange = world.getEntitiesWithinAABB(EntityMob.class, getBounds(pos));
-
- for (EntityMob entity : mobsInRange)
- {
- if (canFireOnMob(world, pos, entity))// && isMobInFilter(ent))
- {
- target = entity;
- arrowTimer = 0;
- return false;
- }
- }
- arrowTimer = -1;
- target = null;
-
- return false;
- }
-
- public double getPitch()
- {
- return pitch;
- }
-
- public double getLastPitch()
- {
- return lastPitch;
- }
-
- public double getYaw()
- {
- return yaw;
- }
-
- public double getLastYaw()
- {
- return lastYaw;
- }
-
- public void fireOnTarget(World world, BlockPos pos, ItemStack arrowStack, EntityLiving targetMob)
- {
- float vel = 3f;
- double damage = 2;
- if (!world.isRemote)
- {
- if (arrowStack.getItem() instanceof ItemArrow)
- {
-// ItemArrow arrow = (ItemArrow) arrowStack.getItem();
-// EntityArrow entityarrow = arrow.createArrow(world, arrowStack, targetMob);
- EntityTippedArrow entityarrow = new EntityTippedArrow(world);
- entityarrow.setPotionEffect(arrowStack);
- entityarrow.posX = pos.getX() + 0.5;
- entityarrow.posY = pos.getY() + 0.5;
- entityarrow.posZ = pos.getZ() + 0.5;
-
- double d0 = targetMob.posX - (pos.getX() + 0.5);
- double d1 = targetMob.posY + targetMob.height - (pos.getY() + 0.5);
- double d2 = targetMob.posZ - (pos.getZ() + 0.5);
- double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
- entityarrow.setDamage(damage);
- entityarrow.shoot(d0, d1 + d3 * 0.05, d2, vel, 0);
- world.spawnEntity(entityarrow);
- }
- }
- }
-
- public static Vector2d getPitchYaw(BlockPos pos, Entity entityIn)
- {
- if (entityIn == null)
- {
- return new Vector2d(0, 0);
- }
-
- double distanceX = entityIn.posX - (pos.getX() + 0.5);
- double distanceY = entityIn.posY + (double) entityIn.getEyeHeight() - (pos.getY() + 0.5);
- double distanceZ = entityIn.posZ - (pos.getZ() + 0.5);
- double radialDistance = Math.sqrt(distanceX * distanceX + distanceZ * distanceZ);
- double yaw = Math.atan2(-distanceX, distanceZ) * 180 / Math.PI;
- double pitch = -Math.atan2(distanceY, radialDistance) * 180 / Math.PI;
-
- return new Vector2d(pitch, yaw);
- }
-
- public boolean canEntityBeSeen(World world, BlockPos pos, Entity entityIn)
- {
- return world.rayTraceBlocks(new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5), new Vec3d(entityIn.posX, entityIn.posY + (double) entityIn.getEyeHeight(), entityIn.posZ), false, true, false) == null;
- }
-
- public boolean canFireOnMob(World world, BlockPos pos, Entity entityIn)
- {
- return entityIn != null && !entityIn.isDead && entityIn.getDistanceSqToCenter(pos) <= getRange() * getRange() && entityIn.getDistanceSqToCenter(pos) >= getMinRange() * getMinRange() && canEntityBeSeen(world, pos, entityIn);
- }
-
- public AxisAlignedBB getBounds(BlockPos pos)
- {
- return new AxisAlignedBB(pos).grow(getRange(), getRange(), getRange());
- }
-
- public float getRange()
- {
- return 32;
- }
-
- public float getMinRange()
- {
- return 3;
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy()
- {
- return new AlchemyArrayEffectArrowTurret(key);
- }
-
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java
deleted file mode 100644
index 9d8d63d5..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.fakePlayer.FakePlayerBM;
-import WayofTime.bloodmagic.tile.TileAlchemyArray;
-import com.mojang.authlib.GameProfile;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.ai.EntityAIBase;
-import net.minecraft.entity.ai.EntityAITasks;
-import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
-import net.minecraft.entity.monster.*;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.pathfinding.Path;
-import net.minecraft.pathfinding.PathFinder;
-import net.minecraft.pathfinding.WalkNodeProcessor;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.MathHelper;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.FakePlayer;
-
-import java.util.*;
-
-/**
- * Credits for the initial code go to Crazy Pants of EIO.
- */
-public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect {
- private FakePlayer target;
- private Set tracking = new HashSet<>();
-
- private int counter = 0;
- private int maxMobsAttracted = 10000;
-
- private int cooldown = 50;
-
- public AlchemyArrayEffectAttractor(String key) {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
- if (tile.getWorld().isRemote) {
- return false;
- }
-
- BlockPos pos = tile.getPos();
- counter++;
- if (counter < 10) {
- for (EntityLiving ent : tracking) {
- onEntityTick(pos, ent);
- }
-
- return false;
- }
-
- counter = 0;
-
- World world = tile.getWorld();
-
- Set trackingThisTick = new HashSet<>();
- List entsInBounds = world.getEntitiesWithinAABB(EntityLiving.class, getBounds(pos));
-
- for (EntityLiving ent : entsInBounds) {
- if (!ent.isDead)// && isMobInFilter(ent))
- {
- double x = (pos.getX() + 0.5D - ent.posX);
- double y = (pos.getY() + 1D - ent.posY);
- double z = (pos.getZ() + 0.5D - ent.posZ);
- double distance = Math.sqrt(x * x + y * y + z * z);
-
- if (distance < 2 && tracking.contains(ent)) {
- setEntityCooldown(pos, ent, cooldown);
- removeAssignedAITask(pos, ent);
- continue;
- }
-
- if (!canEntityBeTracked(pos, ent)) {
-// System.out.println("Cooldown: " + getEntityCooldown(pos, ent));
- decrementEntityCooldown(pos, ent);
- continue;
- }
-
- if (tracking.contains(ent)) {
- trackingThisTick.add(ent);
- onEntityTick(pos, ent);
- } else if (tracking.size() < maxMobsAttracted && trackMob(pos, ent)) {
- trackingThisTick.add(ent);
- onTracked(ent);
- }
- }
- }
-
- for (EntityLiving e : tracking) {
- if (!trackingThisTick.contains(e)) {
- onUntracked(e);
- }
- }
- tracking.clear();
- tracking = trackingThisTick;
-
- return false;
- }
-
- public boolean canEntityBeTracked(BlockPos pos, EntityLiving entity) {
- return getEntityCooldown(pos, entity) <= 0;
- }
-
- private String getPosKey(BlockPos pos) {
- return "BMAttractor:" + pos;
- }
-
- public int getEntityCooldown(BlockPos pos, EntityLiving entity) {
- return entity.getEntityData().getInteger(getPosKey(pos));
- }
-
- public void setEntityCooldown(BlockPos pos, EntityLiving entity, int cooldown) {
- entity.getEntityData().setInteger(getPosKey(pos), cooldown);
- }
-
- public void decrementEntityCooldown(BlockPos pos, EntityLiving entity) {
- int cooldown = getEntityCooldown(pos, entity);
- if (cooldown > 0) {
- setEntityCooldown(pos, entity, cooldown - 1);
- }
- }
-
- public AxisAlignedBB getBounds(BlockPos pos) {
- return new AxisAlignedBB(pos).expand(getRange(), getRange(), getRange());
- }
-
- public float getRange() {
- return 10;
- }
-
- private void onUntracked(EntityLiving e) {
- if (e instanceof EntityEnderman) {
- e.getEntityData().setBoolean("BM:tracked", false);
- }
- }
-
- private void onTracked(EntityLiving e) {
- if (e instanceof EntityEnderman) {
- e.getEntityData().setBoolean("BM:tracked", true);
- }
- }
-
- private void onEntityTick(BlockPos pos, EntityLiving ent) {
- if (ent instanceof EntitySlime) {
- ent.faceEntity(getTarget(ent.getEntityWorld(), pos), 10.0F, 20.0F);
- } else if (ent instanceof EntitySilverfish) {
- if (counter < 10) {
- return;
- }
- EntitySilverfish sf = (EntitySilverfish) ent;
- Path pathentity = getPathEntityToEntity(ent, getTarget(ent.getEntityWorld(), pos), getRange());
- sf.getNavigator().setPath(pathentity, sf.getAIMoveSpeed());
- } else if (ent instanceof EntityBlaze) {
- double x = (pos.getX() + 0.5D - ent.posX);
- double y = (pos.getY() + 1D - ent.posY);
- double z = (pos.getZ() + 0.5D - ent.posZ);
- double distance = Math.sqrt(x * x + y * y + z * z);
- if (distance > 1.25) {
- double speed = 0.01;
- ent.motionX += x / distance * speed;
- if (y > 0) {
- ent.motionY += (0.3 - ent.motionY) * 0.3;
- }
- ent.motionZ += z / distance * speed;
- }
- } else if (ent instanceof EntityPigZombie || ent instanceof EntitySpider) {
- forceMove(pos, ent);
-// ent.setAttackTarget(target);
- } else if (ent instanceof EntityEnderman) {
- ent.setAttackTarget(getTarget(ent.getEntityWorld(), pos));
- }
- }
-
- private void forceMove(BlockPos pos, EntityLiving ent) {
- double x = (pos.getX() + 0.5D - ent.posX);
- double y = (pos.getY() + 1D - ent.posY);
- double z = (pos.getZ() + 0.5D - ent.posZ);
- double distance = Math.sqrt(x * x + y * y + z * z);
- if (distance > 2) {
- EntityMob mod = (EntityMob) ent;
- mod.faceEntity(getTarget(ent.getEntityWorld(), pos), 180, 0);
- mod.getMoveHelper().strafe(0, 0.3f);
- if (mod.posY < pos.getY()) {
- mod.setJumping(true);
- } else {
- mod.setJumping(false);
- }
- }
- }
-
- public Path getPathEntityToEntity(Entity entity, Entity targetEntity, float range) {
- int targX = MathHelper.floor(targetEntity.posX);
- int targY = MathHelper.floor(targetEntity.posY + 1.0D);
- int targZ = MathHelper.floor(targetEntity.posZ);
-
- PathFinder pf = new PathFinder(new WalkNodeProcessor());
- return pf.findPath(targetEntity.getEntityWorld(), (EntityLiving) entity, new BlockPos(targX, targY, targZ), range);
- }
-
- private boolean trackMob(BlockPos pos, EntityLiving ent) {
- //TODO: Figure out if this crud is needed
- if (useSetTarget(ent)) {
- ent.setAttackTarget(getTarget(ent.getEntityWorld(), pos));
- return true;
- } else if (useSpecialCase(ent)) {
- return applySpecialCase(pos, ent);
- } else {
- return attractUsingAITask(pos, ent);
- }
- }
-
- private boolean useSetTarget(EntityLiving ent) {
- return ent instanceof EntityPigZombie || ent instanceof EntitySpider || ent instanceof EntitySilverfish;
- }
-
- public void removeAssignedAITask(BlockPos pos, EntityLiving ent) {
- Set entries = ent.tasks.taskEntries;
- EntityAIBase remove = null;
- for (EntityAITaskEntry entry : entries) {
- if (entry.action instanceof AttractTask) {
- AttractTask at = (AttractTask) entry.action;
- if (at.coord.equals(pos)) {
- remove = entry.action;
- } else {
- continue;
- }
- }
- }
- if (remove != null) {
- ent.tasks.removeTask(remove);
- }
- }
-
- private boolean attractUsingAITask(BlockPos pos, EntityLiving ent) {
- tracking.add(ent);
- Set entries = ent.tasks.taskEntries;
- // boolean hasTask = false;
- EntityAIBase remove = null;
- // boolean isTracked;
- for (EntityAITaskEntry entry : entries) {
- if (entry.action instanceof AttractTask) {
- AttractTask at = (AttractTask) entry.action;
- if (at.coord.equals(pos) || !at.shouldExecute()) {
- remove = entry.action;
- } else {
- return false;
- }
- }
- }
- if (remove != null) {
- ent.tasks.removeTask(remove);
- }
-
- cancelCurrentTasks(ent);
- ent.tasks.addTask(0, new AttractTask(ent, getTarget(ent.getEntityWorld(), pos), pos));
-
- return true;
- }
-
- private void cancelCurrentTasks(EntityLiving ent) {
- Iterator iterator = ent.tasks.taskEntries.iterator();
-
- List currentTasks = new ArrayList<>();
- while (iterator.hasNext()) {
- EntityAITaskEntry entityaitaskentry = iterator.next();
- if (entityaitaskentry != null) {
- if (entityaitaskentry.action instanceof AttractTask) {
- continue;
- }
-
- currentTasks.add(entityaitaskentry);
- }
- }
- // Only available way to stop current execution is to remove all current
- // tasks, then re-add them
- for (EntityAITaskEntry task : currentTasks) {
- ent.tasks.removeTask(task.action);
- ent.tasks.addTask(task.priority, task.action);
- }
- }
-
- private boolean applySpecialCase(BlockPos pos, EntityLiving ent) {
- if (ent instanceof EntitySlime) {
- ent.faceEntity(getTarget(ent.getEntityWorld(), pos), 10.0F, 20.0F);
-// ent.setAttackTarget(getTarget(ent.worldObj, pos));
- return true;
- } else if (ent instanceof EntitySilverfish) {
- EntitySilverfish es = (EntitySilverfish) ent;
- Path pathentity = getPathEntityToEntity(ent, getTarget(ent.getEntityWorld(), pos), getRange());
- es.getNavigator().setPath(pathentity, es.getAIMoveSpeed());
- return true;
- } else if (ent instanceof EntityBlaze) {
- return true;
- }
- return false;
- }
-
- private boolean useSpecialCase(EntityLiving ent) {
- return ent instanceof EntitySlime || ent instanceof EntitySilverfish || ent instanceof EntityBlaze;
- }
-
- public FakePlayer getTarget(World world, BlockPos pos) {
- if (target == null) {
-// System.out.println("...Hi? " + pos);
- target = new Target(world, pos);
- }
-
- return target;
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectAttractor(key);
- }
-
- private static class AttractTask extends EntityAIBase {
- private EntityLiving mob;
- private BlockPos coord;
- private FakePlayer target;
- private int updatesSincePathing;
-
- private boolean started = false;
-
- private AttractTask(EntityLiving mob, FakePlayer target, BlockPos coord) {
- this.mob = mob;
- this.coord = coord;
- this.target = target;
- }
-
- @Override
- public boolean shouldExecute() {
- boolean res = false;
- //TODO:
- TileEntity te = mob.getEntityWorld().getTileEntity(coord);
- if (te instanceof TileAlchemyArray) {
- res = true;
- }
-
- return res;
- }
-
- @Override
- public void resetTask() {
- started = false;
- updatesSincePathing = 0;
- }
-
- @Override
- public boolean isInterruptible() {
- return true;
- }
-
- @Override
- public void updateTask() {
- if (!started || updatesSincePathing > 20) {
- started = true;
- int speed = 1;
- // mob.getNavigator().setAvoidsWater(false);
- boolean res = mob.getNavigator().tryMoveToEntityLiving(target, speed);
- if (!res) {
- mob.getNavigator().tryMoveToXYZ(target.posX, target.posY + 1, target.posZ, speed);
- }
- updatesSincePathing = 0;
- } else {
- updatesSincePathing++;
- }
- }
-
- }
-
- private class Target extends FakePlayerBM {
- public Target(World world, BlockPos pos) {
- super(world, pos, new GameProfile(null, BloodMagic.MODID + "ArrayAttractor" + ":" + pos));
- posY += 1;
- }
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBinding.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBinding.java
deleted file mode 100644
index d3e9849c..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBinding.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.client.render.alchemyArray.BindingAlchemyCircleRenderer;
-import net.minecraft.entity.effect.EntityLightningBolt;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting {
- public AlchemyArrayEffectBinding(String key, ItemStack outputStack) {
- super(key, outputStack, 200);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
- if (ticksActive >= 50 && ticksActive <= 250) {
- // TODO: Find a way to spawn lightning from only the server side -
- // does not render when just spawned on server, not client.
- this.spawnLightningOnCircle(tile.getWorld(), tile.getPos(), ticksActive);
- }
-
- if (tile.getWorld().isRemote) {
- return false;
- }
-
- if (ticksActive >= 300) {
- BlockPos pos = tile.getPos();
-
- ItemStack output = outputStack.copy();
- EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
-
- tile.getWorld().spawnEntity(outputEntity);
-
- return true;
- }
-
- return false;
- }
-
- public void spawnLightningOnCircle(World world, BlockPos pos, int ticksActive) {
- if (ticksActive % 50 == 0) {
- int circle = ticksActive / 50 - 1;
- float distance = BindingAlchemyCircleRenderer.getDistanceOfCircle(circle, ticksActive);
- float angle = BindingAlchemyCircleRenderer.getAngleOfCircle(circle, ticksActive);
-
- double dispX = distance * Math.sin(angle);
- double dispZ = -distance * Math.cos(angle);
-
- EntityLightningBolt lightning = new EntityLightningBolt(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ, true);
- world.spawnEntity(lightning);
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
- //EMPTY
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
- //EMPTY
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectBinding(key, outputStack);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBounce.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBounce.java
deleted file mode 100644
index cd35b720..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBounce.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.iface.IAlchemyArray;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class AlchemyArrayEffectBounce extends AlchemyArrayEffect {
- public AlchemyArrayEffectBounce(String key) {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
- return false;
- }
-
- @Override
- public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
- if (entity.isSneaking()) {
- entity.fallDistance = 0;
- } else if (entity.motionY < 0.0D) {
- entity.motionY = -entity.motionY;
-
- if (!(entity instanceof EntityLivingBase)) {
- entity.motionY *= 0.8D;
- }
-
- entity.fallDistance = 0;
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectBounce(key);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectCrafting.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectCrafting.java
deleted file mode 100644
index 9f658335..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectCrafting.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-
-public class AlchemyArrayEffectCrafting extends AlchemyArrayEffect {
- public final ItemStack outputStack;
- public int tickLimit;
-
- public AlchemyArrayEffectCrafting(ItemStack outputStack) {
- this(outputStack, 200);
- }
-
- public AlchemyArrayEffectCrafting(ItemStack outputStack, int tickLimit) {
- this(outputStack.toString() + tickLimit, outputStack, tickLimit);
- }
-
- public AlchemyArrayEffectCrafting(String key, ItemStack outputStack, int tickLimit) {
- super(key);
- this.outputStack = outputStack;
- this.tickLimit = tickLimit;
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
- // TODO: Add recipe rechecking to verify nothing screwy is going on.
- if (tile.getWorld().isRemote) {
- return false;
- }
-
- if (ticksActive >= tickLimit) {
- BlockPos pos = tile.getPos();
-
- ItemStack output = outputStack.copy();
-
- EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
-
- tile.getWorld().spawnEntity(outputEntity);
-
- return true;
- }
-
- return false;
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectCrafting(key, outputStack, tickLimit);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectCraftingNew.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectCraftingNew.java
deleted file mode 100644
index b96c9052..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectCraftingNew.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.api.impl.recipe.RecipeAlchemyArray;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-
-public class AlchemyArrayEffectCraftingNew extends AlchemyArrayEffect {
-
- private final RecipeAlchemyArray recipe;
-
- public AlchemyArrayEffectCraftingNew(RecipeAlchemyArray recipe) {
- this(recipe.getOutput().toString() + 200, recipe);
- }
-
- public AlchemyArrayEffectCraftingNew(String key, RecipeAlchemyArray recipeAlchemyArray) {
- super(key);
-
- this.recipe = recipeAlchemyArray;
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
- if (tile.getWorld().isRemote)
- return false;
-
- if (ticksActive >= 200) {
- BlockPos pos = tile.getPos();
-
- ItemStack output = recipe.getOutput().copy();
-
- EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
-
- tile.getWorld().spawnEntity(outputEntity);
-
- return true;
- }
-
- return false;
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectCraftingNew(key, recipe);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectFurnaceFuel.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectFurnaceFuel.java
deleted file mode 100644
index c21135ac..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectFurnaceFuel.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import java.util.List;
-
-import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockFurnace;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.FurnaceRecipes;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.tileentity.TileEntityFurnace;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class AlchemyArrayEffectFurnaceFuel extends AlchemyArrayEffect
-{
- static double radius = 10;
- static int burnTicksAdded = 401; //Set to +1 more than it needs to be due to a hacky method - basically done so that the array doesn't double dip your health if you only add one item.
-
- public AlchemyArrayEffectFurnaceFuel(String key)
- {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive)
- {
- BlockPos pos = tile.getPos();
- World world = tile.getWorld();
- EntityPlayer sacrifice = null;
-
- for (EnumFacing face : EnumFacing.VALUES)
- {
- BlockPos furnacePos = pos.offset(face);
- Block block = world.getBlockState(furnacePos).getBlock();
- if (block != Blocks.FURNACE) //This will only work vanilla furnaces. No others!
- {
- continue;
- }
-
- TileEntity bottomTile = world.getTileEntity(furnacePos);
- if (bottomTile instanceof TileEntityFurnace)
- {
- TileEntityFurnace furnaceTile = (TileEntityFurnace) bottomTile;
- if (canFurnaceSmelt(furnaceTile) && !furnaceTile.isBurning())
- {
- if (sacrifice == null || sacrifice.isDead)
- {
- AxisAlignedBB bb = new AxisAlignedBB(pos).grow(radius);
- List playerList = world.getEntitiesWithinAABB(EntityPlayer.class, bb);
- for (EntityPlayer player : playerList)
- {
- if (!player.isDead)
- {
- sacrifice = player;
- }
- }
- }
-
- if (sacrifice == null || sacrifice.isDead)
- {
- return false;
- }
-
- if (addFuelTime(furnaceTile, world, furnacePos, burnTicksAdded))
- {
- if (!sacrifice.capabilities.isCreativeMode)
- {
- sacrifice.hurtResistantTime = 0;
- sacrifice.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, 1.0F); //No.
- }
- }
- }
- }
- }
-
- return false;
- }
-
- public static boolean addFuelTime(TileEntityFurnace furnaceTile, World world, BlockPos furnacePos, int cookTime)
- {
- furnaceTile.setField(0, cookTime);
- BlockFurnace.setState(true, world, furnacePos);
- return true;
- }
-
- public static boolean canFurnaceSmelt(TileEntityFurnace furnaceTile)
- {
- ItemStack burnStack = furnaceTile.getStackInSlot(0);
- if (burnStack.isEmpty())
- {
- return false;
- } else
- {
- ItemStack resultStack = FurnaceRecipes.instance().getSmeltingResult(burnStack);
-
- if (resultStack.isEmpty())
- {
- return false;
- } else
- {
- ItemStack finishStack = furnaceTile.getStackInSlot(2);
-
- if (finishStack.isEmpty())
- {
- return true;
- } else if (!finishStack.isItemEqual(resultStack))
- {
- return false;
- } else if (finishStack.getCount() + resultStack.getCount() <= furnaceTile.getInventoryStackLimit() && finishStack.getCount() + resultStack.getCount() <= finishStack.getMaxStackSize()) // Forge fix: make furnace respect stack sizes in furnace recipes
- {
- return true;
- } else
- {
- return finishStack.getCount() + resultStack.getCount() <= resultStack.getMaxStackSize(); // Forge fix: make furnace respect stack sizes in furnace recipes
- }
- }
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy()
- {
- return new AlchemyArrayEffectFurnaceFuel(key);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectLaputa.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectLaputa.java
deleted file mode 100644
index ce64e7f3..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectLaputa.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import java.util.Random;
-
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.common.MinecraftForge;
-import WayofTime.bloodmagic.event.TeleposeEvent;
-import WayofTime.bloodmagic.tile.TileAlchemyArray;
-import WayofTime.bloodmagic.util.Constants;
-import WayofTime.bloodmagic.util.Utils;
-
-public class AlchemyArrayEffectLaputa extends AlchemyArrayEffect
-{
- public static final int TELEPOSE_DELAY = 4;
-
- private BlockPos currentPos = BlockPos.ORIGIN;
-
- private int radius = -1;
- private int teleportHeightOffset = 5;
-
- public AlchemyArrayEffectLaputa(String key)
- {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive)
- {
- if (ticksActive >= 100)
- {
- World world = tile.getWorld();
-
- if (radius == -1)
- {
- ((TileAlchemyArray) tile).setItemDrop(false);
- radius = getRandomRadius(world.rand);
- teleportHeightOffset = getRandomHeightOffset(world.rand);
- currentPos = new BlockPos(-radius, -radius, -radius);
- }
-
- BlockPos pos = tile.getPos();
- if (world.isRemote)
- {
- return false;
- }
-
- int j = -radius;
- int i = -radius;
- int k = -radius;
-
- if (currentPos != null)
- {
- j = currentPos.getY();
- i = currentPos.getX();
- k = currentPos.getZ();
- }
- int checks = 0;
- int maxChecks = 100;
-
- while (j <= radius)
- {
- while (i <= radius)
- {
- while (k <= radius)
- {
- if (i == 0 && j == 0 && k == 0)
- {
- k++;
- continue;
- }
-
- checks++;
- if (checks >= maxChecks)
- {
- this.currentPos = new BlockPos(i, j, k);
- return false;
- }
-
- if (checkIfSphere(radius, i, j, k))
- {
- BlockPos newPos = pos.add(i, j, k);
- BlockPos offsetPos = newPos.up(teleportHeightOffset);
- IBlockState state = world.getBlockState(newPos);
-
- TeleposeEvent event = new TeleposeEvent(world, newPos, world, offsetPos);
- if (state.getBlockHardness(world, newPos) > 0 && !MinecraftForge.EVENT_BUS.post(event) && Utils.swapLocations(event.initalWorld, event.initialBlockPos, event.finalWorld, event.finalBlockPos))
- {
- k++;
- this.currentPos = new BlockPos(i, j, k);
-
- return false;
- }
- }
- k++;
- }
- i++;
- k = -radius;
- }
- j++;
- i = -radius;
- this.currentPos = new BlockPos(i, j, k);
- return false;
- }
-
- return true;
- }
-
- return false;
- }
-
- public boolean checkIfSphere(float radius, float xOff, float yOff, float zOff)
- {
- float possOffset = 0.5f;
- return xOff * xOff + yOff * yOff + zOff * zOff <= ((radius + possOffset) * (radius + possOffset));
- }
-
- public int getRandomRadius(Random rand)
- {
- return rand.nextInt(5) + 4;
- }
-
- public int getRandomHeightOffset(Random rand)
- {
- return radius * 2 + 1 + rand.nextInt(5);
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag)
- {
- tag.setInteger("radius", radius);
- tag.setInteger("teleportHeightOffset", teleportHeightOffset);
- tag.setInteger(Constants.NBT.X_COORD, currentPos.getX());
- tag.setInteger(Constants.NBT.Y_COORD, currentPos.getY());
- tag.setInteger(Constants.NBT.Z_COORD, currentPos.getZ());
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag)
- {
- radius = tag.getInteger("radius");
- teleportHeightOffset = tag.getInteger("teleportHeightOffset");
- currentPos = new BlockPos(tag.getInteger(Constants.NBT.X_COORD), tag.getInteger(Constants.NBT.Y_COORD), tag.getInteger(Constants.NBT.Z_COORD));
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy()
- {
- return new AlchemyArrayEffectLaputa(key);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectMobSacrifice.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectMobSacrifice.java
deleted file mode 100644
index 77224e58..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectMobSacrifice.java
+++ /dev/null
@@ -1,233 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.monster.IMob;
-import net.minecraft.entity.passive.EntityAnimal;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.init.SoundEvents;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumParticleTypes;
-import net.minecraft.util.SoundCategory;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.Vec3d;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldServer;
-import net.minecraftforge.fml.common.registry.EntityEntry;
-import net.minecraftforge.fml.common.registry.EntityRegistry;
-import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
-import WayofTime.bloodmagic.api.impl.recipe.RecipeSacrificeCraft;
-import WayofTime.bloodmagic.ritual.AreaDescriptor;
-import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
-import WayofTime.bloodmagic.util.helper.PurificationHelper;
-
-public class AlchemyArrayEffectMobSacrifice extends AlchemyArrayEffect
-{
- public static final AreaDescriptor itemDescriptor = new AreaDescriptor.Rectangle(new BlockPos(-5, -5, -5), 11);
- public static final AreaDescriptor mobDescriptor = new AreaDescriptor.Rectangle(new BlockPos(-5, -5, -5), 11);
- public int craftTime = 0;
- public static final int REQUIRED_CRAFT_TIME = 200;
-
- public AlchemyArrayEffectMobSacrifice(String key)
- {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive)
- {
- World world = tile.getWorld();
- if (world.isRemote && ticksActive < 200 && ticksActive > 40)
- {
- BlockPos pos = tile.getPos();
- Random rand = world.rand;
-
- for (int i = 0; i < 2; i++)
- {
- double d0 = (double) pos.getX() + 0.5D + (rand.nextDouble() - 0.5D) * 2.5D;
- double d1 = (double) pos.getY() + 0.2D + (rand.nextDouble() - 0.5D) * 0.2D;
- double d2 = (double) pos.getZ() + 0.5D + (rand.nextDouble() - 0.5D) * 2.5D;
- world.spawnParticle(EnumParticleTypes.SPELL_MOB, d0, d1, d2, 1D, 0.0D, 0.0D);
- }
- }
-
- //We need to do the check on both sides to correctly do particles.
-
- if (ticksActive >= 200)
- {
- BlockPos pos = tile.getPos();
-
- List itemList = world.getEntitiesWithinAABB(EntityItem.class, itemDescriptor.getAABB(pos));
-
- List inputList = new ArrayList();
-
- for (EntityItem entityItem : itemList)
- {
- if (entityItem.isDead || entityItem.getItem().isEmpty())
- {
- continue;
- }
-
- inputList.add(entityItem.getItem().copy());
- }
-
- if (inputList.isEmpty())
- {
- return false;
- }
-
- if (inputList.size() == 1) //TODO: Test if it is a something that can be filled with Soul Breath
- {
-
- }
-
- RecipeSacrificeCraft recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getSacrificeCraft(inputList);
- if (recipe != null)
- {
- double healthRequired = recipe.getHealthRequired();
- double healthAvailable = 0;
-
- List livingEntities = world.getEntitiesWithinAABB(EntityLivingBase.class, mobDescriptor.getAABB(pos));
- for (EntityLivingBase living : livingEntities)
- {
- double health = getEffectiveHealth(living);
- if (health > 0)
- {
- healthAvailable += health;
- }
- }
-
- if (healthAvailable < healthRequired)
- {
- craftTime = 0;
- return false;
- }
-
- craftTime++;
-
- if (craftTime >= REQUIRED_CRAFT_TIME)
- {
- if (!world.isRemote)
- {
- for (EntityLivingBase living : livingEntities)
- {
- double health = getEffectiveHealth(living);
- if (healthAvailable > 0 && health > 0)
- {
- healthAvailable -= health;
- living.getEntityWorld().playSound(null, living.posX, living.posY, living.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (living.getEntityWorld().rand.nextFloat() - living.getEntityWorld().rand.nextFloat()) * 0.8F);
- living.setHealth(-1);
- living.onDeath(DamageSourceBloodMagic.INSTANCE);
- }
-
- if (healthAvailable <= 0)
- {
- break;
- }
- }
-
- for (EntityItem itemEntity : itemList)
- {
- itemEntity.getItem().setCount(itemEntity.getItem().getCount() - 1);
- if (itemEntity.getItem().isEmpty()) //TODO: Check container
- {
- itemEntity.setDead();
- }
- }
-
- world.spawnEntity(new EntityItem(world, pos.getX() + 0.5, pos.getY() + 2.5, pos.getZ() + 0.5, recipe.getOutput()));
- craftTime = 0;
- }
- } else
- {
- if (world.isRemote)
- {
- Vec3d spawnPosition = new Vec3d(pos.getX() + 0.5, pos.getY() + 2.5, pos.getZ() + 0.5);
- for (EntityItem itemEntity : itemList)
- {
- ItemStack stack = itemEntity.getItem();
- double velocityFactor = 0.1;
-
- Vec3d itemPosition = new Vec3d(itemEntity.posX, itemEntity.posY + 0.5, itemEntity.posZ);
- Vec3d velVec1 = new Vec3d((world.rand.nextDouble() - 0.5) * velocityFactor, (world.rand.nextDouble() - 0.5) * velocityFactor, (world.rand.nextDouble() - 0.5) * velocityFactor);
-// Vec3d velVec2 = new Vec3d((world.rand.nextDouble() - 0.5) * velocityFactor, (world.rand.nextDouble()) * velocityFactor, (world.rand.nextDouble() - 0.5) * velocityFactor);
-
-// vec3d1 = vec3d1.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ);
-// if (this.world instanceof WorldServer) //Forge: Fix MC-2518 spawnParticle is nooped on server, need to use server specific variant
-// ((WorldServer)this.world).spawnParticle(EnumParticleTypes.ITEM_CRACK, vec3d1.x, vec3d1.y, vec3d1.z, 0, vec3d.x, vec3d.y + 0.05D, vec3d.z, 0.0D, Item.getIdFromItem(stack.getItem()), stack.getMetadata());
-// else //Fix the fact that spawning ItemCrack uses TWO arguments.
- world.spawnParticle(EnumParticleTypes.ITEM_CRACK, itemPosition.x + (spawnPosition.x - itemPosition.x) * craftTime / REQUIRED_CRAFT_TIME, itemPosition.y + (spawnPosition.y - itemPosition.y) * craftTime / REQUIRED_CRAFT_TIME, itemPosition.z + (spawnPosition.z - itemPosition.z) * craftTime / REQUIRED_CRAFT_TIME, velVec1.x, velVec1.y, velVec1.z, Item.getIdFromItem(stack.getItem()), stack.getMetadata());
-// world.spawnParticle(EnumParticleTypes.ITEM_CRACK, spawnPosition.x, spawnPosition.y, spawnPosition.z, velVec2.x, velVec2.y, velVec2.z, Item.getIdFromItem(stack.getItem()), stack.getMetadata());
- }
-
- for (EntityLivingBase living : livingEntities)
- {
- double health = getEffectiveHealth(living);
- if (health <= 0)
- {
- continue;
- }
- double d0 = (double) living.posX + (world.rand.nextDouble() - 0.5D) * 0.5D;
- double d1 = (double) living.posY + 0.5D + (world.rand.nextDouble() - 0.5D) * 1D;
- double d2 = (double) living.posZ + (world.rand.nextDouble() - 0.5D) * 0.5D;
- world.spawnParticle(EnumParticleTypes.SPELL_MOB, d0, d1, d2, 1D, 0.0D, 0.0D);
- }
- }
- }
- }
- }
-
- return false;
- }
-
- //Future-proofing in case I want to make different mobs give different effective health
- public double getEffectiveHealth(EntityLivingBase living)
- {
- if (living == null)
- return 0;
-
- if (!living.isNonBoss())
- return 0;
-
- if (living instanceof EntityPlayer)
- return 0;
-
- if (living.isChild() && !(living instanceof IMob))
- return 0;
-
- if (living.isDead || living.getHealth() < 0.5F)
- return 0;
-
- EntityEntry entityEntry = EntityRegistry.getEntry(living.getClass());
- if (entityEntry == null)
- return 0;
-
- return living.getHealth();
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy()
- {
- return new AlchemyArrayEffectMobSacrifice(key);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectMovement.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectMovement.java
deleted file mode 100644
index 3bf96427..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectMovement.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.iface.IAlchemyArray;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class AlchemyArrayEffectMovement extends AlchemyArrayEffect {
- public AlchemyArrayEffectMovement(String key) {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
- return false;
- }
-
- @Override
- public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
- double motionY = 0.5;
- double speed = 3;
- EnumFacing direction = array.getRotation();
-
- entity.motionY = motionY;
- entity.fallDistance = 0;
-
- switch (direction) {
- case NORTH:
- entity.motionX = 0;
- entity.motionY = motionY;
- entity.motionZ = -speed;
- break;
-
- case SOUTH:
- entity.motionX = 0;
- entity.motionY = motionY;
- entity.motionZ = speed;
- break;
-
- case WEST:
- entity.motionX = -speed;
- entity.motionY = motionY;
- entity.motionZ = 0;
- break;
-
- case EAST:
- entity.motionX = speed;
- entity.motionY = motionY;
- entity.motionZ = 0;
- break;
- default:
- break;
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectMovement(key);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSigil.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSigil.java
deleted file mode 100644
index beb4ba46..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSigil.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.iface.ISigil;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-
-public class AlchemyArrayEffectSigil extends AlchemyArrayEffect {
- private final ISigil sigil;
-
- public AlchemyArrayEffectSigil(String key, ISigil sigil) {
- super(key);
- this.sigil = sigil;
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
- //TODO: Need particles.
- if (sigil.hasArrayEffect()) {
- sigil.performArrayEffect(tile.getWorld(), tile.getPos());
- }
-
- return false;
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectSigil(key, sigil);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java
deleted file mode 100644
index d297eb60..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.tile.TileAlchemyArray;
-import com.google.common.base.Predicate;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.SharedMonsterAttributes;
-import net.minecraft.entity.ai.EntityAIBase;
-import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
-import net.minecraft.entity.ai.EntityAITasks;
-import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
-import net.minecraft.entity.monster.EntityMob;
-import net.minecraft.entity.monster.EntitySkeleton;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.FakePlayer;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Credits for the initial code go to Crazy Pants of EIO.
- */
-public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect {
- public static Predicate checkSkeleton = input -> !(input instanceof EntitySkeleton);
- private EntitySkeleton turret;
-
- public AlchemyArrayEffectSkeletonTurret(String key) {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
-// if (tile.getWorld().isRemote)
-// {
-// return false;
-// }
-
- BlockPos pos = tile.getPos();
-
- if (turret != null && !turret.isDead) {
- double x = (pos.getX() + 0.5D - turret.posX);
- double y = (pos.getY() + 1D - turret.posY);
- double z = (pos.getZ() + 0.5D - turret.posZ);
- double distance = Math.sqrt(x * x + y * y + z * z);
-
- if (distance < 2) {
-// turret.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 100, 100));
- return false;
- }
- }
-
- World world = tile.getWorld();
-
- List skeletonsInRange = world.getEntitiesWithinAABB(EntitySkeleton.class, getBounds(pos));
-
- for (EntitySkeleton entity : skeletonsInRange) {
- if (!entity.isDead)// && isMobInFilter(ent))
- {
- modifyAITargetTasks(entity);
- turret = entity;
- break;
- }
- }
-
- return false;
- }
-
- public AxisAlignedBB getBounds(BlockPos pos) {
- return new AxisAlignedBB(pos).expand(getRange(), getRange(), getRange());
- }
-
- public float getRange() {
- return 0;
- }
-
-// private void onUntracked(EntityLiving e)
-// {
-// e.getEntityData().setBoolean("BM:tracked", false);
-// }
-//
-// private void onTracked(EntityLiving e)
-// {
-// e.getEntityData().setBoolean("BM:tracked", true);
-// }
-
- private boolean modifyAITargetTasks(EntitySkeleton entity) {
- cancelCurrentTargetTasks(entity);
-
-// entity.setCombatTask();
- entity.targetTasks.addTask(1, new EntityAINearestAttackableTarget(entity, EntityMob.class, 10, true, false, checkSkeleton));
- entity.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0);
- entity.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1);
- return true;
- }
-
- private void cancelCurrentTargetTasks(EntityLiving entity) {
- Iterator iterator = entity.targetTasks.taskEntries.iterator();
-
- List currentTasks = new ArrayList<>();
- while (iterator.hasNext()) {
- EntityAITaskEntry entityaitaskentry = iterator.next();
- if (entityaitaskentry != null)// && entityaitaskentry.action instanceof EntityAITarget)
- {
- currentTasks.add(entityaitaskentry);
- }
- }
-
- for (EntityAITaskEntry task : currentTasks) {
- entity.targetTasks.removeTask(task.action);
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectSkeletonTurret(key);
- }
-
- private static class AttractTask extends EntityAIBase {
- private EntityLiving mob;
- private BlockPos coord;
- private FakePlayer target;
- private int updatesSincePathing;
-
- private boolean started = false;
-
- private AttractTask(EntityLiving mob, FakePlayer target, BlockPos coord) {
- this.mob = mob;
- this.coord = coord;
- this.target = target;
- }
-
- @Override
- public boolean shouldExecute() {
- boolean res = false;
- //TODO:
- TileEntity te = mob.getEntityWorld().getTileEntity(coord);
- if (te instanceof TileAlchemyArray) {
- res = true;
- }
-
- return res;
- }
-
- @Override
- public void resetTask() {
- started = false;
- updatesSincePathing = 0;
- }
-
- @Override
- public boolean isInterruptible() {
- return true;
- }
-
- @Override
- public void updateTask() {
- if (!started || updatesSincePathing > 20) {
- started = true;
- int speed = 1;
- // mob.getNavigator().setAvoidsWater(false);
- boolean res = mob.getNavigator().tryMoveToEntityLiving(target, speed);
- if (!res) {
- mob.getNavigator().tryMoveToXYZ(target.posX, target.posY + 1, target.posZ, speed);
- }
- updatesSincePathing = 0;
- } else {
- updatesSincePathing++;
- }
- }
-
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSpike.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSpike.java
deleted file mode 100644
index a0bbf514..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSpike.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.DamageSource;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import WayofTime.bloodmagic.iface.IAlchemyArray;
-
-public class AlchemyArrayEffectSpike extends AlchemyArrayEffect
-{
- public AlchemyArrayEffectSpike(String key)
- {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive)
- {
- return false;
- }
-
- @Override
- public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity)
- {
- if (entity instanceof EntityLivingBase)
- {
- entity.attackEntityFrom(DamageSource.CACTUS, 2);
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy()
- {
- return new AlchemyArrayEffectSpike(key);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectTeleport.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectTeleport.java
deleted file mode 100644
index 9437e86b..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectTeleport.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.init.SoundEvents;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.play.server.SPacketUpdateHealth;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.SoundCategory;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldServer;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
-import WayofTime.bloodmagic.iface.IAlchemyArray;
-
-public class AlchemyArrayEffectTeleport extends AlchemyArrayEffect
-{
- public static final int MAX_SEARCH = 20;
- public static final int TELEPORT_DELAY = 40;
-
- public AlchemyArrayEffectTeleport(String key)
- {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive)
- {
- return false;
- }
-
- @Override
- public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity)
- {
- EnumFacing direction = array.getRotation();
-
- teleportEntityInDirection(world, pos, entity, direction);
- }
-
- public void teleportEntityInDirection(World world, BlockPos currentPos, Entity entity, EnumFacing direction)
- {
- if (entity != null && entity.timeUntilPortal <= 0)
- {
- for (int i = 1; i <= MAX_SEARCH; i++)
- {
- BlockPos offsetPos = currentPos.offset(direction, i);
- Block testBlock = world.getBlockState(offsetPos).getBlock();
- if (testBlock == RegistrarBloodMagicBlocks.ALCHEMY_ARRAY)
- {
- int x = offsetPos.getX();
- int y = offsetPos.getY();
- int z = offsetPos.getZ();
-
- entity.getEntityWorld().playSound(x, y, z, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.AMBIENT, 1.0F, 1.0F, false);
- entity.timeUntilPortal = TELEPORT_DELAY;
- if (!world.isRemote)
- {
- if (entity instanceof EntityPlayer)
- {
- EntityPlayerMP player = (EntityPlayerMP) entity;
-
- player.setPositionAndUpdate(x + 0.5, y + 0.5, z + 0.5);
- player.getEntityWorld().updateEntityWithOptionalForce(player, false);
- player.connection.sendPacket(new SPacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel()));
-
- } else
- {
- WorldServer worldServer = (WorldServer) entity.getEntityWorld();
-
- entity.setPosition(x + 0.5, y + 0.5, z + 0.5);
- worldServer.resetUpdateEntityTick();
- }
- }
- return;
- }
- }
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag)
- {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy()
- {
- return new AlchemyArrayEffectTeleport(key);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectUpdraft.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectUpdraft.java
deleted file mode 100644
index f2cb4612..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectUpdraft.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.iface.IAlchemyArray;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class AlchemyArrayEffectUpdraft extends AlchemyArrayEffect {
- public AlchemyArrayEffectUpdraft(String key) {
- super(key);
- }
-
- @Override
- public boolean update(TileEntity tile, int ticksActive) {
- return false;
- }
-
- @Override
- public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
- double motionY = 1.5;
-
- entity.fallDistance = 0;
-
- entity.motionY = motionY;
- }
-
- @Override
- public void writeToNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public void readFromNBT(NBTTagCompound tag) {
-
- }
-
- @Override
- public AlchemyArrayEffect getNewCopy() {
- return new AlchemyArrayEffectUpdraft(key);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyCircleRenderer.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyCircleRenderer.java
deleted file mode 100644
index 89b0e042..00000000
--- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyCircleRenderer.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package WayofTime.bloodmagic.alchemyArray;
-
-import WayofTime.bloodmagic.tile.TileAlchemyArray;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.BufferBuilder;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.ResourceLocation;
-
-public class AlchemyCircleRenderer {
- public final ResourceLocation arrayResource;
- public float offsetFromFace = -0.9f;
-
- public AlchemyCircleRenderer() {
- this(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SightSigil.png"));
- }
-
- public AlchemyCircleRenderer(ResourceLocation arrayResource) {
- this.arrayResource = arrayResource;
- }
-
- public float getRotation(float craftTime) {
- float offset = 2;
- if (craftTime >= offset) {
- float modifier = (float) Math.pow(craftTime - offset, 1.5);
- return modifier * 1f;
- }
- return 0;
- }
-
- public float getSecondaryRotation(float craftTime) {
- float offset = 50;
- if (craftTime >= offset) {
- float modifier = (float) Math.pow(craftTime - offset, 1.7);
- return modifier * 0.5f;
- }
- return 0;
- }
-
- public float getSizeModifier(float craftTime) {
- if (craftTime >= 150 && craftTime <= 250) {
- return (200 - craftTime) / 50f;
- }
- return 1.0f;
- }
-
- public float getVerticalOffset(float craftTime) {
- if (craftTime >= 5) {
- if (craftTime <= 40) {
- return (float) ((-0.4) * Math.pow((craftTime - 5) / 35f, 3));
- } else {
- return -0.4f;
- }
- }
- return 0;
- }
-
- public void renderAt(TileEntity tile, double x, double y, double z, float craftTime) {
- if (!(tile instanceof TileAlchemyArray)) {
- return;
- }
-
- TileAlchemyArray tileArray = (TileAlchemyArray) tile;
-
- Tessellator tessellator = Tessellator.getInstance();
- BufferBuilder wr = tessellator.getBuffer();
-
- GlStateManager.pushMatrix();
- // float rot = (float)(this.worldObj.provider.getWorldTime() % (360 /
- // this.rotationspeed) * this.rotationspeed) + this.rotationspeed * f;
- float rot = getRotation(craftTime);
- float secondaryRot = getSecondaryRotation(craftTime);
-
- float size = 1.0F * getSizeModifier(craftTime);
-
- // Bind the texture to the circle
- Minecraft.getMinecraft().renderEngine.bindTexture(arrayResource);
-
- GlStateManager.disableCull();
- GlStateManager.enableBlend();
- GlStateManager.blendFunc(770, 1);
-
- GlStateManager.translate(x, y, z);
-
- // Specify which face this "circle" is located on
- EnumFacing sideHit = EnumFacing.UP;
- EnumFacing rotation = tileArray.getRotation();
-
- GlStateManager.translate(sideHit.getFrontOffsetX() * offsetFromFace, sideHit.getFrontOffsetY() * offsetFromFace, sideHit.getFrontOffsetZ() * offsetFromFace);
-
- switch (sideHit) {
- case DOWN:
- GlStateManager.translate(0, 0, 1);
- GlStateManager.rotate(-90.0f, 1, 0, 0);
- break;
- case EAST:
- GlStateManager.rotate(-90.0f, 0, 1, 0);
- GlStateManager.translate(0, 0, -1);
- break;
- case NORTH:
- break;
- case SOUTH:
- GlStateManager.rotate(180.0f, 0, 1, 0);
- GlStateManager.translate(-1, 0, -1);
- break;
- case UP:
- GlStateManager.translate(0, 1, 0);
- GlStateManager.rotate(90.0f, 1, 0, 0);
- break;
- case WEST:
- GlStateManager.translate(0, 0, 1);
- GlStateManager.rotate(90.0f, 0, 1, 0);
- break;
- }
-
- GlStateManager.pushMatrix();
- GlStateManager.translate(0.5f, 0.5f, getVerticalOffset(craftTime));
- GlStateManager.rotate(rotation.getHorizontalAngle() + 180, 0, 0, 1);
-
- GlStateManager.pushMatrix();
- GlStateManager.rotate(rot, 0, 0, 1);
- GlStateManager.rotate(secondaryRot, 1, 0, 0);
- GlStateManager.rotate(secondaryRot * 0.45812f, 0, 0, 1);
- double var31 = 0.0D;
- double var33 = 1.0D;
- double var35 = 0;
- double var37 = 1;
-
- GlStateManager.color(1f, 1f, 1f, 1f);
- wr.begin(7, DefaultVertexFormats.POSITION_TEX);
- // wr.setBrightness(200);
- wr.pos(size / 2f, size / 2f, 0.0D).tex(var33, var37).endVertex();
- wr.pos(size / 2f, -size / 2f, 0.0D).tex(var33, var35).endVertex();
- wr.pos(-size / 2f, -size / 2f, 0.0D).tex(var31, var35).endVertex();
- wr.pos(-size / 2f, size / 2f, 0.0D).tex(var31, var37).endVertex();
- tessellator.draw();
-
- GlStateManager.popMatrix();
-
- // GlStateManager.depthMask(true);
- GlStateManager.disableBlend();
- GlStateManager.enableCull();
- // GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
-
- GlStateManager.popMatrix();
- GlStateManager.popMatrix();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/altar/AltarComponent.java b/src/main/java/WayofTime/bloodmagic/altar/AltarComponent.java
deleted file mode 100644
index abc937c7..00000000
--- a/src/main/java/WayofTime/bloodmagic/altar/AltarComponent.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package WayofTime.bloodmagic.altar;
-
-import net.minecraft.util.math.BlockPos;
-
-/**
- * Used for building the altar structure.
- */
-public class AltarComponent {
- private final BlockPos offset;
- private final ComponentType component;
- private boolean upgradeSlot;
-
- /**
- * Sets a component location for the altar.
- *
- * @param offset - Where the block should be in relation to the Altar
- * @param component - The type of Component the location should contain
- */
- public AltarComponent(BlockPos offset, ComponentType component) {
- this.offset = offset;
- this.component = component;
- }
-
- /**
- * Use for setting a location at which there must be a block, but the type
- * of block does not matter.
- *
- * @param offset - Where the block should be in relation to the Altar
- */
- public AltarComponent(BlockPos offset) {
- this(offset, ComponentType.NOTAIR);
- }
-
- /**
- * Sets the location to an upgrade slot.
- *
- * @return the current instance for further use.
- */
- public AltarComponent setUpgradeSlot() {
- this.upgradeSlot = true;
- return this;
- }
-
- public BlockPos getOffset() {
- return offset;
- }
-
- public boolean isUpgradeSlot() {
- return upgradeSlot;
- }
-
- public ComponentType getComponent() {
- return component;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/altar/AltarUpgrade.java b/src/main/java/WayofTime/bloodmagic/altar/AltarUpgrade.java
deleted file mode 100644
index fce1de92..00000000
--- a/src/main/java/WayofTime/bloodmagic/altar/AltarUpgrade.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package WayofTime.bloodmagic.altar;
-
-import WayofTime.bloodmagic.block.enums.BloodRuneType;
-import com.google.common.collect.Maps;
-
-import java.util.EnumMap;
-
-public class AltarUpgrade {
-
- private final EnumMap upgradeLevels;
-
- public AltarUpgrade() {
- this.upgradeLevels = Maps.newEnumMap(BloodRuneType.class);
- }
-
- public AltarUpgrade upgrade(BloodRuneType rune) {
- upgradeLevels.compute(rune, (r, l) -> l == null ? 1 : l + 1);
- return this;
- }
-
- public int getLevel(BloodRuneType rune) {
- return upgradeLevels.getOrDefault(rune, 0);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/altar/AltarUtil.java b/src/main/java/WayofTime/bloodmagic/altar/AltarUtil.java
deleted file mode 100644
index acde6d6d..00000000
--- a/src/main/java/WayofTime/bloodmagic/altar/AltarUtil.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package WayofTime.bloodmagic.altar;
-
-import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
-import WayofTime.bloodmagic.block.BlockBloodRune;
-import WayofTime.bloodmagic.tile.TileAltar;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import org.apache.commons.lang3.tuple.Pair;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import java.util.List;
-
-public class AltarUtil {
-
- @Nonnull
- public static AltarTier getTier(World world, BlockPos pos) {
- TileEntity tile = world.getTileEntity(pos);
- if (!(tile instanceof TileAltar))
- return AltarTier.ONE;
-
- AltarTier lastCheck = AltarTier.ONE;
- for (AltarTier tier : AltarTier.values()) {
- for (AltarComponent component : tier.getAltarComponents()) {
- BlockPos componentPos = pos.add(component.getOffset());
- IBlockState worldState = world.getBlockState(componentPos);
-
- if (worldState.getBlock() instanceof IAltarComponent)
- if (((IAltarComponent) worldState.getBlock()).getType(world, worldState, componentPos) == component.getComponent())
- continue;
-
- if (component.getComponent() == ComponentType.NOTAIR && worldState.getMaterial() != Material.AIR && !worldState.getMaterial().isLiquid())
- continue;
-
- List validStates = BloodMagicAPI.INSTANCE.getComponentStates(component.getComponent());
- if (!validStates.contains(worldState))
- return lastCheck;
- }
-
- lastCheck = tier;
- }
-
- return lastCheck;
- }
-
- @Nonnull
- public static AltarUpgrade getUpgrades(World world, BlockPos pos, AltarTier currentTier) {
- AltarUpgrade upgrades = new AltarUpgrade();
-
- for (AltarComponent component : currentTier.getAltarComponents()) {
- if (!component.isUpgradeSlot() || component.getComponent() != ComponentType.BLOODRUNE)
- continue;
-
- BlockPos componentPos = pos.add(component.getOffset());
- IBlockState state = world.getBlockState(componentPos);
- if (state.getBlock() instanceof BlockBloodRune)
- upgrades.upgrade(((BlockBloodRune) state.getBlock()).getBloodRune(world, componentPos, state));
- }
-
- return upgrades;
- }
-
- @Nullable
- public static Pair getFirstMissingComponent(World world, BlockPos pos, int altarTier) {
- if (altarTier >= AltarTier.MAXTIERS)
- return null;
-
- for (AltarTier tier : AltarTier.values()) {
- for (AltarComponent component : tier.getAltarComponents()) {
- BlockPos componentPos = pos.add(component.getOffset());
- IBlockState worldState = world.getBlockState(componentPos);
- if (component.getComponent() == ComponentType.NOTAIR && worldState.getMaterial() != Material.AIR && !worldState.getMaterial().isLiquid())
- continue;
-
- List validStates = BloodMagicAPI.INSTANCE.getComponentStates(component.getComponent());
- if (!validStates.contains(worldState))
- return Pair.of(componentPos, component.getComponent());
- }
- }
-
- return null;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/altar/BloodAltar.java b/src/main/java/WayofTime/bloodmagic/altar/BloodAltar.java
deleted file mode 100644
index 8df2775c..00000000
--- a/src/main/java/WayofTime/bloodmagic/altar/BloodAltar.java
+++ /dev/null
@@ -1,711 +0,0 @@
-package WayofTime.bloodmagic.altar;
-
-import WayofTime.bloodmagic.api.event.BloodMagicCraftedEvent;
-import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
-import WayofTime.bloodmagic.api.impl.recipe.RecipeBloodAltar;
-import WayofTime.bloodmagic.block.enums.BloodRuneType;
-import WayofTime.bloodmagic.core.data.Binding;
-import WayofTime.bloodmagic.core.data.SoulTicket;
-import WayofTime.bloodmagic.iface.IBindable;
-import WayofTime.bloodmagic.util.Constants;
-import WayofTime.bloodmagic.orb.BloodOrb;
-import WayofTime.bloodmagic.orb.IBloodOrb;
-import WayofTime.bloodmagic.util.helper.NetworkHelper;
-import WayofTime.bloodmagic.block.BlockLifeEssence;
-import WayofTime.bloodmagic.tile.TileAltar;
-import com.google.common.base.Enums;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumParticleTypes;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldServer;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTank;
-import net.minecraftforge.fluids.capability.FluidTankPropertiesWrapper;
-import net.minecraftforge.fluids.capability.IFluidHandler;
-import net.minecraftforge.fluids.capability.IFluidTankProperties;
-import net.minecraftforge.items.ItemHandlerHelper;
-
-public class BloodAltar implements IFluidHandler
-{
-
- public boolean isActive;
- protected FluidStack fluidOutput = new FluidStack(BlockLifeEssence.getLifeEssence(), 0);
- protected FluidStack fluidInput = new FluidStack(BlockLifeEssence.getLifeEssence(), 0);
- private TileAltar tileAltar;
- private int internalCounter = 0;
- private AltarTier altarTier = AltarTier.ONE;
- private AltarUpgrade upgrade;
- private int capacity = Fluid.BUCKET_VOLUME * 10;
- private FluidStack fluid = new FluidStack(BlockLifeEssence.getLifeEssence(), 0);
- private int liquidRequired; // mB
- private boolean canBeFilled;
- private int consumptionRate;
- private int drainRate;
- private float consumptionMultiplier;
- private float efficiencyMultiplier;
- private float sacrificeEfficiencyMultiplier;
- private float selfSacrificeEfficiencyMultiplier;
- private float capacityMultiplier = 1;
- private float orbCapacityMultiplier;
- private float dislocationMultiplier;
- private int accelerationUpgrades;
- private boolean isUpgraded;
- private boolean isResultBlock;
- private int bufferCapacity = Fluid.BUCKET_VOLUME;
- private int progress;
- private int lockdownDuration;
- private int demonBloodDuration;
- private int totalCharge = 0; //TODO save
- private int chargingRate = 0;
- private int chargingFrequency = 0;
- private int maxCharge = 0;
- private int cooldownAfterCrafting = 60;
- private RecipeBloodAltar recipe;
- private AltarTier currentTierDisplayed = AltarTier.ONE;
-
- public BloodAltar(TileAltar tileAltar)
- {
- this.tileAltar = tileAltar;
- }
-
- public void readFromNBT(NBTTagCompound tagCompound)
- {
- if (!tagCompound.hasKey(Constants.NBT.EMPTY))
- {
- FluidStack fluid = FluidStack.loadFluidStackFromNBT(tagCompound);
-
- if (fluid != null)
- setMainFluid(fluid);
-
- FluidStack fluidOut = new FluidStack(BlockLifeEssence.getLifeEssence(), tagCompound.getInteger(Constants.NBT.OUTPUT_AMOUNT));
- setOutputFluid(fluidOut);
-
- FluidStack fluidIn = new FluidStack(BlockLifeEssence.getLifeEssence(), tagCompound.getInteger(Constants.NBT.INPUT_AMOUNT));
- setInputFluid(fluidIn);
- }
-
- internalCounter = tagCompound.getInteger("internalCounter");
- altarTier = Enums.getIfPresent(AltarTier.class, tagCompound.getString(Constants.NBT.ALTAR_TIER)).or(AltarTier.ONE);
- isActive = tagCompound.getBoolean(Constants.NBT.ALTAR_ACTIVE);
- liquidRequired = tagCompound.getInteger(Constants.NBT.ALTAR_LIQUID_REQ);
- canBeFilled = tagCompound.getBoolean(Constants.NBT.ALTAR_FILLABLE);
- isUpgraded = tagCompound.getBoolean(Constants.NBT.ALTAR_UPGRADED);
- consumptionRate = tagCompound.getInteger(Constants.NBT.ALTAR_CONSUMPTION_RATE);
- drainRate = tagCompound.getInteger(Constants.NBT.ALTAR_DRAIN_RATE);
- consumptionMultiplier = tagCompound.getFloat(Constants.NBT.ALTAR_CONSUMPTION_MULTIPLIER);
- efficiencyMultiplier = tagCompound.getFloat(Constants.NBT.ALTAR_EFFICIENCY_MULTIPLIER);
- selfSacrificeEfficiencyMultiplier = tagCompound.getFloat(Constants.NBT.ALTAR_SELF_SACRIFICE_MULTIPLIER);
- sacrificeEfficiencyMultiplier = tagCompound.getFloat(Constants.NBT.ALTAR_SACRIFICE_MULTIPLIER);
- capacityMultiplier = tagCompound.getFloat(Constants.NBT.ALTAR_CAPACITY_MULTIPLIER);
- orbCapacityMultiplier = tagCompound.getFloat(Constants.NBT.ALTAR_ORB_CAPACITY_MULTIPLIER);
- dislocationMultiplier = tagCompound.getFloat(Constants.NBT.ALTAR_DISLOCATION_MULTIPLIER);
- capacity = tagCompound.getInteger(Constants.NBT.ALTAR_CAPACITY);
- bufferCapacity = tagCompound.getInteger(Constants.NBT.ALTAR_BUFFER_CAPACITY);
- progress = tagCompound.getInteger(Constants.NBT.ALTAR_PROGRESS);
- isResultBlock = tagCompound.getBoolean(Constants.NBT.ALTAR_IS_RESULT_BLOCK);
- lockdownDuration = tagCompound.getInteger(Constants.NBT.ALTAR_LOCKDOWN_DURATION);
- accelerationUpgrades = tagCompound.getInteger(Constants.NBT.ALTAR_ACCELERATION_UPGRADES);
- demonBloodDuration = tagCompound.getInteger(Constants.NBT.ALTAR_DEMON_BLOOD_DURATION);
- cooldownAfterCrafting = tagCompound.getInteger(Constants.NBT.ALTAR_COOLDOWN_AFTER_CRAFTING);
- chargingRate = tagCompound.getInteger(Constants.NBT.ALTAR_CHARGE_RATE);
- chargingFrequency = tagCompound.getInteger(Constants.NBT.ALTAR_CHARGE_FREQUENCY);
- totalCharge = tagCompound.getInteger(Constants.NBT.ALTAR_TOTAL_CHARGE);
- maxCharge = tagCompound.getInteger(Constants.NBT.ALTAR_MAX_CHARGE);
- currentTierDisplayed = Enums.getIfPresent(AltarTier.class, tagCompound.getString(Constants.NBT.ALTAR_CURRENT_TIER_DISPLAYED)).or(AltarTier.ONE);
- }
-
- public void writeToNBT(NBTTagCompound tagCompound)
- {
-
- if (fluid != null)
- fluid.writeToNBT(tagCompound);
- else
- tagCompound.setString(Constants.NBT.EMPTY, "");
-
- if (fluidOutput != null)
- tagCompound.setInteger(Constants.NBT.OUTPUT_AMOUNT, fluidOutput.amount);
-
- if (fluidInput != null)
- tagCompound.setInteger(Constants.NBT.INPUT_AMOUNT, fluidInput.amount);
-
- tagCompound.setInteger("internalCounter", internalCounter);
- tagCompound.setString(Constants.NBT.ALTAR_TIER, altarTier.name());
- tagCompound.setBoolean(Constants.NBT.ALTAR_ACTIVE, isActive);
- tagCompound.setInteger(Constants.NBT.ALTAR_LIQUID_REQ, liquidRequired);
- tagCompound.setBoolean(Constants.NBT.ALTAR_FILLABLE, canBeFilled);
- tagCompound.setBoolean(Constants.NBT.ALTAR_UPGRADED, isUpgraded);
- tagCompound.setInteger(Constants.NBT.ALTAR_CONSUMPTION_RATE, consumptionRate);
- tagCompound.setInteger(Constants.NBT.ALTAR_DRAIN_RATE, drainRate);
- tagCompound.setFloat(Constants.NBT.ALTAR_CONSUMPTION_MULTIPLIER, consumptionMultiplier);
- tagCompound.setFloat(Constants.NBT.ALTAR_EFFICIENCY_MULTIPLIER, efficiencyMultiplier);
- tagCompound.setFloat(Constants.NBT.ALTAR_SACRIFICE_MULTIPLIER, sacrificeEfficiencyMultiplier);
- tagCompound.setFloat(Constants.NBT.ALTAR_SELF_SACRIFICE_MULTIPLIER, selfSacrificeEfficiencyMultiplier);
- tagCompound.setBoolean(Constants.NBT.ALTAR_IS_RESULT_BLOCK, isResultBlock);
- tagCompound.setFloat(Constants.NBT.ALTAR_CAPACITY_MULTIPLIER, capacityMultiplier);
- tagCompound.setFloat(Constants.NBT.ALTAR_ORB_CAPACITY_MULTIPLIER, orbCapacityMultiplier);
- tagCompound.setFloat(Constants.NBT.ALTAR_DISLOCATION_MULTIPLIER, dislocationMultiplier);
- tagCompound.setInteger(Constants.NBT.ALTAR_CAPACITY, capacity);
- tagCompound.setInteger(Constants.NBT.ALTAR_PROGRESS, progress);
- tagCompound.setInteger(Constants.NBT.ALTAR_BUFFER_CAPACITY, bufferCapacity);
- tagCompound.setInteger(Constants.NBT.ALTAR_LOCKDOWN_DURATION, lockdownDuration);
- tagCompound.setInteger(Constants.NBT.ALTAR_ACCELERATION_UPGRADES, accelerationUpgrades);
- tagCompound.setInteger(Constants.NBT.ALTAR_DEMON_BLOOD_DURATION, demonBloodDuration);
- tagCompound.setInteger(Constants.NBT.ALTAR_COOLDOWN_AFTER_CRAFTING, cooldownAfterCrafting);
- tagCompound.setInteger(Constants.NBT.ALTAR_CHARGE_RATE, chargingRate);
- tagCompound.setInteger(Constants.NBT.ALTAR_CHARGE_FREQUENCY, chargingFrequency);
- tagCompound.setInteger(Constants.NBT.ALTAR_TOTAL_CHARGE, totalCharge);
- tagCompound.setInteger(Constants.NBT.ALTAR_MAX_CHARGE, maxCharge);
- tagCompound.setString(Constants.NBT.ALTAR_CURRENT_TIER_DISPLAYED, currentTierDisplayed.name());
- }
-
- public void startCycle()
- {
- if (tileAltar.getWorld() != null)
- tileAltar.getWorld().notifyBlockUpdate(tileAltar.getPos(), tileAltar.getWorld().getBlockState(tileAltar.getPos()), tileAltar.getWorld().getBlockState(tileAltar.getPos()), 3);
-
- checkTier();
-
- if ((fluid == null || fluid.amount <= 0) && totalCharge <= 0)
- return;
-
- if (!isActive)
- progress = 0;
-
- ItemStack input = tileAltar.getStackInSlot(0);
-
- if (!input.isEmpty())
- {
- // Do recipes
- RecipeBloodAltar recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getBloodAltar(input);
- if (recipe != null)
- {
- if (recipe.getMinimumTier().ordinal() <= altarTier.ordinal())
- {
- this.isActive = true;
- this.recipe = recipe;
- this.liquidRequired = recipe.getSyphon();
- this.consumptionRate = recipe.getConsumeRate();
- this.drainRate = recipe.getDrainRate();
- this.canBeFilled = false;
- return;
- }
- } else if (input.getItem() instanceof IBloodOrb)
- {
- this.isActive = true;
- this.canBeFilled = true;
- return;
- }
- }
-
- isActive = false;
- }
-
- public void update()
- {
- World world = tileAltar.getWorld();
- BlockPos pos = tileAltar.getPos();
-
- if (world.isRemote)
- return;
-
- // Used instead of the world time for checks that do not happen every tick
- internalCounter++;
-
- if (lockdownDuration > 0)
- lockdownDuration--;
-
- if (internalCounter % 20 == 0)
- {
- for (EnumFacing facing : EnumFacing.VALUES)
- {
- BlockPos newPos = pos.offset(facing);
- IBlockState block = world.getBlockState(newPos);
- block.getBlock().onNeighborChange(world, newPos, pos);
- }
- }
- if (internalCounter % (Math.max(20 - this.accelerationUpgrades, 1)) == 0)
- {
- int syphonMax = (int) (20 * this.dislocationMultiplier);
- int fluidInputted;
- int fluidOutputted;
- fluidInputted = Math.min(syphonMax, -this.fluid.amount + capacity);
- fluidInputted = Math.min(this.fluidInput.amount, fluidInputted);
- this.fluid.amount += fluidInputted;
- this.fluidInput.amount -= fluidInputted;
- fluidOutputted = Math.min(syphonMax, this.bufferCapacity - this.fluidOutput.amount);
- fluidOutputted = Math.min(this.fluid.amount, fluidOutputted);
- this.fluidOutput.amount += fluidOutputted;
- this.fluid.amount -= fluidOutputted;
- tileAltar.getWorld().notifyBlockUpdate(tileAltar.getPos(), tileAltar.getWorld().getBlockState(tileAltar.getPos()), tileAltar.getWorld().getBlockState(tileAltar.getPos()), 3);
- }
-
- if (internalCounter % this.getChargingFrequency() == 0 && !this.isActive)
- {
- int chargeInputted = Math.min(chargingRate, this.fluid.amount);
- chargeInputted = Math.min(chargeInputted, maxCharge - totalCharge);
- totalCharge += chargeInputted;
- this.fluid.amount -= chargeInputted;
- tileAltar.getWorld().notifyBlockUpdate(tileAltar.getPos(), tileAltar.getWorld().getBlockState(tileAltar.getPos()), tileAltar.getWorld().getBlockState(tileAltar.getPos()), 3);
- }
-
- if (internalCounter % 100 == 0 && (this.isActive || this.cooldownAfterCrafting <= 0))
- startCycle();
-
- updateAltar();
- }
-
- private void updateAltar()
- {
- if (!isActive)
- {
- if (cooldownAfterCrafting > 0)
- cooldownAfterCrafting--;
- return;
- }
-
- if (!canBeFilled && recipe == null)
- {
- startCycle();
- return;
- }
-
- ItemStack input = tileAltar.getStackInSlot(0);
-
- if (input.isEmpty())
- return;
-
- World world = tileAltar.getWorld();
- BlockPos pos = tileAltar.getPos();
-
- if (world.isRemote)
- return;
-
- if (!canBeFilled)
- {
- boolean hasOperated = false;
- int stackSize = input.getCount();
-
- if (totalCharge > 0)
- {
- int chargeDrained = Math.min(liquidRequired * stackSize - progress, totalCharge);
-
- totalCharge -= chargeDrained;
- progress += chargeDrained;
-
- hasOperated = true;
- }
- if (fluid != null && fluid.amount >= 1)
- {
- int liquidDrained = Math.min((int) (altarTier.ordinal() >= 2 ? consumptionRate * (1 + consumptionMultiplier) : consumptionRate), fluid.amount);
-
- if (liquidDrained > (liquidRequired * stackSize - progress))
- liquidDrained = liquidRequired * stackSize - progress;
-
- fluid.amount = fluid.amount - liquidDrained;
- progress += liquidDrained;
-
- hasOperated = true;
-
- if (internalCounter % 4 == 0 && world instanceof WorldServer)
- {
- WorldServer server = (WorldServer) world;
- server.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0.2, 0, 0.2, 0);
- }
-
- } else if (!hasOperated && progress > 0)
- {
- progress -= (int) (efficiencyMultiplier * drainRate);
-
- if (internalCounter % 2 == 0 && world instanceof WorldServer)
- {
- WorldServer server = (WorldServer) world;
- server.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0.1, 0, 0.1, 0);
- }
- }
-
- if (hasOperated)
- {
- if (progress >= liquidRequired * stackSize)
- {
- ItemStack result = ItemHandlerHelper.copyStackWithSize(recipe.getOutput(), stackSize);
-
- BloodMagicCraftedEvent.Altar event = new BloodMagicCraftedEvent.Altar(result, input.copy());
- MinecraftForge.EVENT_BUS.post(event);
- tileAltar.setInventorySlotContents(0, event.getOutput());
- progress = 0;
-
- if (world instanceof WorldServer)
- {
- WorldServer server = (WorldServer) world;
- server.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 40, 0.3, 0, 0.3, 0);
- }
-
- this.cooldownAfterCrafting = 30;
- this.isActive = false;
- }
- }
- } else
- {
- ItemStack contained = tileAltar.getStackInSlot(0);
-
- if (contained.isEmpty() || !(contained.getItem() instanceof IBloodOrb) || !(contained.getItem() instanceof IBindable))
- return;
-
- BloodOrb orb = ((IBloodOrb) contained.getItem()).getOrb(contained);
- Binding binding = ((IBindable) contained.getItem()).getBinding(contained);
-
- if (binding == null || orb == null)
- return;
-
- if (fluid != null && fluid.amount >= 1)
- {
- int liquidDrained = Math.min((int) (altarTier.ordinal() >= 2 ? orb.getFillRate() * (1 + consumptionMultiplier) : orb.getFillRate()), fluid.amount);
- int drain = NetworkHelper.getSoulNetwork(binding).add(SoulTicket.block(world, pos, liquidDrained), (int) (orb.getCapacity() * this.orbCapacityMultiplier));
- fluid.amount = fluid.amount - drain;
-
- if (drain > 0 && internalCounter % 4 == 0 && world instanceof WorldServer)
- {
- WorldServer server = (WorldServer) world;
- server.spawnParticle(EnumParticleTypes.SPELL_WITCH, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0, 0, 0, 0.001);
- }
- }
- }
-
- tileAltar.getWorld().notifyBlockUpdate(tileAltar.getPos(), tileAltar.getWorld().getBlockState(tileAltar.getPos()), tileAltar.getWorld().getBlockState(tileAltar.getPos()), 3);
- }
-
- public void checkTier()
- {
- AltarTier tier = AltarUtil.getTier(tileAltar.getWorld(), tileAltar.getPos());
- this.altarTier = tier;
-
- upgrade = AltarUtil.getUpgrades(tileAltar.getWorld(), tileAltar.getPos(), tier);
-
- if (tier.equals(currentTierDisplayed))
- currentTierDisplayed = AltarTier.ONE;
-
- if (tier.equals(AltarTier.ONE))
- {
- upgrade = null;
- isUpgraded = false;
- this.consumptionMultiplier = 0;
- this.efficiencyMultiplier = 1;
- this.sacrificeEfficiencyMultiplier = 0;
- this.selfSacrificeEfficiencyMultiplier = 0;
- this.capacityMultiplier = 1;
- this.orbCapacityMultiplier = 1;
- this.dislocationMultiplier = 1;
- this.accelerationUpgrades = 0;
- this.chargingFrequency = 20;
- this.chargingRate = 0;
- this.maxCharge = 0;
- this.totalCharge = 0;
- return;
- } else if (!tier.equals(AltarTier.ONE))
- {
- this.isUpgraded = true;
- this.accelerationUpgrades = upgrade.getLevel(BloodRuneType.ACCELERATION);
- this.consumptionMultiplier = (float) (0.20 * upgrade.getLevel(BloodRuneType.SPEED));
- this.efficiencyMultiplier = (float) Math.pow(0.85, upgrade.getLevel(BloodRuneType.EFFICIENCY));
- this.sacrificeEfficiencyMultiplier = (float) (0.10 * upgrade.getLevel(BloodRuneType.SACRIFICE));
- this.selfSacrificeEfficiencyMultiplier = (float) (0.10 * upgrade.getLevel(BloodRuneType.SELF_SACRIFICE));
- this.capacityMultiplier = (float) ((1 * Math.pow(1.10, upgrade.getLevel(BloodRuneType.AUGMENTED_CAPACITY))) + 0.20 * upgrade.getLevel(BloodRuneType.CAPACITY));
- this.dislocationMultiplier = (float) (Math.pow(1.2, upgrade.getLevel(BloodRuneType.DISPLACEMENT)));
- this.orbCapacityMultiplier = (float) (1 + 0.02 * upgrade.getLevel(BloodRuneType.ORB));
- this.chargingFrequency = Math.max(20 - accelerationUpgrades, 1);
- this.chargingRate = (int) (10 * upgrade.getLevel(BloodRuneType.CHARGING) * (1 + consumptionMultiplier / 2));
- this.maxCharge = (int) (Fluid.BUCKET_VOLUME * Math.max(0.5 * capacityMultiplier, 1) * upgrade.getLevel(BloodRuneType.CHARGING));
- }
-
- this.capacity = (int) (Fluid.BUCKET_VOLUME * 10 * capacityMultiplier);
- this.bufferCapacity = (int) (Fluid.BUCKET_VOLUME * 1 * capacityMultiplier);
-
- if (this.fluid.amount > this.capacity)
- this.fluid.amount = this.capacity;
- if (this.fluidOutput.amount > this.bufferCapacity)
- this.fluidOutput.amount = this.bufferCapacity;
- if (this.fluidInput.amount > this.bufferCapacity)
- this.fluidInput.amount = this.bufferCapacity;
- if (this.totalCharge > this.maxCharge)
- this.totalCharge = this.maxCharge;
-
- tileAltar.getWorld().notifyBlockUpdate(tileAltar.getPos(), tileAltar.getWorld().getBlockState(tileAltar.getPos()), tileAltar.getWorld().getBlockState(tileAltar.getPos()), 3);
- }
-
- public int fillMainTank(int amount)
- {
- int filledAmount = Math.min(capacity - fluid.amount, amount);
- fluid.amount += filledAmount;
-
- return filledAmount;
- }
-
- public void sacrificialDaggerCall(int amount, boolean isSacrifice)
- {
- if (this.lockdownDuration > 0)
- {
- int amt = (int) Math.min(bufferCapacity - fluidInput.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount);
- fluidInput.amount += amt;
- } else
- {
- fluid.amount += Math.min(capacity - fluid.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount);
- }
- }
-
- public void setMainFluid(FluidStack fluid)
- {
- this.fluid = fluid;
- }
-
- public void setOutputFluid(FluidStack fluid)
- {
- this.fluidOutput = fluid;
- }
-
- public void setInputFluid(FluidStack fluid)
- {
- this.fluidInput = fluid;
- }
-
- public AltarUpgrade getUpgrade()
- {
- return upgrade;
- }
-
- public void setUpgrade(AltarUpgrade upgrade)
- {
- this.upgrade = upgrade;
- }
-
- public int getCapacity()
- {
- return capacity;
- }
-
- public FluidStack getFluid()
- {
- return fluid;
- }
-
- public int getFluidAmount()
- {
- return fluid.amount;
- }
-
- public int getCurrentBlood()
- {
- return getFluidAmount();
- }
-
- public AltarTier getTier()
- {
- return altarTier;
- }
-
- public void setTier(AltarTier tier)
- {
- this.altarTier = tier;
- }
-
- public int getProgress()
- {
- return progress;
- }
-
- public float getSacrificeMultiplier()
- {
- return sacrificeEfficiencyMultiplier;
- }
-
- public float getSelfSacrificeMultiplier()
- {
- return selfSacrificeEfficiencyMultiplier;
- }
-
- public float getOrbMultiplier()
- {
- return orbCapacityMultiplier;
- }
-
- public float getDislocationMultiplier()
- {
- return dislocationMultiplier;
- }
-
- public float getConsumptionMultiplier()
- {
- return consumptionMultiplier;
- }
-
- public float getConsumptionRate()
- {
- return consumptionRate;
- }
-
- public int getLiquidRequired()
- {
- return liquidRequired;
- }
-
- public int getBufferCapacity()
- {
- return bufferCapacity;
- }
-
- public boolean setCurrentTierDisplayed(AltarTier altarTier)
- {
- if (currentTierDisplayed == altarTier)
- return false;
- else
- currentTierDisplayed = altarTier;
- return true;
- }
-
- public void addToDemonBloodDuration(int dur)
- {
- this.demonBloodDuration += dur;
- }
-
- public boolean hasDemonBlood()
- {
- return this.demonBloodDuration > 0;
- }
-
- public void decrementDemonBlood()
- {
- this.demonBloodDuration = Math.max(0, this.demonBloodDuration - 1);
- }
-
- public void setActive()
- {
- if (tileAltar.getStackInSlot(0).isEmpty())
- {
- isActive = false;
- }
- }
-
- public boolean isActive()
- {
- return isActive;
- }
-
- public void requestPauseAfterCrafting(int amount)
- {
- if (this.isActive)
- {
- this.cooldownAfterCrafting = amount;
- }
- }
-
- public int getChargingRate()
- {
- return chargingRate;
- }
-
- public int getTotalCharge()
- {
- return totalCharge;
- }
-
- public int getChargingFrequency()
- {
- return chargingFrequency == 0 ? 1 : chargingFrequency;
- }
-
- @Override
- public int fill(FluidStack resource, boolean doFill)
- {
- if (resource == null || resource.getFluid() != BlockLifeEssence.getLifeEssence())
- {
- return 0;
- }
-
- if (!doFill)
- {
- if (fluidInput == null)
- {
- return Math.min(bufferCapacity, resource.amount);
- }
-
- if (!fluidInput.isFluidEqual(resource))
- {
- return 0;
- }
-
- return Math.min(bufferCapacity - fluidInput.amount, resource.amount);
- }
-
- if (fluidInput == null)
- {
- fluidInput = new FluidStack(resource, Math.min(bufferCapacity, resource.amount));
-
- return fluidInput.amount;
- }
-
- if (!fluidInput.isFluidEqual(resource))
- {
- return 0;
- }
- int filled = bufferCapacity - fluidInput.amount;
-
- if (resource.amount < filled)
- {
- fluidInput.amount += resource.amount;
- filled = resource.amount;
- } else
- {
- fluidInput.amount = bufferCapacity;
- }
-
- return filled;
- }
-
- @Override
- public FluidStack drain(FluidStack resource, boolean doDrain)
- {
- if (resource == null || !resource.isFluidEqual(fluidOutput))
- {
- return null;
- }
- return drain(resource.amount, doDrain);
- }
-
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain)
- {
- if (fluidOutput == null)
- {
- return null;
- }
-
- int drained = maxDrain;
- if (fluidOutput.amount < drained)
- {
- drained = fluidOutput.amount;
- }
-
- FluidStack stack = new FluidStack(fluidOutput, drained);
- if (doDrain)
- {
- fluidOutput.amount -= drained;
- }
- return stack;
- }
-
- @Override
- public IFluidTankProperties[] getTankProperties()
- {
- return new IFluidTankProperties[] { new FluidTankPropertiesWrapper(new FluidTank(fluid, capacity)) };
- }
-
- public AltarTier getCurrentTierDisplayed()
- {
- return currentTierDisplayed;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/altar/ComponentType.java b/src/main/java/WayofTime/bloodmagic/altar/ComponentType.java
deleted file mode 100644
index 1eec1f0d..00000000
--- a/src/main/java/WayofTime/bloodmagic/altar/ComponentType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package WayofTime.bloodmagic.altar;
-
-import java.util.Locale;
-
-/**
- * List of different components used to construct different tiers of altars.
- */
-public enum ComponentType {
- GLOWSTONE,
- BLOODSTONE,
- BEACON,
- BLOODRUNE,
- CRYSTAL,
- NOTAIR;
-
- public static final ComponentType[] VALUES = values();
- private static final String BASE = "chat.bloodmagic.altar.comp.";
- private String key;
-
- ComponentType() {
- this.key = BASE + name().toLowerCase(Locale.ENGLISH);
- }
-
- public String getKey() {
- return key;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/altar/IAltarComponent.java b/src/main/java/WayofTime/bloodmagic/altar/IAltarComponent.java
deleted file mode 100644
index 6a96dc66..00000000
--- a/src/main/java/WayofTime/bloodmagic/altar/IAltarComponent.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package WayofTime.bloodmagic.altar;
-
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public interface IAltarComponent {
- @Nullable
- ComponentType getType(World world, IBlockState state, BlockPos pos);
-}
diff --git a/src/main/java/WayofTime/bloodmagic/altar/IAltarManipulator.java b/src/main/java/WayofTime/bloodmagic/altar/IAltarManipulator.java
deleted file mode 100644
index 5ce9f00c..00000000
--- a/src/main/java/WayofTime/bloodmagic/altar/IAltarManipulator.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package WayofTime.bloodmagic.altar;
-
-/**
- * Any item that implements this interface will not be pulled into the Altar on
- * right click.
- */
-public interface IAltarManipulator {
-}
diff --git a/src/main/java/WayofTime/bloodmagic/altar/IBloodAltar.java b/src/main/java/WayofTime/bloodmagic/altar/IBloodAltar.java
deleted file mode 100644
index 0270ac3e..00000000
--- a/src/main/java/WayofTime/bloodmagic/altar/IBloodAltar.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package WayofTime.bloodmagic.altar;
-
-public interface IBloodAltar {
- int getCapacity();
-
- int getCurrentBlood();
-
- AltarTier getTier();
-
- int getProgress();
-
- float getSacrificeMultiplier();
-
- float getSelfSacrificeMultiplier();
-
- float getOrbMultiplier();
-
- float getDislocationMultiplier();
-
- float getConsumptionMultiplier();
-
- float getConsumptionRate();
-
- int getChargingRate();
-
- int getChargingFrequency();
-
- int getTotalCharge();
-
- int getLiquidRequired();
-
- int getBufferCapacity();
-
- void sacrificialDaggerCall(int amount, boolean isSacrifice);
-
- void startCycle();
-
- void checkTier();
-
- boolean isActive();
-
- void setActive();
-
- int fillMainTank(int amount);
-
- /**
- * Will set the altar to initiate a cooldown cycle after it crafts before
- * starting to craft again, giving the user time to interact with the altar.
- * This can only be set while the altar is not active.
- *
- * @param cooldown - How long the cooldown should last
- */
- void requestPauseAfterCrafting(int cooldown);
-}
diff --git a/src/main/java/WayofTime/bloodmagic/api/impl/BloodMagicCorePlugin.java b/src/main/java/WayofTime/bloodmagic/api/impl/BloodMagicCorePlugin.java
deleted file mode 100644
index 3a0d0164..00000000
--- a/src/main/java/WayofTime/bloodmagic/api/impl/BloodMagicCorePlugin.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package WayofTime.bloodmagic.api.impl;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.ConfigHandler;
-import WayofTime.bloodmagic.api.BloodMagicPlugin;
-import WayofTime.bloodmagic.api.IBloodMagicAPI;
-import WayofTime.bloodmagic.api.IBloodMagicPlugin;
-import WayofTime.bloodmagic.altar.ComponentType;
-import WayofTime.bloodmagic.api.IBloodMagicRecipeRegistrar;
-import WayofTime.bloodmagic.block.BlockBloodRune;
-import WayofTime.bloodmagic.block.BlockDecorative;
-import WayofTime.bloodmagic.block.enums.BloodRuneType;
-import WayofTime.bloodmagic.block.enums.EnumDecorative;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicRecipes;
-import WayofTime.bloodmagic.incense.EnumTranquilityType;
-import WayofTime.bloodmagic.incense.TranquilityStack;
-import WayofTime.bloodmagic.util.StateUtil;
-import net.minecraft.block.Block;
-import net.minecraft.block.properties.IProperty;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.init.Blocks;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.common.registry.EntityEntry;
-import net.minecraftforge.fml.common.registry.ForgeRegistries;
-
-@BloodMagicPlugin
-public class BloodMagicCorePlugin implements IBloodMagicPlugin
-{
-
- @Override
- public void register(IBloodMagicAPI apiInterface)
- {
- BloodMagicAPI api = (BloodMagicAPI) apiInterface;
- // Add forced blacklistings
- api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE);
- api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.INPUT_ROUTING_NODE);
- api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE);
- api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.OUTPUT_ROUTING_NODE);
- api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE);
- api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE);
- api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE);
- api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.MASTER_ROUTING_NODE);
- api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.DEMON_CRYSTAL);
- api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.DEMON_CRYSTAL);
- api.getBlacklist().addTeleposer(RegistrarBloodMagicBlocks.INVERSION_PILLAR);
- api.getBlacklist().addTransposition(RegistrarBloodMagicBlocks.INVERSION_PILLAR);
- api.getBlacklist().addWellOfSuffering(new ResourceLocation("armor_stand"));
- api.getBlacklist().addWellOfSuffering(new ResourceLocation(BloodMagic.MODID, "sentient_specter"));
-
- api.getValueManager().setSacrificialValue(new ResourceLocation("armor_stand"), 0);
- api.getValueManager().setSacrificialValue(new ResourceLocation(BloodMagic.MODID, "sentient_specter"), 0);
-
- api.getValueManager().setTranquility(Blocks.LAVA, new TranquilityStack(EnumTranquilityType.LAVA, 1.2D));
- api.getValueManager().setTranquility(Blocks.FLOWING_LAVA, new TranquilityStack(EnumTranquilityType.LAVA, 1.2D));
- api.getValueManager().setTranquility(Blocks.WATER, new TranquilityStack(EnumTranquilityType.WATER, 1.0D));
- api.getValueManager().setTranquility(Blocks.FLOWING_WATER, new TranquilityStack(EnumTranquilityType.WATER, 1.0D));
- api.getValueManager().setTranquility(RegistrarBloodMagicBlocks.LIFE_ESSENCE, new TranquilityStack(EnumTranquilityType.WATER, 1.5D));
- api.getValueManager().setTranquility(Blocks.NETHERRACK, new TranquilityStack(EnumTranquilityType.FIRE, 0.5D));
- api.getValueManager().setTranquility(Blocks.DIRT, new TranquilityStack(EnumTranquilityType.EARTHEN, 0.25D));
- api.getValueManager().setTranquility(Blocks.FARMLAND, new TranquilityStack(EnumTranquilityType.EARTHEN, 1.0D));
- api.getValueManager().setTranquility(Blocks.POTATOES, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
- api.getValueManager().setTranquility(Blocks.CARROTS, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
- api.getValueManager().setTranquility(Blocks.WHEAT, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
- api.getValueManager().setTranquility(Blocks.NETHER_WART, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
- api.getValueManager().setTranquility(Blocks.BEETROOTS, new TranquilityStack(EnumTranquilityType.CROP, 1.0D));
-
- handleConfigValues(api);
-
- // Add standard blocks for altar components
- api.registerAltarComponent(Blocks.GLOWSTONE.getDefaultState(), ComponentType.GLOWSTONE.name());
- api.registerAltarComponent(Blocks.SEA_LANTERN.getDefaultState(), ComponentType.GLOWSTONE.name());
- api.registerAltarComponent(Blocks.BEACON.getDefaultState(), ComponentType.BEACON.name());
-
- BlockDecorative decorative = (BlockDecorative) RegistrarBloodMagicBlocks.DECORATIVE_BRICK;
- api.registerAltarComponent(decorative.getDefaultState().withProperty(decorative.getProperty(), EnumDecorative.BLOODSTONE_BRICK), ComponentType.BLOODSTONE.name());
- api.registerAltarComponent(decorative.getDefaultState().withProperty(decorative.getProperty(), EnumDecorative.BLOODSTONE_TILE), ComponentType.BLOODSTONE.name());
- api.registerAltarComponent(decorative.getDefaultState().withProperty(decorative.getProperty(), EnumDecorative.CRYSTAL_BRICK), ComponentType.CRYSTAL.name());
- api.registerAltarComponent(decorative.getDefaultState().withProperty(decorative.getProperty(), EnumDecorative.CRYSTAL_TILE), ComponentType.CRYSTAL.name());
-
- BlockBloodRune bloodRune = (BlockBloodRune) RegistrarBloodMagicBlocks.BLOOD_RUNE;
- for (BloodRuneType runeType : BloodRuneType.values())
- api.registerAltarComponent(bloodRune.getDefaultState().withProperty(bloodRune.getProperty(), runeType), ComponentType.BLOODRUNE.name());
- }
-
- @Override
- public void registerRecipes(IBloodMagicRecipeRegistrar recipeRegistrar)
- {
- RegistrarBloodMagicRecipes.registerAltarRecipes((BloodMagicRecipeRegistrar) recipeRegistrar);
- RegistrarBloodMagicRecipes.registerAlchemyTableRecipes((BloodMagicRecipeRegistrar) recipeRegistrar);
- RegistrarBloodMagicRecipes.registerTartaricForgeRecipes((BloodMagicRecipeRegistrar) recipeRegistrar);
- RegistrarBloodMagicRecipes.registerAlchemyArrayRecipes((BloodMagicRecipeRegistrar) recipeRegistrar);
- RegistrarBloodMagicRecipes.registerSacrificeCraftRecipes((BloodMagicRecipeRegistrar) recipeRegistrar);
- }
-
- private static void handleConfigValues(BloodMagicAPI api)
- {
- for (String value : ConfigHandler.values.sacrificialValues)
- {
- String[] split = value.split(";");
- if (split.length != 2) // Not valid format
- continue;
-
- api.getValueManager().setSacrificialValue(new ResourceLocation(split[0]), Integer.parseInt(split[1]));
- }
-
- for (String value : ConfigHandler.blacklist.teleposer)
- {
- EntityEntry entityEntry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(value));
- if (entityEntry == null)
- { // It's not an entity (or at least not a valid one), so let's try a block.
- String[] blockData = value.split("\\[");
- Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(blockData[0]));
- if (block == Blocks.AIR || block == null) // Not a valid block either
- continue;
-
- if (blockData.length > 1)
- { // We have properties listed, so let's build a state.
- api.getBlacklist().addTeleposer(StateUtil.parseState(value));
- continue;
- }
-
- api.getBlacklist().addTeleposer(block);
- continue;
- }
-
- api.getBlacklist().addTeleposer(entityEntry.getRegistryName());
- }
-
- for (String value : ConfigHandler.blacklist.transposer)
- {
- String[] blockData = value.split("\\[");
- Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(blockData[0]));
- if (block == Blocks.AIR || block == null) // Not a valid block
- continue;
-
- if (blockData.length > 1)
- { // We have properties listed, so let's build a state.
- api.getBlacklist().addTeleposer(StateUtil.parseState(value));
- continue;
- }
-
- api.getBlacklist().addTeleposer(block);
- }
-
- for (String value : ConfigHandler.blacklist.wellOfSuffering)
- {
- EntityEntry entityEntry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(value));
- if (entityEntry == null) // Not a valid entity
- continue;
-
- api.getBlacklist().addWellOfSuffering(entityEntry.getRegistryName());
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/api/impl/BloodMagicValueManager.java b/src/main/java/WayofTime/bloodmagic/api/impl/BloodMagicValueManager.java
deleted file mode 100644
index 5c894574..00000000
--- a/src/main/java/WayofTime/bloodmagic/api/impl/BloodMagicValueManager.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package WayofTime.bloodmagic.api.impl;
-
-import WayofTime.bloodmagic.api.IBloodMagicValueManager;
-import WayofTime.bloodmagic.incense.EnumTranquilityType;
-import WayofTime.bloodmagic.incense.TranquilityStack;
-import WayofTime.bloodmagic.util.BMLog;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-import net.minecraft.block.Block;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.util.ResourceLocation;
-
-import javax.annotation.Nonnull;
-import java.util.Map;
-
-public class BloodMagicValueManager implements IBloodMagicValueManager {
-
- private final Map sacrificial;
- private final Map tranquility;
-
- public BloodMagicValueManager() {
- this.sacrificial = Maps.newHashMap();
- this.tranquility = Maps.newHashMap();
- }
-
- @Override
- public void setSacrificialValue(@Nonnull ResourceLocation entityId, int value) {
- BMLog.API_VERBOSE.info("Value Manager: Set sacrificial value of {} to {}.", entityId, value);
- sacrificial.put(entityId, value);
- }
-
- @Override
- public void setTranquility(@Nonnull IBlockState state, @Nonnull String tranquilityType, double value) {
- EnumTranquilityType tranquility = null;
- for (EnumTranquilityType type : EnumTranquilityType.values()) {
- if (type.name().equalsIgnoreCase(tranquilityType)) {
- tranquility = type;
- break;
- }
- }
-
- if (tranquility != null) {
- BMLog.API_VERBOSE.info("Value Manager: Set tranquility value of {} to {} @ {}", state, tranquilityType, value);
- this.tranquility.put(state, new TranquilityStack(tranquility, value));
- } else BMLog.API.warn("Invalid tranquility type: {}.", tranquilityType);
- }
-
- public void setTranquility(Block block, TranquilityStack tranquilityStack) {
- for (IBlockState state : block.getBlockState().getValidStates()) {
- BMLog.API_VERBOSE.info("Value Manager: Set tranquility value of {} to {} @ {}", state, tranquilityStack.type, tranquilityStack.value);
- tranquility.put(state, tranquilityStack);
- }
- }
-
- public Map getSacrificial() {
- return ImmutableMap.copyOf(sacrificial);
- }
-
- public Map getTranquility() {
- return ImmutableMap.copyOf(tranquility);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyArray.java b/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyArray.java
deleted file mode 100644
index 1e02ef13..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyArray.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
-import WayofTime.bloodmagic.tile.TileAlchemyArray;
-import WayofTime.bloodmagic.util.Utils;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.RayTraceResult;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.annotation.Nullable;
-import java.util.List;
-import java.util.Random;
-
-public class BlockAlchemyArray extends Block {
- protected static final AxisAlignedBB ARRAY_AABB = new AxisAlignedBB(0, 0, 0, 1, 0.1, 1);
-
- public BlockAlchemyArray() {
- super(Material.CLOTH);
-
- setUnlocalizedName(BloodMagic.MODID + ".alchemyArray");
- setHardness(0.1f);
- }
-
- @Override
- public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
- // No-op
- }
-
- @Override
- public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileAlchemyArray) {
- ((TileAlchemyArray) tile).onEntityCollidedWithBlock(state, entity);
- }
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
- return ARRAY_AABB;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public BlockRenderLayer getBlockLayer() {
- return BlockRenderLayer.CUTOUT;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.INVISIBLE;
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- //TODO: Right click should rotate it
- TileAlchemyArray array = (TileAlchemyArray) world.getTileEntity(pos);
-
- if (array == null || player.isSneaking())
- return false;
-
- ItemStack playerItem = player.getHeldItem(hand);
-
- if (!playerItem.isEmpty()) {
- if (array.getStackInSlot(0).isEmpty()) {
- Utils.insertItemToTile(array, player, 0);
- } else if (!array.getStackInSlot(0).isEmpty()) {
- Utils.insertItemToTile(array, player, 1);
- array.attemptCraft();
- } else {
- return true;
- }
- }
-
- world.notifyBlockUpdate(pos, state, state, 3);
- return true;
- }
-
- @Override
- public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
- return new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES);
- }
-
- @Override
- public int quantityDropped(Random random) {
- return 0;
- }
-
- @Override
- public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
- TileAlchemyArray alchemyArray = (TileAlchemyArray) world.getTileEntity(blockPos);
- if (alchemyArray != null)
- alchemyArray.dropItems();
-
- super.breakBlock(world, blockPos, blockState);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileAlchemyArray();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java b/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java
deleted file mode 100644
index 8d9c9b8f..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.util.Constants;
-import WayofTime.bloodmagic.item.block.ItemBlockAlchemyTable;
-import WayofTime.bloodmagic.tile.TileAlchemyTable;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyBool;
-import net.minecraft.block.properties.PropertyEnum;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public class BlockAlchemyTable extends Block implements IBMBlock {
- public static final PropertyBool INVISIBLE = PropertyBool.create("invisible");
- public static final PropertyEnum DIRECTION = PropertyEnum.create("direction", EnumFacing.class);
-
- public BlockAlchemyTable() {
- super(Material.ROCK);
-// this.setDefaultState(this.blockState.getBaseState().withProperty(DIRECTION, EnumFacing.DOWN).withProperty(INVISIBLE, false));
-
- setUnlocalizedName(BloodMagic.MODID + ".alchemyTable");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 0);
-
-// setBlockBounds(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
- return layer == BlockRenderLayer.CUTOUT_MIPPED || layer == BlockRenderLayer.TRANSLUCENT;
- }
-
- @Override
- public IBlockState getStateFromMeta(int meta) {
- return this.getDefaultState();
- }
-
- /**
- * Convert the BlockState into the correct metadata value
- */
- @Override
- public int getMetaFromState(IBlockState state) {
- return 0;
- }
-
- @Override
- public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileAlchemyTable) {
- return state.withProperty(INVISIBLE, ((TileAlchemyTable) tile).isInvisible()).withProperty(DIRECTION, ((TileAlchemyTable) tile).getDirection());
- }
-
- return state.withProperty(INVISIBLE, false);
- }
-
- @Override
- protected BlockStateContainer createBlockState() {
- return new BlockStateContainer(this, DIRECTION, INVISIBLE);
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- BlockPos position = pos;
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileAlchemyTable) {
- if (((TileAlchemyTable) tile).isSlave()) {
- position = ((TileAlchemyTable) tile).getConnectedPos();
- tile = world.getTileEntity(position);
- if (!(tile instanceof TileAlchemyTable)) {
- return false;
- }
- }
- }
-
- player.openGui(BloodMagic.instance, Constants.Gui.ALCHEMY_TABLE_GUI, world, position.getX(), position.getY(), position.getZ());
-
- return true;
- }
-
- @Override
- public void breakBlock(World world, BlockPos pos, IBlockState blockState) {
- TileAlchemyTable tile = (TileAlchemyTable) world.getTileEntity(pos);
- if (tile != null && !tile.isSlave()) {
- tile.dropItems();
- }
-
- super.breakBlock(world, pos, blockState);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileAlchemyTable();
- }
-
- @Override
- public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
- TileAlchemyTable tile = (TileAlchemyTable) world.getTileEntity(pos);
- if (tile != null) {
- BlockPos connectedPos = tile.getConnectedPos();
- TileEntity connectedTile = world.getTileEntity(connectedPos);
- if (!(connectedTile instanceof TileAlchemyTable && ((TileAlchemyTable) connectedTile).getConnectedPos().equals(pos))) {
- this.breakBlock(world, pos, state);
- world.setBlockToAir(pos);
- }
- }
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlockAlchemyTable(this);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java b/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java
deleted file mode 100644
index 3f979f47..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.altar.*;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.core.data.Binding;
-import WayofTime.bloodmagic.core.data.SoulNetwork;
-import WayofTime.bloodmagic.iface.IAltarReader;
-import WayofTime.bloodmagic.iface.IBindable;
-import WayofTime.bloodmagic.iface.IDocumentedBlock;
-import WayofTime.bloodmagic.orb.BloodOrb;
-import WayofTime.bloodmagic.orb.IBloodOrb;
-import WayofTime.bloodmagic.tile.TileAltar;
-import WayofTime.bloodmagic.util.Utils;
-import WayofTime.bloodmagic.util.helper.NetworkHelper;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.text.ITextComponent;
-import net.minecraft.util.text.TextComponentTranslation;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import org.apache.commons.lang3.tuple.Pair;
-
-import javax.annotation.Nullable;
-import java.util.ArrayList;
-import java.util.List;
-
-public class BlockAltar extends Block implements IVariantProvider, IDocumentedBlock, IBMBlock {
- public BlockAltar() {
- super(Material.ROCK);
-
- setUnlocalizedName(BloodMagic.MODID + ".altar");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 1);
- }
-
- @Override
- public boolean hasComparatorInputOverride(IBlockState state) {
- return true;
- }
-
- @Override
- public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
- if (world.isRemote)
- return 0;
-
- TileEntity tile = world.getTileEntity(pos);
-
- if (tile instanceof TileAltar) {
- TileAltar altar = (TileAltar) tile;
- ItemStack orbStack = altar.getStackInSlot(0);
-
- if (world.getBlockState(pos.down()).getBlock() instanceof BlockDecorative) {
- if (orbStack.getItem() instanceof IBloodOrb && orbStack.getItem() instanceof IBindable) {
- BloodOrb orb = ((IBloodOrb) orbStack.getItem()).getOrb(orbStack);
- Binding binding = ((IBindable) orbStack.getItem()).getBinding(orbStack);
- if (orb != null && binding != null) {
- SoulNetwork soulNetwork = NetworkHelper.getSoulNetwork(binding);
-
- int maxEssence = orb.getCapacity();
- int currentEssence = soulNetwork.getCurrentEssence();
- int level = currentEssence * 15 / maxEssence;
- return Math.min(15, level) % 16;
- }
- }
- } else {
- int maxEssence = altar.getCapacity();
- int currentEssence = altar.getCurrentBlood();
- int level = currentEssence * 15 / maxEssence;
- return Math.min(15, level) % 16;
- }
- }
-
- return 0;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return true;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- TileAltar altar = (TileAltar) world.getTileEntity(pos);
-
- if (altar == null || player.isSneaking())
- return false;
-
- ItemStack playerItem = player.getHeldItem(hand);
-
- if (playerItem.getItem() instanceof IAltarReader || playerItem.getItem() instanceof IAltarManipulator) {
- playerItem.getItem().onItemRightClick(world, player, hand);
- return true;
- }
-
- if (Utils.insertItemToTile(altar, player))
- altar.startCycle();
- else
- altar.setActive();
-
- world.notifyBlockUpdate(pos, state, state, 3);
- return true;
- }
-
- @Override
- public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
- TileEntity tile = world.getTileEntity(blockPos);
- if (tile instanceof TileAltar)
- ((TileAltar) tile).dropItems();
-
- super.breakBlock(world, blockPos, blockState);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileAltar();
- }
-
- // IDocumentedBlock
-
- @Override
- public List getDocumentation(EntityPlayer player, World world, BlockPos pos, IBlockState state) {
- List docs = new ArrayList<>();
- IBloodAltar altar = ((IBloodAltar) world.getTileEntity(pos));
- Pair missingBlock = AltarUtil.getFirstMissingComponent(world, pos, altar.getTier().toInt());
- if (missingBlock != null)
- docs.add(new TextComponentTranslation("chat.bloodmagic.altar.nextTier", new TextComponentTranslation(missingBlock.getRight().getKey()), Utils.prettifyBlockPosString(missingBlock.getLeft())));
-
- return docs;
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlock(this);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java b/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java
deleted file mode 100644
index 7076f77f..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.entity.EntityPlayerSP;
-import net.minecraft.client.particle.ParticleManager;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.EnumParticleTypes;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.annotation.Nullable;
-import java.util.Random;
-
-public class BlockBloodLight extends Block {
- protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.4, 0.4, 0.4, 0.6, 0.6, 0.6);
-
- public BlockBloodLight() {
- super(Material.CLOTH);
-
- setUnlocalizedName(BloodMagic.MODID + ".bloodLight");
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
- return AABB;
- }
-
- @Nullable
- @Override
- public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) {
- return NULL_AABB;
- }
-
- @Override
- public boolean isReplaceable(IBlockAccess world, BlockPos pos) {
- return true;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public BlockRenderLayer getBlockLayer() {
- return BlockRenderLayer.CUTOUT;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public int getLightValue(IBlockState state) {
- return 15;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean addDestroyEffects(World world, BlockPos pos, ParticleManager particleManager) {
- if (world.getBlockState(pos).getBlock() == this) {
- Random random = new Random();
- particleManager.spawnEffectParticle(EnumParticleTypes.REDSTONE.getParticleID(), pos.getX() + 0.5D + random.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + random.nextGaussian() / 8, 0, 0, 0);
- }
- return true;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
- EntityPlayerSP player = Minecraft.getMinecraft().player;
-
- if (rand.nextInt(3) != 0) {
- world.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
- ItemStack heldItem = player.getHeldItem(EnumHand.MAIN_HAND);
-
- if (heldItem.isEmpty() || heldItem.getItem() != RegistrarBloodMagicItems.SIGIL_BLOOD_LIGHT)
- return;
-
- for (int i = 0; i < 8; i++)
- world.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
- }
- }
-
- @Override
- public int quantityDropped(Random par1Random) {
- return 0;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockBloodRune.java b/src/main/java/WayofTime/bloodmagic/block/BlockBloodRune.java
deleted file mode 100644
index 471bc99d..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockBloodRune.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.block.enums.BloodRuneType;
-import WayofTime.bloodmagic.iface.IBloodRune;
-import WayofTime.bloodmagic.util.helper.TextHelper;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.util.ITooltipFlag;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-import java.util.List;
-
-public class BlockBloodRune extends BlockEnum implements IBloodRune {
-
- public BlockBloodRune() {
- super(Material.ROCK, BloodRuneType.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".rune.");
- setCreativeTab(BloodMagic.TAB_BM);
- setSoundType(SoundType.STONE);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Nullable
- @Override
- public BloodRuneType getBloodRune(IBlockAccess world, BlockPos pos, IBlockState state) {
- return state.getValue(getProperty());
- }
-
- @Override
- public void addInformation(ItemStack stack, World world, List tooltip, ITooltipFlag tooltipFlag) {
- tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.decoration.safe"));
- super.addInformation(stack, world, tooltip, tooltipFlag);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockBloodTank.java b/src/main/java/WayofTime/bloodmagic/block/BlockBloodTank.java
deleted file mode 100644
index 47e03d74..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockBloodTank.java
+++ /dev/null
@@ -1,195 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockInteger;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.item.block.ItemBlockBloodTank;
-import WayofTime.bloodmagic.tile.TileBloodTank;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.RayTraceResult;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidUtil;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-public class BlockBloodTank extends BlockInteger implements IVariantProvider, IBMBlock {
- public static final AxisAlignedBB BOX = new AxisAlignedBB(0.25, 0, 0.25, 0.75, 0.8, 0.75);
-
- public BlockBloodTank() {
- super(Material.IRON, TileBloodTank.CAPACITIES.length - 1, "tier");
-
- setUnlocalizedName(BloodMagic.MODID + ".bloodTank");
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.GLASS);
- setHarvestLevel("pickaxe", 1);
- setCreativeTab(BloodMagic.TAB_BM);
- setLightOpacity(0);
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
- return BOX;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public BlockRenderLayer getBlockLayer() {
- return BlockRenderLayer.CUTOUT_MIPPED;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity tile, ItemStack stack) {
- super.harvestBlock(world, player, pos, state, tile, stack);
- world.setBlockToAir(pos);
- }
-
- @Override
- public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
- return willHarvest || super.removedByPlayer(state, world, pos, player, willHarvest);
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- boolean success = FluidUtil.interactWithFluidHandler(player, hand, world, blockPos, side);
- if (success) {
- world.checkLight(blockPos);
- world.updateComparatorOutputLevel(blockPos, this);
- world.markAndNotifyBlock(blockPos, world.getChunkFromBlockCoords(blockPos), state, state, 3);
- return true;
- }
-
- return true;
- }
-
- @Override
- public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) {
- if (!player.capabilities.isCreativeMode)
- this.dropBlockAsItem(worldIn, pos, state, 0);
- super.onBlockHarvested(worldIn, pos, state, player);
- }
-
- @Override
- public void getDrops(NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState blockState, int fortune) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileBloodTank) {
- TileBloodTank bloodTank = (TileBloodTank) tile;
- ItemStack drop = new ItemStack(this, 1, bloodTank.getBlockMetadata());
- NBTTagCompound fluidTag = new NBTTagCompound();
-
- if (bloodTank.getTank().getFluid() != null) {
- bloodTank.getTank().getFluid().writeToNBT(fluidTag);
- NBTTagCompound dropTag = new NBTTagCompound();
- dropTag.setTag("Fluid", fluidTag);
- drop.setTagCompound(dropTag);
- }
-
- drops.add(drop);
- }
- }
-
- @Override
- public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, EntityLivingBase placer, ItemStack stack) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileBloodTank) {
- TileBloodTank bloodTank = (TileBloodTank) tile;
- NBTTagCompound tag = stack.getTagCompound();
- if (stack.hasTagCompound() && stack.getTagCompound().hasKey("Fluid")) {
- FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tag.getCompoundTag("Fluid"));
- bloodTank.getTank().setFluid(fluidStack);
- }
- }
-
- world.checkLight(pos);
- world.updateComparatorOutputLevel(pos, this);
- world.markAndNotifyBlock(pos, world.getChunkFromBlockCoords(pos), blockState, blockState, 3);
- }
-
- @Override
- public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileBloodTank) {
- FluidStack fluidStack = ((TileBloodTank) tile).getTank().getFluid();
- return fluidStack == null || fluidStack.amount <= 0 ? 0 : fluidStack.getFluid().getLuminosity(fluidStack);
- }
-
- return super.getLightValue(state, world, pos);
- }
-
- @Override
- public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
- return new ItemStack(this, 1, getMetaFromState(state));
- }
-
- @Override
- public boolean hasComparatorInputOverride(IBlockState state) {
- return true;
- }
-
- @Override
- public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileBloodTank)
- return ((TileBloodTank) tile).getComparatorOutput();
- return 0;
- }
-
- @Override
- public TileEntity createTileEntity(World worldIn, IBlockState blockState) {
- return new TileBloodTank(getMetaFromState(blockState));
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlockBloodTank(this);
- }
-
- // IVariantProvider
-
- @Override
- public void gatherVariants(@Nonnull Int2ObjectMap variants) {
- for (int i = 0; i < TileBloodTank.CAPACITIES.length; i++)
- variants.put(i, "inventory");
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDecorative.java b/src/main/java/WayofTime/bloodmagic/block/BlockDecorative.java
deleted file mode 100644
index 281b4fb5..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDecorative.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.block.enums.EnumDecorative;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-
-public class BlockDecorative extends BlockEnum {
- public BlockDecorative() {
- super(Material.ROCK, EnumDecorative.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonBase.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonBase.java
deleted file mode 100644
index 782758fa..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonBase.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.util.IStringSerializable;
-
-public class BlockDemonBase & IStringSerializable> extends BlockEnum implements IVariantProvider {
- public BlockDemonBase(String baseName, Class enumClass) {
- super(Material.ROCK, enumClass);
-
- setUnlocalizedName(BloodMagic.MODID + "." + baseName + ".");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java
deleted file mode 100644
index 5627ce9d..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.soul.IDemonWillGem;
-import WayofTime.bloodmagic.soul.IDiscreteDemonWill;
-import WayofTime.bloodmagic.tile.TileDemonCrucible;
-import WayofTime.bloodmagic.util.Utils;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public class BlockDemonCrucible extends Block implements IVariantProvider, IBMBlock {
- public BlockDemonCrucible() {
- super(Material.ROCK);
-
- setUnlocalizedName(BloodMagic.MODID + ".demonCrucible");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 0);
-
-// setBlockBounds(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- ItemStack heldItem = player.getHeldItem(hand);
- TileDemonCrucible crucible = (TileDemonCrucible) world.getTileEntity(pos);
-
- if (crucible == null || player.isSneaking())
- return false;
-
- if (!heldItem.isEmpty()) {
- if (!(heldItem.getItem() instanceof IDiscreteDemonWill) && !(heldItem.getItem() instanceof IDemonWillGem)) {
- return true;
- }
- }
-
- Utils.insertItemToTile(crucible, player);
-
- world.notifyBlockUpdate(pos, state, state, 3);
- return true;
- }
-
- @Override
- public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
- TileDemonCrucible tile = (TileDemonCrucible) world.getTileEntity(blockPos);
- if (tile != null)
- tile.dropItems();
-
- super.breakBlock(world, blockPos, blockState);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileDemonCrucible();
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlock(this);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java
deleted file mode 100644
index 61b7073c..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java
+++ /dev/null
@@ -1,223 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.item.ItemDemonCrystal;
-import WayofTime.bloodmagic.item.block.ItemBlockDemonCrystal;
-import WayofTime.bloodmagic.soul.EnumDemonWillType;
-import WayofTime.bloodmagic.soul.PlayerDemonWillHandler;
-import WayofTime.bloodmagic.tile.TileDemonCrystal;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyEnum;
-import net.minecraft.block.properties.PropertyInteger;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-public class BlockDemonCrystal extends Block implements IBMBlock, IVariantProvider {
- public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 6);
- public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumDemonWillType.class);
- public static final PropertyEnum ATTACHED = PropertyEnum.create("attached", EnumFacing.class);
-
- public BlockDemonCrystal() {
- super(Material.ROCK);
- this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, EnumDemonWillType.DEFAULT).withProperty(ATTACHED, EnumFacing.UP));
-
- setUnlocalizedName(BloodMagic.MODID + ".demonCrystal.");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- if (!world.isRemote) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileDemonCrystal) {
- TileDemonCrystal crystal = (TileDemonCrystal) tile;
- boolean isCreative = player.capabilities.isCreativeMode;
- boolean holdsCrystal = player.getHeldItem(hand).getItem() instanceof ItemDemonCrystal;
-
- if (PlayerDemonWillHandler.getTotalDemonWill(EnumDemonWillType.DEFAULT, player) > 1024 && !(holdsCrystal && isCreative)) {
- crystal.dropSingleCrystal();
-
- }
- if (!crystal.getWorld().isRemote && isCreative && holdsCrystal) {
- if (crystal.crystalCount < 7) {
- crystal.internalCounter = 0;
- if(crystal.progressToNextCrystal > 0)
- crystal.progressToNextCrystal--;
- crystal.crystalCount++;
- crystal.markDirty();
- crystal.notifyUpdate();
- }
- }
- }
- }
- return true;
- }
-
- @Override
- public void getDrops(NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileDemonCrystal) {
- EnumDemonWillType type = state.getValue(TYPE);
- int number = ((TileDemonCrystal) tile).getCrystalCount();
-
- drops.add(getItemStackDropped(type, number));
- }
- }
-
- @Override
- public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileDemonCrystal) {
- TileDemonCrystal crystal = (TileDemonCrystal) tile;
- state = state.withProperty(AGE, crystal.getCrystalCountForRender());
- state = state.withProperty(ATTACHED, crystal.getPlacement());
- }
- return state;
- }
-
- @Override
- public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileDemonCrystal) {
- TileDemonCrystal crystal = (TileDemonCrystal) tile;
- EnumFacing placement = crystal.getPlacement();
- BlockPos offsetPos = pos.offset(placement.getOpposite());
- IBlockState offsetState = world.getBlockState(offsetPos);
-
- if (!offsetState.isSideSolid(world, offsetPos, placement))
- world.destroyBlock(pos, true);
- }
- }
-
- @Override
- public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side) {
- BlockPos offsetPos = pos.offset(side.getOpposite());
- IBlockState offsetState = world.getBlockState(offsetPos);
-
- return offsetState.isSideSolid(world, offsetPos, side) && this.canPlaceBlockAt(world, pos);
- }
-
- @Override
- public void getSubBlocks(CreativeTabs creativeTabs, NonNullList list) {
- for (EnumDemonWillType willType : EnumDemonWillType.values())
- list.add(new ItemStack(this, 1, willType.ordinal()));
- }
-
- @Override
- public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity tile, ItemStack stack) {
- super.harvestBlock(world, player, pos, state, tile, stack);
- world.setBlockToAir(pos);
- }
-
- @Override
- public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
- return willHarvest || super.removedByPlayer(state, world, pos, player, false);
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public IBlockState getStateFromMeta(int meta) {
- return this.getDefaultState().withProperty(TYPE, EnumDemonWillType.values()[meta]);
- }
-
- @Override
- public int getMetaFromState(IBlockState state) {
- return state.getValue(TYPE).ordinal();
- }
-
- @Override
- protected BlockStateContainer createBlockState() {
- return new BlockStateContainer(this, TYPE, AGE, ATTACHED);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileDemonCrystal();
- }
-
- public static ItemStack getItemStackDropped(EnumDemonWillType type, int crystalNumber) {
- ItemStack stack = ItemStack.EMPTY;
- switch (type) {
- case CORROSIVE:
- stack = EnumDemonWillType.CORROSIVE.getStack();
- break;
- case DEFAULT:
- stack = EnumDemonWillType.DEFAULT.getStack();
- break;
- case DESTRUCTIVE:
- stack = EnumDemonWillType.DESTRUCTIVE.getStack();
- break;
- case STEADFAST:
- stack = EnumDemonWillType.STEADFAST.getStack();
- break;
- case VENGEFUL:
- stack = EnumDemonWillType.VENGEFUL.getStack();
- break;
- }
-
- stack.setCount(crystalNumber);
- return stack;
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlockDemonCrystal(this);
- }
-
- @Override
- public void gatherVariants(@Nonnull Int2ObjectMap variants) {
- for (EnumDemonWillType willType : EnumDemonWillType.values())
- variants.put(willType.ordinal(), "age=3,attached=up,type=" + willType.getName());
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java
deleted file mode 100644
index 26ecfb88..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.tile.TileDemonCrystallizer;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import javax.annotation.Nonnull;
-
-public class BlockDemonCrystallizer extends BlockContainer implements IVariantProvider, IBMBlock {
- public BlockDemonCrystallizer() {
- super(Material.ROCK);
-
- setUnlocalizedName(BloodMagic.MODID + ".demonCrystallizer");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 0);
-
-// setBlockBounds(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
- }
-
- @Override
- public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
- return side == EnumFacing.UP;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int meta) {
- return new TileDemonCrystallizer();
- }
-
- @Override
- public void gatherVariants(@Nonnull Int2ObjectMap variants) {
- variants.put(0, "normal");
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlock(this);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonLight.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonLight.java
deleted file mode 100644
index f78e7266..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonLight.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.block.enums.EnumSubWillType;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-
-public class BlockDemonLight extends BlockEnum {
- public BlockDemonLight() {
- super(Material.ROCK, EnumSubWillType.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".demonlight.");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- setLightLevel(1);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPillarBase.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonPillarBase.java
deleted file mode 100644
index 5db379bb..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPillarBase.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnumPillar;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.IStringSerializable;
-
-import javax.annotation.Nonnull;
-
-public class BlockDemonPillarBase & IStringSerializable> extends BlockEnumPillar {
- public BlockDemonPillarBase(String baseName, Material materialIn, Class enumClass) {
- super(materialIn, enumClass);
-
- setUnlocalizedName(BloodMagic.MODID + "." + baseName + ".");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public void gatherVariants(@Nonnull Int2ObjectMap variants) {
- EnumFacing.Axis[] axis = new EnumFacing.Axis[]{EnumFacing.Axis.Y, EnumFacing.Axis.X, EnumFacing.Axis.Z};
-
- for (int i = 0; i < 3; i++)
- for (int j = 0; j < this.getTypes().length; j++)
- variants.put(i * 5 + j, "axis=" + axis[i] + ",type=" + this.getTypes()[j]);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPillarCapBase.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonPillarCapBase.java
deleted file mode 100644
index b31b09b1..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPillarCapBase.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnumPillarCap;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.IStringSerializable;
-
-import javax.annotation.Nonnull;
-
-public class BlockDemonPillarCapBase & IStringSerializable> extends BlockEnumPillarCap {
- public BlockDemonPillarCapBase(String baseName, Material materialIn, Class enumClass) {
- super(materialIn, enumClass);
-
- setUnlocalizedName(BloodMagic.MODID + "." + baseName + ".");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public void gatherVariants(@Nonnull Int2ObjectMap variants) {
- for (int i = 0; i < EnumFacing.values().length; i++)
- for (int j = 0; j < this.getTypes().length; j++)
- variants.put(i * 2 + j, "facing=" + EnumFacing.values()[i] + ",type=" + this.getTypes()[j]);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java
deleted file mode 100644
index 60fdafea..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.tile.TileDemonPylon;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-public class BlockDemonPylon extends BlockContainer implements IBMBlock, IVariantProvider {
- public BlockDemonPylon() {
- super(Material.ROCK);
-
- setUnlocalizedName(BloodMagic.MODID + ".demonPylon");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 0);
-
-// setBlockBounds(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int meta) {
- return new TileDemonPylon();
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlock(this);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonStairsBase.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonStairsBase.java
deleted file mode 100644
index 05bd1d75..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonStairsBase.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnumStairs;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.util.IStringSerializable;
-
-public class BlockDemonStairsBase & IStringSerializable> extends BlockEnumStairs {
- public BlockDemonStairsBase(String baseName, Material materialIn, Class enumClass) {
- super(materialIn, enumClass);
-
- setUnlocalizedName(BloodMagic.MODID + "." + baseName + ".");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public void gatherVariants(Int2ObjectMap variants) {
- for (int i = 0; i < this.getTypes().length; i++)
- variants.put(i, "facing=south,half=bottom,shape=straight,type=" + this.getTypes()[i]);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonWallBase.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonWallBase.java
deleted file mode 100644
index ba6699fa..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonWallBase.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnumWall;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.util.IStringSerializable;
-
-public class BlockDemonWallBase & IStringSerializable> extends BlockEnumWall {
- public BlockDemonWallBase(String baseName, Material materialIn, Class enumClass) {
- super(materialIn, enumClass);
-
- setUnlocalizedName(BloodMagic.MODID + "." + baseName + ".");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public void gatherVariants(Int2ObjectMap variants) {
- for (int i = 0; i < this.getTypes().length; i++)
- variants.put(i, "east=true,north=false,south=false,type=" + this.getTypes()[i] + ",up=true,west=true");
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java b/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java
deleted file mode 100644
index 8939e5f5..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.ritual.IMasterRitualStone;
-import WayofTime.bloodmagic.teleport.PortalLocation;
-import WayofTime.bloodmagic.teleport.TeleportQueue;
-import WayofTime.bloodmagic.block.base.BlockInteger;
-import WayofTime.bloodmagic.ritual.portal.LocationsHandler;
-import WayofTime.bloodmagic.ritual.portal.Teleports;
-import WayofTime.bloodmagic.tile.TileDimensionalPortal;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumParticleTypes;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.annotation.Nullable;
-import java.util.ArrayList;
-import java.util.Random;
-
-public class BlockDimensionalPortal extends BlockInteger {
- protected static final AxisAlignedBB AABB_0 = new AxisAlignedBB(0.0D, 0.0D, 0.375D, 1.0D, 1.0D, 0.625D);
- protected static final AxisAlignedBB AABB_1 = new AxisAlignedBB(0.375D, 0.0D, 0.0D, 0.625D, 1.0D, 1.0D);
- protected static final AxisAlignedBB AABB_DEFAULT = new AxisAlignedBB(0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D);
-
- public BlockDimensionalPortal() {
- super(Material.PORTAL, 2);
- setUnlocalizedName(BloodMagic.MODID + ".dimensionalPortal");
- setBlockUnbreakable();
- setResistance(2000);
- setLightOpacity(0);
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
- return null;
- }
-
- public boolean isOpaqueCube() {
- return false;
- }
-
- public boolean isFullCube() {
- return false;
- }
-
- @Override
- public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
- return 12;
- }
-
- @Override
- public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState blockState, Entity entity) {
- if (!world.isRemote && world.getTileEntity(pos) instanceof TileDimensionalPortal) {
- TileDimensionalPortal tile = (TileDimensionalPortal) world.getTileEntity(pos);
-
- if (LocationsHandler.getLocationsHandler() != null) {
- ArrayList linkedLocations = LocationsHandler.getLocationsHandler().getLinkedLocations(tile.portalID);
-
- if (linkedLocations != null && !linkedLocations.isEmpty() && linkedLocations.size() > 1) {
- if (world.getTileEntity(tile.getMasterStonePos()) != null && world.getTileEntity(tile.getMasterStonePos()) instanceof IMasterRitualStone) {
- IMasterRitualStone masterRitualStone = (IMasterRitualStone) world.getTileEntity(tile.getMasterStonePos());
- if (linkedLocations.get(0).equals(new PortalLocation(masterRitualStone.getBlockPos().up(), world.provider.getDimension()))) {
- PortalLocation portal = linkedLocations.get(1);
- if (portal.getDimension() == world.provider.getDimension()) {
- TeleportQueue.getInstance().addITeleport(new Teleports.TeleportSameDim(portal.getX(), portal.getY(), portal.getZ(), entity, masterRitualStone.getOwner(), false));
- } else {
- TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(portal.getX(), portal.getY(), portal.getZ(), entity, masterRitualStone.getOwner(), world, portal.getDimension(), false));
- }
- } else if (linkedLocations.get(1).equals(new PortalLocation(masterRitualStone.getBlockPos().up(), world.provider.getDimension()))) {
- PortalLocation portal = linkedLocations.get(0);
- if (portal.getDimension() == world.provider.getDimension()) {
- TeleportQueue.getInstance().addITeleport(new Teleports.TeleportSameDim(portal.getX(), portal.getY(), portal.getZ(), entity, masterRitualStone.getOwner(), false));
- } else {
- TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(portal.getX(), portal.getY(), portal.getZ(), entity, masterRitualStone.getOwner(), world, portal.getDimension(), false));
- }
- }
- }
- }
- }
- }
- }
-
- @Override
- public int quantityDropped(Random par1Random) {
- return 0;
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
- int meta = state.getBlock().getMetaFromState(state);
- if (meta == 0) {
- return AABB_0;
- } else if (meta == 1) {
- return AABB_1;
- } else {
- return AABB_DEFAULT;
- }
- }
-
-//
-// @Override
-// public void setBlockBoundsForItemRender()
-// {
-// setBlockBounds(0f, 0f, 0.375f, 1f, 1f, 0.625f);
-// }
-
- @Override
- @SideOnly(Side.CLIENT)
- public BlockRenderLayer getBlockLayer() {
- return BlockRenderLayer.TRANSLUCENT;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
- this.spawnParticles(world, pos.getX(), pos.getY(), pos.getZ());
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileDimensionalPortal();
- }
-
- private void spawnParticles(World world, int x, int y, int z) {
- Random random = world.rand;
- double d0 = 0.0625D;
- for (int i = 0; i < 6; ++i) {
- double particleX = (double) ((float) x + random.nextFloat());
- double particleY = (double) ((float) y + random.nextFloat());
- double particleZ = (double) ((float) z + random.nextFloat());
- if (i == 0 && !world.getBlockState(new BlockPos(x, y + 1, z)).isOpaqueCube()) {
- particleY = (double) (y + 1) + d0;
- }
- if (i == 1 && !world.getBlockState(new BlockPos(x, y - 1, z)).isOpaqueCube()) {
- particleY = (double) y - d0;
- }
- if (i == 2 && !world.getBlockState(new BlockPos(x, y, z + 1)).isOpaqueCube()) {
- particleZ = (double) (z + 1) + d0;
- }
- if (i == 3 && !world.getBlockState(new BlockPos(x, y, z - 1)).isOpaqueCube()) {
- particleZ = (double) z - d0;
- }
- if (i == 4 && !world.getBlockState(new BlockPos(x + 1, y, z)).isOpaqueCube()) {
- particleX = (double) (x + 1) + d0;
- }
- if (i == 5 && !world.getBlockState(new BlockPos(x - 1, y, z)).isOpaqueCube()) {
- particleX = (double) x - d0;
- }
- if (particleX < (double) x || particleX > (double) (x + 1) || particleY < 0.0D || particleY > (double) (y + 1) || particleZ < (double) z || particleZ > (double) (z + 1)) {
- world.spawnParticle(EnumParticleTypes.REDSTONE, particleX, particleY, particleZ, 0.0D, 0.0D, 0.0D);
- }
- }
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java b/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java
deleted file mode 100644
index e77d0982..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.tile.TileIncenseAltar;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public class BlockIncenseAltar extends Block implements IVariantProvider, IBMBlock {
- protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
-
- public BlockIncenseAltar() {
- super(Material.ROCK);
-
- setUnlocalizedName(BloodMagic.MODID + ".incenseAltar");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 0);
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
- return AABB;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
- TileIncenseAltar TileIncenseAltar = (TileIncenseAltar) world.getTileEntity(blockPos);
- if (TileIncenseAltar != null)
- TileIncenseAltar.dropItems();
-
- super.breakBlock(world, blockPos, blockState);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileIncenseAltar();
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlock(this);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockInputRoutingNode.java b/src/main/java/WayofTime/bloodmagic/block/BlockInputRoutingNode.java
deleted file mode 100644
index 85aab8ae..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockInputRoutingNode.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.util.Constants;
-import WayofTime.bloodmagic.tile.routing.TileInputRoutingNode;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public class BlockInputRoutingNode extends BlockRoutingNode {
- public BlockInputRoutingNode() {
- super();
-
- setUnlocalizedName(BloodMagic.MODID + ".inputRouting");
- }
-
- @Override
- //TODO: Combine BlockInputRoutingNode and BlockInputRoutingNode so they have the same superclass
- public void breakBlock(World world, BlockPos pos, IBlockState state) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileInputRoutingNode) {
- ((TileInputRoutingNode) tile).removeAllConnections();
- ((TileInputRoutingNode) tile).dropItems();
- }
- super.breakBlock(world, pos, state);
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- if (world.getTileEntity(pos) instanceof TileInputRoutingNode) {
- player.openGui(BloodMagic.instance, Constants.Gui.ROUTING_NODE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
- }
-
- return true;
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileInputRoutingNode();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java
deleted file mode 100644
index f9c17e29..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.block.enums.EnumSubWillType;
-import WayofTime.bloodmagic.tile.TileInversionPillar;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.property.Properties;
-
-public class BlockInversionPillar extends BlockEnum {
- public BlockInversionPillar() {
- super(Material.ROCK, EnumSubWillType.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".inversionpillar.");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
- TileEntity tile = world.getTileEntity(blockPos);
- if (tile instanceof TileInversionPillar) {
- TileInversionPillar tilePillar = (TileInversionPillar) world.getTileEntity(blockPos);
- tilePillar.removePillarFromMap();
- }
-
- super.breakBlock(world, blockPos, blockState);
- }
-
- @Override
- public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
- return super.getActualState(state, world, pos).withProperty(Properties.StaticProperty, true);
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public void gatherVariants(Int2ObjectMap variants) {
- for (int i = 0; i < this.getTypes().length; i++)
- variants.put(i, "static=false,type=" + this.getTypes()[i]);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileInversionPillar(state.getValue(getProperty()).getType());
- }
-
- protected BlockStateContainer createStateContainer() {
- return new BlockStateContainer.Builder(this).add(getProperty(), Properties.StaticProperty).add(Properties.AnimationProperty).build();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java
deleted file mode 100644
index 54193ee9..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.block.enums.EnumInversionCap;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-
-public class BlockInversionPillarEnd extends BlockEnum implements IVariantProvider {
- public BlockInversionPillarEnd() {
- super(Material.ROCK, EnumInversionCap.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".inversionpillarend.");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public void gatherVariants(Int2ObjectMap variants) {
- for (int i = 0; i < this.getTypes().length; i++)
- variants.put(i, "type=" + this.getTypes()[i]);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/block/BlockItemRoutingNode.java
deleted file mode 100644
index 1bb62034..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockItemRoutingNode.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.tile.routing.TileItemRoutingNode;
-import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public class BlockItemRoutingNode extends BlockRoutingNode {
- public BlockItemRoutingNode() {
- super();
-
- setUnlocalizedName(BloodMagic.MODID + ".itemRouting");
- }
-
- @Override
- public void breakBlock(World world, BlockPos pos, IBlockState state) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileRoutingNode) {
- ((TileRoutingNode) tile).removeAllConnections();
- }
- super.breakBlock(world, pos, state);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileItemRoutingNode();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockLifeEssence.java b/src/main/java/WayofTime/bloodmagic/block/BlockLifeEssence.java
deleted file mode 100644
index 8828d7c0..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockLifeEssence.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.util.Constants;
-import WayofTime.bloodmagic.util.helper.TextHelper;
-import net.minecraft.block.material.Material;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.BlockFluidClassic;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-
-import java.awt.Color;
-
-public class BlockLifeEssence extends BlockFluidClassic {
- private static final Fluid LIFE_ESSENCE = new FluidLifeEssence();
-
- public BlockLifeEssence() {
- super(LIFE_ESSENCE, Material.WATER);
-
- setUnlocalizedName(BloodMagic.MODID + ".fluid.lifeEssence");
- getLifeEssence().setBlock(this);
- }
-
- @Override
- public boolean canDisplace(IBlockAccess world, BlockPos blockPos) {
- return !world.getBlockState(blockPos).getBlock().getMaterial(world.getBlockState(blockPos)).isLiquid() && super.canDisplace(world, blockPos);
- }
-
- @Override
- public boolean displaceIfPossible(World world, BlockPos blockPos) {
- return !world.getBlockState(blockPos).getBlock().getMaterial(world.getBlockState(blockPos)).isLiquid() && super.displaceIfPossible(world, blockPos);
- }
-
- @Override
- public BlockRenderLayer getBlockLayer() {
- return BlockRenderLayer.SOLID;
- }
-
- public static Fluid getLifeEssence() {
- return LIFE_ESSENCE;
- }
-
- public static class FluidLifeEssence extends Fluid {
-
- public FluidLifeEssence() {
- super("lifeEssence", new ResourceLocation(Constants.Mod.DOMAIN + "blocks/lifeEssenceStill"), new ResourceLocation(Constants.Mod.DOMAIN + "blocks/lifeEssenceFlowing"));
-
- setDensity(2000);
- setViscosity(2000);
- }
-
- @Override
- public int getColor() {
- return Color.RED.getRGB();
- }
-
- @Override
- public String getLocalizedName(FluidStack fluidStack) {
- return TextHelper.localize("tile.bloodmagic.fluid.lifeEssence.name");
- }
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockMasterRoutingNode.java b/src/main/java/WayofTime/bloodmagic/block/BlockMasterRoutingNode.java
deleted file mode 100644
index d04ab3f2..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockMasterRoutingNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public class BlockMasterRoutingNode extends BlockRoutingNode {
- public BlockMasterRoutingNode() {
- super();
-
- setUnlocalizedName(BloodMagic.MODID + ".masterRouting");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileMasterRoutingNode();
- }
-
- // @Override
-// public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
-// {
-// if (world.getTileEntity(pos) instanceof TileMasterRoutingNode)
-// {
-// player.openGui(BloodMagic.instance, Constants.Gui.MASTER_ROUTING_NODE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
-// }
-//
-// return true;
-// }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockMimic.java b/src/main/java/WayofTime/bloodmagic/block/BlockMimic.java
deleted file mode 100644
index b0feb7eb..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockMimic.java
+++ /dev/null
@@ -1,228 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.altar.ComponentType;
-import WayofTime.bloodmagic.altar.IAltarComponent;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.block.enums.EnumMimic;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
-import WayofTime.bloodmagic.tile.TileMimic;
-import WayofTime.bloodmagic.util.Utils;
-import WayofTime.bloodmagic.item.block.ItemBlockMimic;
-import net.minecraft.block.Block;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.annotation.Nullable;
-
-public class BlockMimic extends BlockEnum implements IAltarComponent {
- public static final int sentientMimicMeta = 4;
-
- public BlockMimic() {
- super(Material.ROCK, EnumMimic.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".mimic.");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
- setHarvestLevel("pickaxe", 0);
- setLightOpacity(15);
- }
-
- @Nullable
- @Override
- public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
- switch (this.getMetaFromState(state)) {
- case 1:
- case 2:
- case 3:
- case 4:
- TileMimic tileMimic = (TileMimic) world.getTileEntity(pos);
- if (tileMimic != null && !tileMimic.getStackInSlot(0).isEmpty()) {
- Block mimicBlock = Block.getBlockFromItem(tileMimic.getStackInSlot(0).getItem());
- if (mimicBlock == Blocks.AIR) {
- return FULL_BLOCK_AABB;
- }
- IBlockState mimicState = tileMimic.getReplacedState();
- if (mimicBlock != this) {
- return mimicState.getCollisionBoundingBox(world, pos);
- }
- } else {
- return FULL_BLOCK_AABB;
- }
- case 0:
- default:
- return NULL_AABB;
- }
-
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos) {
- TileMimic tileMimic = (TileMimic) world.getTileEntity(pos);
- if (tileMimic != null && !tileMimic.getStackInSlot(0).isEmpty()) {
- Block mimicBlock = Block.getBlockFromItem(tileMimic.getStackInSlot(0).getItem());
- if (mimicBlock == Blocks.AIR) {
- return FULL_BLOCK_AABB;
- }
- IBlockState mimicState = tileMimic.getReplacedState();
- if (mimicBlock != this) {
- return mimicState.getSelectedBoundingBox(world, pos);
- }
- }
-
- return FULL_BLOCK_AABB;
- }
-
- @Override
- public int getLightOpacity(IBlockState state) {
- switch (this.getMetaFromState(state)) {
- case 2:
- case 4:
- return 0;
- default:
- return this.lightOpacity;
- }
- }
-
- @Override
- public int getLightValue(IBlockState state) {
- switch (this.getMetaFromState(state)) {
- case 3:
- return 15;
- default:
- return this.lightValue;
- }
- }
-
- @Override
- public int getMetaFromState(IBlockState state) {
- if (state.getBlock() == this) {
- return super.getMetaFromState(state);
- }
-
- return state.getBlock().getMetaFromState(state);
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- TileMimic mimic = (TileMimic) world.getTileEntity(pos);
-
- return mimic != null && mimic.onBlockActivated(world, pos, state, player, hand, player.getHeldItem(hand), side);
- }
-
- @Override
- public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileMimic) {
- TileMimic mimic = (TileMimic) tile;
- ItemStack stack = mimic.getStackInSlot(0);
- if (stack.getItem() instanceof ItemBlock) {
- Block block = ((ItemBlock) stack.getItem()).getBlock();
- IBlockState mimicState = mimic.getReplacedState();
- if (block != this) {
- if (block.getRenderType(mimicState) == EnumBlockRenderType.ENTITYBLOCK_ANIMATED) {
- return RegistrarBloodMagicBlocks.BLOOD_LIGHT.getDefaultState(); //Small and invisible-ish, basically this is returned in order to not render over the animated block (TESR)
- }
-
- return block.getActualState(mimicState, world, pos);
- }
- }
- }
- return state;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
- return layer == BlockRenderLayer.CUTOUT_MIPPED || layer == BlockRenderLayer.CUTOUT;
- }
-
- @Override
- public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
- TileEntity tile = world.getTileEntity(blockPos);
- if (tile instanceof TileMimic) {
- TileMimic TileMimic = (TileMimic) world.getTileEntity(blockPos);
- if (TileMimic != null)
- TileMimic.dropItems();
- }
-
- super.breakBlock(world, blockPos, blockState);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileMimic();
- }
-
- // IAltarComponent
-
- @Nullable
- @Override
- public ComponentType getType(World world, IBlockState state, BlockPos pos) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileMimic) {
- TileMimic mimic = (TileMimic) tile;
- ItemStack stack = mimic.getStackInSlot(0);
- if (stack.getItem() instanceof ItemBlock) {
- Block block = ((ItemBlock) stack.getItem()).getBlock();
- if (block instanceof IAltarComponent) {
- return ((IAltarComponent) block).getType(world, mimic.getReplacedState(), pos);
- } else {
- for (ComponentType altarComponent : ComponentType.values())
- if (block == Utils.getBlockForComponent(altarComponent))
- return altarComponent;
- }
- }
- }
- return null;
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlockMimic(this);
- }
-
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockOutputRoutingNode.java b/src/main/java/WayofTime/bloodmagic/block/BlockOutputRoutingNode.java
deleted file mode 100644
index 5882dc30..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockOutputRoutingNode.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.util.Constants;
-import WayofTime.bloodmagic.tile.routing.TileOutputRoutingNode;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public class BlockOutputRoutingNode extends BlockRoutingNode {
- public BlockOutputRoutingNode() {
- super();
-
- setUnlocalizedName(BloodMagic.MODID + ".outputRouting");
- }
-
- @Override
- //TODO: Combine BlockOutputRoutingNode and BlockInputRoutingNode so they have the same superclass
- public void breakBlock(World world, BlockPos pos, IBlockState state) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileOutputRoutingNode) {
- ((TileOutputRoutingNode) tile).removeAllConnections();
- ((TileOutputRoutingNode) tile).dropItems();
- }
- super.breakBlock(world, pos, state);
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- if (world.getTileEntity(pos) instanceof TileOutputRoutingNode) {
- player.openGui(BloodMagic.instance, Constants.Gui.ROUTING_NODE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
- }
-
- return true;
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileOutputRoutingNode();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockPath.java b/src/main/java/WayofTime/bloodmagic/block/BlockPath.java
deleted file mode 100644
index 92fae1bf..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockPath.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.block.enums.EnumPath;
-import WayofTime.bloodmagic.incense.IIncensePath;
-import WayofTime.bloodmagic.util.helper.TextHelper;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.util.ITooltipFlag;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-import java.util.List;
-
-public class BlockPath extends BlockEnum implements IIncensePath {
-
- public BlockPath() {
- super(Material.ROCK, EnumPath.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".path.");
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.STONE);
-
- setHarvestLevel("axe", 0, getStateFromMeta(0));
- setHarvestLevel("axe", 0, getStateFromMeta(1));
- setHarvestLevel("pickaxe", 0, getStateFromMeta(2));
- setHarvestLevel("pickaxe", 0, getStateFromMeta(3));
- setHarvestLevel("pickaxe", 0, getStateFromMeta(4));
- setHarvestLevel("pickaxe", 0, getStateFromMeta(5));
- setHarvestLevel("pickaxe", 3, getStateFromMeta(6));
- setHarvestLevel("pickaxe", 3, getStateFromMeta(7));
- }
-
- @Override
- public void addInformation(ItemStack stack, World world, List tooltip, ITooltipFlag tooltipFlag) {
- tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.decoration.safe"));
- super.addInformation(stack, world, tooltip, tooltipFlag);
- }
-
- @Override
- public int getLevelOfPath(World world, BlockPos pos, IBlockState state) {
- switch (this.getMetaFromState(state)) {
- case 0:
- case 1:
- return 2;
- case 2:
- case 3:
- return 4;
- case 4:
- case 5:
- return 6;
- case 6:
- case 7:
- return 8;
- default:
- return 0;
- }
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java b/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java
deleted file mode 100644
index bb6ad64a..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.tile.TilePhantomBlock;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.annotation.Nullable;
-import java.util.Random;
-
-public class BlockPhantom extends Block implements IVariantProvider {
- public BlockPhantom() {
- super(Material.CLOTH);
-
- setUnlocalizedName(BloodMagic.MODID + ".phantom");
- setCreativeTab(BloodMagic.TAB_BM);
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public BlockRenderLayer getBlockLayer() {
- return BlockRenderLayer.TRANSLUCENT;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
- return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
- }
-
- @Override
- public int quantityDropped(Random par1Random) {
- return 0;
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TilePhantomBlock(100);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java b/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java
deleted file mode 100644
index d08eb08c..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.event.RitualEvent;
-import WayofTime.bloodmagic.iface.IBindable;
-import WayofTime.bloodmagic.ritual.imperfect.IImperfectRitualStone;
-import WayofTime.bloodmagic.ritual.Ritual;
-import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual;
-import WayofTime.bloodmagic.util.helper.RitualHelper;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.block.enums.EnumRitualController;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
-import WayofTime.bloodmagic.tile.TileImperfectRitualStone;
-import WayofTime.bloodmagic.tile.TileMasterRitualStone;
-import amerifrance.guideapi.api.IGuideLinked;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.text.TextComponentTranslation;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.World;
-import net.minecraftforge.common.MinecraftForge;
-
-import javax.annotation.Nullable;
-
-public class BlockRitualController extends BlockEnum implements IGuideLinked {
-
- public BlockRitualController() {
- super(Material.ROCK, EnumRitualController.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".stone.ritual.");
- setCreativeTab(BloodMagic.TAB_BM);
- setSoundType(SoundType.STONE);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 2);
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- ItemStack heldItem = player.getHeldItem(hand);
- TileEntity tile = world.getTileEntity(pos);
-
- if (state.getValue(getProperty()) != EnumRitualController.IMPERFECT && tile instanceof TileMasterRitualStone) {
- if (heldItem.getItem() == RegistrarBloodMagicItems.ACTIVATION_CRYSTAL) {
- if (((IBindable) heldItem.getItem()).getBinding(heldItem) == null)
- return false;
-
- String key = RitualHelper.getValidRitual(world, pos);
- if (!key.isEmpty()) {
- Ritual ritual = BloodMagic.RITUAL_MANAGER.getRitual(key);
- if (ritual != null) {
- EnumFacing direction = RitualHelper.getDirectionOfRitual(world, pos, ritual);
- // TODO: Give a message stating that this ritual is not a valid ritual.
- if (direction != null && RitualHelper.checkValidRitual(world, pos, ritual, direction)) {
- if (((TileMasterRitualStone) tile).activateRitual(heldItem, player, BloodMagic.RITUAL_MANAGER.getRitual(key))) {
- ((TileMasterRitualStone) tile).setDirection(direction);
- if (state.getValue(getProperty()) == EnumRitualController.INVERTED)
- ((TileMasterRitualStone) tile).setInverted(true);
- }
- } else {
- player.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.notValid"), true);
- }
- } else {
- player.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.notValid"), true);
- }
- } else {
- player.sendStatusMessage(new TextComponentTranslation("chat.bloodmagic.ritual.notValid"), true);
- }
- }
- } else if (state.getValue(getProperty()) == EnumRitualController.IMPERFECT && tile instanceof TileImperfectRitualStone) {
- IBlockState ritualBlock = world.getBlockState(pos.up());
- ImperfectRitual ritual = BloodMagic.RITUAL_MANAGER.getImperfectRitual(ritualBlock);
- if (ritual == null)
- return false;
-
- RitualEvent.ImperfectRitualActivatedEvent event = new RitualEvent.ImperfectRitualActivatedEvent((IImperfectRitualStone) tile, player, ritual);
- return !MinecraftForge.EVENT_BUS.post(event) && ((TileImperfectRitualStone) tile).performRitual(world, pos, ritual, player);
- }
-
- return false;
- }
-
- @Override
- public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
- TileEntity tile = world.getTileEntity(pos);
-
- if (getMetaFromState(state) == 0 && tile instanceof TileMasterRitualStone)
- ((TileMasterRitualStone) tile).stopRitual(Ritual.BreakType.BREAK_MRS);
- }
-
- @Override
- public void onBlockDestroyedByExplosion(World world, BlockPos pos, Explosion explosion) {
- TileEntity tile = world.getTileEntity(pos);
-
- if (tile instanceof TileMasterRitualStone)
- ((TileMasterRitualStone) tile).stopRitual(Ritual.BreakType.EXPLOSION);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return state.getValue(getProperty()) != EnumRitualController.IMPERFECT ? new TileMasterRitualStone() : new TileImperfectRitualStone();
- }
-
- // IGuideLinked
-
- @Override
- @Nullable
- public ResourceLocation getLinkedEntry(World world, BlockPos pos, EntityPlayer player, ItemStack stack) {
- IBlockState state = world.getBlockState(pos);
- if (state.getValue(getProperty()).equals(EnumRitualController.MASTER)) {
- TileMasterRitualStone mrs = (TileMasterRitualStone) world.getTileEntity(pos);
- if (mrs == null || mrs.getCurrentRitual() == null)
- return null;
- else
- return new ResourceLocation("bloodmagic", "ritual_" + mrs.getCurrentRitual().getName());
- } else if (state.getValue(getProperty()).equals(EnumRitualController.IMPERFECT)) {
- ImperfectRitual imperfectRitual = BloodMagic.RITUAL_MANAGER.getImperfectRitual(world.getBlockState(pos.up()));
- if (imperfectRitual != null)
- return new ResourceLocation("bloodmagic", "ritual_" + imperfectRitual.getName());
- }
- return null;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java b/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java
deleted file mode 100644
index 905c8810..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.ritual.EnumRuneType;
-import WayofTime.bloodmagic.ritual.IRitualStone;
-import WayofTime.bloodmagic.block.base.BlockEnum;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
-import WayofTime.bloodmagic.util.helper.TextHelper;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.util.ITooltipFlag;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import java.util.List;
-
-public class BlockRitualStone extends BlockEnum implements IRitualStone {
- public BlockRitualStone() {
- super(Material.IRON, EnumRuneType.class);
-
- setUnlocalizedName(BloodMagic.MODID + ".ritualStone.");
- setCreativeTab(BloodMagic.TAB_BM);
- setSoundType(SoundType.STONE);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 2);
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void addInformation(ItemStack stack, World world, List tooltip, ITooltipFlag tooltipFlag) {
- tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.decoration.safe"));
- super.addInformation(stack, world, tooltip, tooltipFlag);
- }
-
- @Override
- public int damageDropped(IBlockState state) {
- return 0;
- }
-
- @Override
- public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) {
- return false;
- }
-
- @Override
- public boolean isRuneType(World world, BlockPos pos, EnumRuneType runeType) {
- return runeType == this.getTypes()[getMetaFromState(world.getBlockState(pos))];
- }
-
- @Override
- public void setRuneType(World world, BlockPos pos, EnumRuneType runeType) {
- int meta = runeType.ordinal();
- IBlockState newState = RegistrarBloodMagicBlocks.RITUAL_STONE.getStateFromMeta(meta);
- world.setBlockState(pos, newState);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockRoutingNode.java b/src/main/java/WayofTime/bloodmagic/block/BlockRoutingNode.java
deleted file mode 100644
index bb26cf20..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockRoutingNode.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
-import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyBool;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import javax.annotation.Nonnull;
-
-public class BlockRoutingNode extends Block implements IBMBlock, IVariantProvider {
- public static final PropertyBool UP = PropertyBool.create("up");
- public static final PropertyBool DOWN = PropertyBool.create("down");
- public static final PropertyBool NORTH = PropertyBool.create("north");
- public static final PropertyBool EAST = PropertyBool.create("east");
- public static final PropertyBool SOUTH = PropertyBool.create("south");
- public static final PropertyBool WEST = PropertyBool.create("west");
- protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.378F, 0.378F, 0.378F, 0.625F, 0.625F, 0.625F);
-
- public BlockRoutingNode() {
- super(Material.ROCK);
-
- setCreativeTab(BloodMagic.TAB_BM);
- setHardness(2.0F);
- setResistance(5.0F);
- setHarvestLevel("pickaxe", 2);
-
- this.setDefaultState(this.blockState.getBaseState().withProperty(DOWN, false).withProperty(UP, false).withProperty(NORTH, false).withProperty(EAST, false).withProperty(SOUTH, false).withProperty(WEST, false));
- }
-
- @Override
- public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
- return true;
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
- return AABB;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
- return layer == BlockRenderLayer.CUTOUT_MIPPED || layer == BlockRenderLayer.TRANSLUCENT;
- }
-
- @Override
- public IBlockState getStateFromMeta(int meta) {
- return this.getDefaultState();
- }
-
- /**
- * Convert the BlockState into the correct metadata value
- */
- @Override
- public int getMetaFromState(IBlockState state) {
- return 0;
- }
-
- @Override
- public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
- return state.withProperty(UP, this.shouldConnect(state, worldIn, pos.up(), EnumFacing.DOWN)).withProperty(DOWN, this.shouldConnect(state, worldIn, pos.down(), EnumFacing.UP)).withProperty(NORTH, this.shouldConnect(state, worldIn, pos.north(), EnumFacing.SOUTH)).withProperty(EAST, this.shouldConnect(state, worldIn, pos.east(), EnumFacing.WEST)).withProperty(SOUTH, this.shouldConnect(state, worldIn, pos.south(), EnumFacing.NORTH)).withProperty(WEST, this.shouldConnect(state, worldIn, pos.west(), EnumFacing.EAST));
- }
-
- @Override
- protected BlockStateContainer createBlockState() {
- return new BlockStateContainer(this, UP, DOWN, NORTH, EAST, WEST, SOUTH);
- }
-
- public boolean shouldConnect(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing attachedSide) {
- IBlockState blockState = world.getBlockState(pos);
- Block block = blockState.getBlock();
- return block.getMaterial(blockState).isOpaque() && blockState.isFullCube();
- }
-
- @Override
- public void breakBlock(World world, BlockPos pos, IBlockState blockState) {
- if (!world.isRemote) {
- TileEntity tile = world.getTileEntity(pos);
- if (tile instanceof TileRoutingNode) {
- ((TileRoutingNode) tile).removeAllConnections();
- } else if (tile instanceof TileMasterRoutingNode) {
- ((TileMasterRoutingNode) tile).removeAllConnections();
- }
- }
-
- super.breakBlock(world, pos, blockState);
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlock(this);
- }
-
- @Override
- public void gatherVariants(@Nonnull Int2ObjectMap variants) {
- variants.put(0, "inventory");
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java b/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java
deleted file mode 100644
index 4f93536b..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.tile.TileSoulForge;
-import WayofTime.bloodmagic.util.Constants;
-import net.minecraft.block.Block;
-import net.minecraft.block.SoundType;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import javax.annotation.Nullable;
-
-public class BlockSoulForge extends Block implements IVariantProvider, IBMBlock {
- protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.06F, 0.0F, 0.06F, 0.94F, 0.75F, 0.94F);
-
- public BlockSoulForge() {
- super(Material.IRON);
-
- setUnlocalizedName(BloodMagic.MODID + ".soulForge");
- setHardness(2.0F);
- setResistance(5.0F);
- setSoundType(SoundType.METAL);
- setHarvestLevel("pickaxe", 1);
- setCreativeTab(BloodMagic.TAB_BM);
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
- return AABB;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- if (world.getTileEntity(pos) instanceof TileSoulForge)
- player.openGui(BloodMagic.instance, Constants.Gui.SOUL_FORGE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
-
- return true;
- }
-
- @Override
- public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
- TileSoulForge tileSoulForge = (TileSoulForge) world.getTileEntity(blockPos);
- if (tileSoulForge != null)
- tileSoulForge.dropItems();
-
- super.breakBlock(world, blockPos, blockState);
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileSoulForge();
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlock(this);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java b/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java
deleted file mode 100644
index 6802804b..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.ConfigHandler;
-import WayofTime.bloodmagic.tile.TileSpectralBlock;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.BlockRenderLayer;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.annotation.Nullable;
-import java.util.List;
-import java.util.Random;
-
-public class BlockSpectral extends Block {
- protected static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
-
- public BlockSpectral() {
- super(Material.CLOTH);
-
- setUnlocalizedName(BloodMagic.MODID + ".spectral");
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
- return AABB;
- }
-
- @Override
- public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean causesSuffocation(IBlockState state) {
- return false;
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public BlockRenderLayer getBlockLayer() {
- return BlockRenderLayer.TRANSLUCENT;
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return ConfigHandler.client.invisibleSpectralBlocks ? EnumBlockRenderType.INVISIBLE : EnumBlockRenderType.MODEL;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
- return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
- }
-
- @Override
- public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List list, Entity collidingEntity, boolean bool) {
- }
-
- @Override
- public int quantityDropped(Random par1Random) {
- return 0;
- }
-
- @Override
- public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos) {
- return true;
- }
-
- @Override
- public boolean isAir(IBlockState state, IBlockAccess world, BlockPos blockPos) {
- return true;
- }
-
- @Override
- public boolean hasTileEntity(IBlockState state) {
- return true;
- }
-
- @Nullable
- @Override
- public TileEntity createTileEntity(World world, IBlockState state) {
- return new TileSpectralBlock();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockTeleposer.java b/src/main/java/WayofTime/bloodmagic/block/BlockTeleposer.java
deleted file mode 100644
index 22fb0307..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/BlockTeleposer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.item.ItemTelepositionFocus;
-import WayofTime.bloodmagic.tile.TileTeleposer;
-import WayofTime.bloodmagic.util.Constants;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class BlockTeleposer extends BlockContainer implements IVariantProvider, IBMBlock {
- public BlockTeleposer() {
- super(Material.ROCK);
-
- setCreativeTab(BloodMagic.TAB_BM);
- setUnlocalizedName(BloodMagic.MODID + ".teleposer");
- setHardness(2.0F);
- setResistance(5.0F);
- }
-
- @Override
- public EnumBlockRenderType getRenderType(IBlockState state) {
- return EnumBlockRenderType.MODEL;
- }
-
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
- ItemStack playerItem = player.getHeldItem(hand);
-
- if (playerItem.getItem() instanceof ItemTelepositionFocus)
- ((ItemTelepositionFocus) playerItem.getItem()).setBlockPos(playerItem, world, pos);
- else if (world.getTileEntity(pos) instanceof TileTeleposer)
- player.openGui(BloodMagic.instance, Constants.Gui.TELEPOSER_GUI, world, pos.getX(), pos.getY(), pos.getZ());
-
- return true;
- }
-
- @Override
- public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
- TileTeleposer tileTeleposer = (TileTeleposer) world.getTileEntity(blockPos);
- if (tileTeleposer != null)
- tileTeleposer.dropItems();
-
- super.breakBlock(world, blockPos, blockState);
- }
-
- @Override
- public TileEntity createNewTileEntity(World worldIn, int meta) {
- return new TileTeleposer();
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlock(this);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/IBMBlock.java b/src/main/java/WayofTime/bloodmagic/block/IBMBlock.java
deleted file mode 100644
index 7dd5b818..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/IBMBlock.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package WayofTime.bloodmagic.block;
-
-import net.minecraft.item.ItemBlock;
-
-public interface IBMBlock {
-
- ItemBlock getItem();
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnum.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnum.java
deleted file mode 100644
index 0734740e..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnum.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package WayofTime.bloodmagic.block.base;
-
-import WayofTime.bloodmagic.block.IBMBlock;
-import WayofTime.bloodmagic.client.IVariantProvider;
-import WayofTime.bloodmagic.item.block.base.ItemBlockEnum;
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyEnum;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IStringSerializable;
-import net.minecraft.util.NonNullList;
-
-import javax.annotation.Nonnull;
-
-public class BlockEnum & IStringSerializable> extends Block implements IBMBlock, IVariantProvider {
- private final E[] types;
- private final PropertyEnum property;
- private final BlockStateContainer realStateContainer;
-
- public BlockEnum(Material material, Class enumClass, String propName) {
- super(material);
-
- this.types = enumClass.getEnumConstants();
- this.property = PropertyEnum.create(propName, enumClass);
- this.realStateContainer = createStateContainer();
- setDefaultState(getBlockState().getBaseState());
- }
-
- public BlockEnum(Material material, Class enumClass) {
- this(material, enumClass, "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 state.getValue(property).ordinal();
- }
-
- @Override
- public int damageDropped(IBlockState state) {
- return getMetaFromState(state);
- }
-
- @Override
- public void getSubBlocks(CreativeTabs tab, NonNullList subBlocks) {
- for (E type : types)
- subBlocks.add(new ItemStack(this, 1, type.ordinal()));
- }
-
- protected BlockStateContainer createStateContainer() {
- return new BlockStateContainer.Builder(this).add(property).build();
- }
-
- @Override
- public ItemBlock getItem() {
- return new ItemBlockEnum<>(this);
- }
-
- @Override
- public void gatherVariants(@Nonnull Int2ObjectMap variants) {
- if (getItem() == null)
- return;
-
- for (int i = 0; i < types.length; i++)
- variants.put(i, getProperty().getName() + "=" + types[i].name());
- }
-
- public E[] getTypes() {
- return types;
- }
-
- public PropertyEnum getProperty() {
- return property;
- }
-
- public BlockStateContainer getRealStateContainer() {
- return realStateContainer;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillar.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillar.java
deleted file mode 100644
index 418c8de7..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillar.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package WayofTime.bloodmagic.block.base;
-
-import net.minecraft.block.BlockRotatedPillar;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.IProperty;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.IStringSerializable;
-import net.minecraft.util.Rotation;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.RayTraceResult;
-import net.minecraft.world.World;
-import org.apache.commons.lang3.ArrayUtils;
-
-public class BlockEnumPillar & IStringSerializable> extends BlockEnum {
- public BlockEnumPillar(Material material, Class enumClass, String propName) {
- super(material, enumClass, propName);
- }
-
- public BlockEnumPillar(Material material, Class enumClass) {
- this(material, enumClass, "type");
- }
-
- @Override
- protected BlockStateContainer createStateContainer() {
- return new BlockStateContainer.Builder(this).add(getProperty(), BlockRotatedPillar.AXIS).build();
- }
-
- @Override
- public IBlockState getStateFromMeta(int meta) {
- IBlockState state = getBlockState().getBaseState().withProperty(this.getProperty(), getTypes()[meta % 5]);
-
- switch (meta / 5) {
- case 0:
- state = state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.Y);
- break;
- case 1:
- state = state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.X);
- break;
- case 2:
- state = state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.Z);
- break;
- default:
- state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.Y);
- break;
- }
-
- return state;
- }
-
- @Override
- public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
- return new ItemStack(this, 1, damageDropped(state));
- }
-
- @SuppressWarnings("incomplete-switch")
- @Override
- public int getMetaFromState(IBlockState state) {
- int i = ArrayUtils.indexOf(getTypes(), state.getValue(getProperty()));
-
- switch (state.getValue(BlockRotatedPillar.AXIS)) {
- case X:
- i = i + 5;
- break;
- case Z:
- i = i + 10;
- break;
- }
-
- return i;
- }
-
- @Override
- public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
- IBlockState state = world.getBlockState(pos);
- for (IProperty> prop : state.getProperties().keySet()) {
- if (prop == BlockRotatedPillar.AXIS) {
- world.setBlockState(pos, state.cycleProperty(prop));
- return true;
- }
- }
- return false;
- }
-
- @Override
- public IBlockState withRotation(IBlockState state, Rotation rot) {
- switch (rot) {
- case COUNTERCLOCKWISE_90:
- case CLOCKWISE_90:
- switch (state.getValue(BlockRotatedPillar.AXIS)) {
- case X:
- return state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.Z);
- case Z:
- return state.withProperty(BlockRotatedPillar.AXIS, EnumFacing.Axis.X);
- default:
- return state;
- }
-
- default:
- return state;
- }
- }
-
- @Override
- protected ItemStack getSilkTouchDrop(IBlockState state) {
- return new ItemStack(this, 1, damageDropped(state));
- }
-
-
- @Override
- public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
- return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(BlockRotatedPillar.AXIS, facing.getAxis());
- }
-
- @Override
- public int damageDropped(IBlockState state) {
- return super.getMetaFromState(state);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillarCap.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillarCap.java
deleted file mode 100644
index 365dd875..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillarCap.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package WayofTime.bloodmagic.block.base;
-
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyDirection;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.*;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.RayTraceResult;
-import net.minecraft.world.World;
-import org.apache.commons.lang3.ArrayUtils;
-
-public class BlockEnumPillarCap & IStringSerializable> extends BlockEnum {
- public static final PropertyDirection FACING = PropertyDirection.create("facing");
-
- public BlockEnumPillarCap(Material material, Class enumClass, String propName) {
- super(material, enumClass, propName);
- }
-
- public BlockEnumPillarCap(Material material, Class enumClass) {
- this(material, enumClass, "type");
- }
-
- @Override
- protected BlockStateContainer createStateContainer() {
- return new BlockStateContainer.Builder(this).add(getProperty(), FACING).build();
- }
-
- @Override
- public IBlockState getStateFromMeta(int meta) {
- IBlockState state = getBlockState().getBaseState().withProperty(this.getProperty(), getTypes()[meta % 2]);
- return state.withProperty(FACING, EnumFacing.getFront(meta / 2));
- }
-
- @Override
- public int getMetaFromState(IBlockState state) {
- int i = ArrayUtils.indexOf(getTypes(), state.getValue(getProperty()));
- return i + 2 * state.getValue(FACING).getIndex();
- }
-
- @Override
- public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
- return new ItemStack(this, 1, damageDropped(state));
- }
-
- @Override
- public IBlockState withRotation(IBlockState state, Rotation rot) {
- return state.withProperty(FACING, rot.rotate(state.getValue(FACING)));
- }
-
- @Override
- public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
- return state.withRotation(mirrorIn.toRotation(state.getValue(FACING)));
- }
-
- @Override
- protected ItemStack getSilkTouchDrop(IBlockState state) {
- return new ItemStack(this, 1, damageDropped(state));
- }
-
- @Override
- public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
- return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(FACING, facing);
- }
-
- @Override
- public int damageDropped(IBlockState state) {
- return super.getMetaFromState(state);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java
deleted file mode 100644
index 7a0203c4..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java
+++ /dev/null
@@ -1,343 +0,0 @@
-package WayofTime.bloodmagic.block.base;
-
-import com.google.common.collect.Lists;
-import net.minecraft.block.BlockHorizontal;
-import net.minecraft.block.BlockStairs;
-import net.minecraft.block.BlockStairs.EnumHalf;
-import net.minecraft.block.BlockStairs.EnumShape;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyDirection;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.*;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.RayTraceResult;
-import net.minecraft.util.math.Vec3d;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.ForgeModContainer;
-import org.apache.commons.lang3.ArrayUtils;
-
-import javax.annotation.Nullable;
-import java.util.List;
-
-public class BlockEnumStairs & IStringSerializable> extends BlockEnum {
- public static final PropertyDirection FACING = BlockHorizontal.FACING;
-
- protected static final AxisAlignedBB AABB_SLAB_TOP = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 1.0D, 1.0D, 1.0D);
- protected static final AxisAlignedBB AABB_QTR_TOP_WEST = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 0.5D, 1.0D, 1.0D);
- protected static final AxisAlignedBB AABB_QTR_TOP_EAST = new AxisAlignedBB(0.5D, 0.5D, 0.0D, 1.0D, 1.0D, 1.0D);
- protected static final AxisAlignedBB AABB_QTR_TOP_NORTH = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 1.0D, 1.0D, 0.5D);
- protected static final AxisAlignedBB AABB_QTR_TOP_SOUTH = new AxisAlignedBB(0.0D, 0.5D, 0.5D, 1.0D, 1.0D, 1.0D);
- protected static final AxisAlignedBB AABB_OCT_TOP_NW = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 0.5D, 1.0D, 0.5D);
- protected static final AxisAlignedBB AABB_OCT_TOP_NE = new AxisAlignedBB(0.5D, 0.5D, 0.0D, 1.0D, 1.0D, 0.5D);
- protected static final AxisAlignedBB AABB_OCT_TOP_SW = new AxisAlignedBB(0.0D, 0.5D, 0.5D, 0.5D, 1.0D, 1.0D);
- protected static final AxisAlignedBB AABB_OCT_TOP_SE = new AxisAlignedBB(0.5D, 0.5D, 0.5D, 1.0D, 1.0D, 1.0D);
- protected static final AxisAlignedBB AABB_SLAB_BOTTOM = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.5D, 1.0D);
- protected static final AxisAlignedBB AABB_QTR_BOT_WEST = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.5D, 0.5D, 1.0D);
- protected static final AxisAlignedBB AABB_QTR_BOT_EAST = new AxisAlignedBB(0.5D, 0.0D, 0.0D, 1.0D, 0.5D, 1.0D);
- protected static final AxisAlignedBB AABB_QTR_BOT_NORTH = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.5D, 0.5D);
- protected static final AxisAlignedBB AABB_QTR_BOT_SOUTH = new AxisAlignedBB(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D);
- protected static final AxisAlignedBB AABB_OCT_BOT_NW = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.5D, 0.5D, 0.5D);
- protected static final AxisAlignedBB AABB_OCT_BOT_NE = new AxisAlignedBB(0.5D, 0.0D, 0.0D, 1.0D, 0.5D, 0.5D);
- protected static final AxisAlignedBB AABB_OCT_BOT_SW = new AxisAlignedBB(0.0D, 0.0D, 0.5D, 0.5D, 0.5D, 1.0D);
- protected static final AxisAlignedBB AABB_OCT_BOT_SE = new AxisAlignedBB(0.5D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D);
-
- public BlockEnumStairs(Material material, Class enumClass, String propName) {
- super(material, enumClass, propName);
- }
-
- public BlockEnumStairs(Material material, Class enumClass) {
- this(material, enumClass, "type");
- }
-
- @Override
- protected BlockStateContainer createStateContainer() {
- return new BlockStateContainer.Builder(this).add(getProperty(), FACING, BlockStairs.HALF, BlockStairs.SHAPE).build();
- }
-
- @Override
- public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List collidingBoxes, @Nullable Entity entityIn, boolean bool) {
- state = this.getActualState(state, worldIn, pos);
-
- for (AxisAlignedBB axisalignedbb : getCollisionBoxList(state)) {
- addCollisionBoxToList(pos, entityBox, collidingBoxes, axisalignedbb);
- }
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- @Override
- public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
- IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand);
- state = state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.STRAIGHT);
- return facing != EnumFacing.DOWN && (facing == EnumFacing.UP || (double) hitY <= 0.5D) ? state.withProperty(BlockStairs.HALF, BlockStairs.EnumHalf.BOTTOM) : state.withProperty(BlockStairs.HALF, BlockStairs.EnumHalf.TOP);
- }
-
- @Override
- public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
- List list = Lists.newArrayList();
-
- for (AxisAlignedBB axisalignedbb : getCollisionBoxList(this.getActualState(blockState, worldIn, pos))) {
- list.add(this.rayTrace(pos, start, end, axisalignedbb));
- }
-
- RayTraceResult rayTrace = null;
- double d1 = 0.0D;
-
- for (RayTraceResult raytraceresult : list) {
- if (raytraceresult != null) {
- double d0 = raytraceresult.hitVec.squareDistanceTo(end);
-
- if (d0 > d1) {
- rayTrace = raytraceresult;
- d1 = d0;
- }
- }
- }
-
- return rayTrace;
- }
-
- // Meta looks like: {1|11|1} = {HALF|FACING|TYPE}
- @Override
- public IBlockState getStateFromMeta(int meta) {
- IBlockState state = getBlockState().getBaseState().withProperty(BlockStairs.HALF, (meta & 8) > 0 ? BlockStairs.EnumHalf.TOP : BlockStairs.EnumHalf.BOTTOM);
- state = state.withProperty(FACING, EnumFacing.getFront(5 - (meta & 6) / 2)).withProperty(this.getProperty(), getTypes()[meta % 2]);
- return state;
- }
-
- // Meta looks like: {1|11|1} = {HALF|FACING|TYPE}
- @Override
- public int getMetaFromState(IBlockState state) {
- int i = 0;
-
- if (state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP) {
- i |= 4;
- }
-
- i = i | 5 - state.getValue(FACING).getIndex();
- return i * 2 + ArrayUtils.indexOf(getTypes(), state.getValue(getProperty()));
- }
-
- @Override
- public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
- return state.withProperty(BlockStairs.SHAPE, getStairsShape(state, worldIn, pos));
- }
-
- @Override
- public IBlockState withRotation(IBlockState state, Rotation rot) {
- return state.withProperty(FACING, rot.rotate(state.getValue(FACING)));
- }
-
- @SuppressWarnings("incomplete-switch")
- @Override
- public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
- EnumFacing facing = state.getValue(FACING);
- BlockStairs.EnumShape stairShape = state.getValue(BlockStairs.SHAPE);
-
- switch (mirrorIn) {
- case LEFT_RIGHT:
-
- if (facing.getAxis() == EnumFacing.Axis.Z) {
- switch (stairShape) {
- case OUTER_LEFT:
- return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.OUTER_RIGHT);
- case OUTER_RIGHT:
- return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.OUTER_LEFT);
- case INNER_RIGHT:
- return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.INNER_LEFT);
- case INNER_LEFT:
- return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.INNER_RIGHT);
- default:
- return state.withRotation(Rotation.CLOCKWISE_180);
- }
- }
-
- break;
- case FRONT_BACK:
-
- if (facing.getAxis() == EnumFacing.Axis.X) {
- switch (stairShape) {
- case OUTER_LEFT:
- return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.OUTER_RIGHT);
- case OUTER_RIGHT:
- return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.OUTER_LEFT);
- case INNER_RIGHT:
- return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.INNER_RIGHT);
- case INNER_LEFT:
- return state.withRotation(Rotation.CLOCKWISE_180).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.INNER_LEFT);
- case STRAIGHT:
- return state.withRotation(Rotation.CLOCKWISE_180);
- }
- }
- }
-
- return super.withMirror(state, mirrorIn);
- }
-
- @Override
- protected ItemStack getSilkTouchDrop(IBlockState state) {
- return new ItemStack(this, 1, damageDropped(state));
- }
-
- @Override
- public int damageDropped(IBlockState state) {
- return super.getMetaFromState(state);
- }
-
- @Override
- public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
- return new ItemStack(this, 1, damageDropped(state));
- }
-
- @Override
- public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) {
- if (ForgeModContainer.disableStairSlabCulling)
- return super.doesSideBlockRendering(state, world, pos, face);
-
- if (state.isOpaqueCube())
- return true;
-
- state = this.getActualState(state, world, pos);
-
- EnumHalf half = state.getValue(BlockStairs.HALF);
- EnumFacing side = state.getValue(FACING);
- EnumShape shape = state.getValue(BlockStairs.SHAPE);
- if (face == EnumFacing.UP)
- return half == EnumHalf.TOP;
- if (face == EnumFacing.DOWN)
- return half == EnumHalf.BOTTOM;
- if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT)
- return false;
- if (face == side)
- return true;
- if (shape == EnumShape.INNER_LEFT && face.rotateY() == side)
- return true;
- if (shape == EnumShape.INNER_RIGHT && face.rotateYCCW() == side)
- return true;
- return false;
- }
-
- private static List getCollisionBoxList(IBlockState state) {
- List list = Lists.newArrayList();
- boolean flag = state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
- list.add(flag ? AABB_SLAB_TOP : AABB_SLAB_BOTTOM);
- BlockStairs.EnumShape stairShape = state.getValue(BlockStairs.SHAPE);
-
- if (stairShape == BlockStairs.EnumShape.STRAIGHT || stairShape == BlockStairs.EnumShape.INNER_LEFT || stairShape == BlockStairs.EnumShape.INNER_RIGHT) {
- list.add(getCollQuarterBlock(state));
- }
-
- if (stairShape != BlockStairs.EnumShape.STRAIGHT) {
- list.add(getCollEighthBlock(state));
- }
-
- return list;
- }
-
- private static AxisAlignedBB getCollQuarterBlock(IBlockState state) {
- boolean flag = state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
-
- switch (state.getValue(FACING)) {
- case NORTH:
- default:
- return flag ? AABB_QTR_BOT_NORTH : AABB_QTR_TOP_NORTH;
- case SOUTH:
- return flag ? AABB_QTR_BOT_SOUTH : AABB_QTR_TOP_SOUTH;
- case WEST:
- return flag ? AABB_QTR_BOT_WEST : AABB_QTR_TOP_WEST;
- case EAST:
- return flag ? AABB_QTR_BOT_EAST : AABB_QTR_TOP_EAST;
- }
- }
-
- private static AxisAlignedBB getCollEighthBlock(IBlockState state) {
- EnumFacing facing = state.getValue(FACING);
- EnumFacing newFacing;
-
- switch (state.getValue(BlockStairs.SHAPE)) {
- case OUTER_LEFT:
- default:
- newFacing = facing;
- break;
- case OUTER_RIGHT:
- newFacing = facing.rotateY();
- break;
- case INNER_RIGHT:
- newFacing = facing.getOpposite();
- break;
- case INNER_LEFT:
- newFacing = facing.rotateYCCW();
- }
-
- boolean isTop = state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP;
-
- switch (newFacing) {
- case NORTH:
- default:
- return isTop ? AABB_OCT_BOT_NW : AABB_OCT_TOP_NW;
- case SOUTH:
- return isTop ? AABB_OCT_BOT_SE : AABB_OCT_TOP_SE;
- case WEST:
- return isTop ? AABB_OCT_BOT_SW : AABB_OCT_TOP_SW;
- case EAST:
- return isTop ? AABB_OCT_BOT_NE : AABB_OCT_TOP_NE;
- }
- }
-
- private static BlockStairs.EnumShape getStairsShape(IBlockState state, IBlockAccess world, BlockPos pos) {
- EnumFacing facing = state.getValue(FACING);
- IBlockState offsetState = world.getBlockState(pos.offset(facing));
-
- if (isBlockStairs(offsetState) && state.getValue(BlockStairs.HALF) == offsetState.getValue(BlockStairs.HALF)) {
- EnumFacing offsetFacing = offsetState.getValue(FACING);
-
- if (offsetFacing.getAxis() != state.getValue(FACING).getAxis() && isDifferentStairs(state, world, pos, offsetFacing.getOpposite())) {
- if (offsetFacing == facing.rotateYCCW()) {
- return BlockStairs.EnumShape.OUTER_LEFT;
- }
-
- return BlockStairs.EnumShape.OUTER_RIGHT;
- }
- }
-
- IBlockState oppositeOffsetState = world.getBlockState(pos.offset(facing.getOpposite()));
-
- if (isBlockStairs(oppositeOffsetState) && state.getValue(BlockStairs.HALF) == oppositeOffsetState.getValue(BlockStairs.HALF)) {
- EnumFacing oppositeOffsetFacing = oppositeOffsetState.getValue(FACING);
-
- if (oppositeOffsetFacing.getAxis() != (state.getValue(FACING)).getAxis() && isDifferentStairs(state, world, pos, oppositeOffsetFacing)) {
- if (oppositeOffsetFacing == facing.rotateYCCW()) {
- return BlockStairs.EnumShape.INNER_LEFT;
- }
-
- return BlockStairs.EnumShape.INNER_RIGHT;
- }
- }
-
- return BlockStairs.EnumShape.STRAIGHT;
- }
-
- private static boolean isDifferentStairs(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing facing) {
- IBlockState offsetState = world.getBlockState(pos.offset(facing));
- return !isBlockStairs(offsetState) || offsetState.getValue(FACING) != state.getValue(FACING) || offsetState.getValue(BlockStairs.HALF) != state.getValue(BlockStairs.HALF);
- }
-
- public static boolean isBlockStairs(IBlockState state) {
- return state.getBlock() instanceof BlockStairs || state.getBlock() instanceof BlockEnumStairs;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumWall.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumWall.java
deleted file mode 100644
index 325689e6..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumWall.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package WayofTime.bloodmagic.block.base;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockFenceGate;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyBool;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.IStringSerializable;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.IBlockAccess;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-public class BlockEnumWall & IStringSerializable> extends BlockEnum {
- public static final PropertyBool UP = PropertyBool.create("up");
- public static final PropertyBool NORTH = PropertyBool.create("north");
- public static final PropertyBool EAST = PropertyBool.create("east");
- public static final PropertyBool SOUTH = PropertyBool.create("south");
- public static final PropertyBool WEST = PropertyBool.create("west");
- protected static final AxisAlignedBB[] AABB_BY_INDEX = new AxisAlignedBB[]{new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.3125D, 0.0D, 0.0D, 0.6875D, 0.875D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D),
- new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.3125D, 1.0D, 0.875D, 0.6875D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D)};
- protected static final AxisAlignedBB[] CLIP_AABB_BY_INDEX = new AxisAlignedBB[]{AABB_BY_INDEX[0].setMaxY(1.5D), AABB_BY_INDEX[1].setMaxY(1.5D), AABB_BY_INDEX[2].setMaxY(1.5D), AABB_BY_INDEX[3].setMaxY(1.5D), AABB_BY_INDEX[4].setMaxY(1.5D), AABB_BY_INDEX[5].setMaxY(1.5D), AABB_BY_INDEX[6].setMaxY(1.5D), AABB_BY_INDEX[7].setMaxY(1.5D), AABB_BY_INDEX[8].setMaxY(1.5D), AABB_BY_INDEX[9].setMaxY(1.5D), AABB_BY_INDEX[10].setMaxY(1.5D), AABB_BY_INDEX[11].setMaxY(1.5D), AABB_BY_INDEX[12].setMaxY(1.5D), AABB_BY_INDEX[13].setMaxY(1.5D), AABB_BY_INDEX[14].setMaxY(1.5D),
- AABB_BY_INDEX[15].setMaxY(1.5D)};
-
- // Most of this is copied from BlockWall - if there is an issue when porting, look there first.
- public BlockEnumWall(Material material, Class enumClass, String propName) {
- super(material, enumClass, propName);
- }
-
- public BlockEnumWall(Material material, Class enumClass) {
- this(material, enumClass, "type");
- }
-
- @Override
- protected BlockStateContainer createStateContainer() {
- return new BlockStateContainer.Builder(this).add(getProperty(), UP, NORTH, EAST, SOUTH, WEST).build();
- }
-
- @Override
- public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
- state = state.getActualState(source, pos);
- return AABB_BY_INDEX[getAABBIndex(state)];
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) {
- blockState = blockState.getActualState(worldIn, pos);
- return CLIP_AABB_BY_INDEX[getAABBIndex(blockState)];
- }
-
- public boolean isFullCube(IBlockState state) {
- return false;
- }
-
- public boolean isPassable(IBlockAccess worldIn, BlockPos pos) {
- return false;
- }
-
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
-
- private boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
- IBlockState worldState = worldIn.getBlockState(pos);
- Block block = worldState.getBlock();
- return block != Blocks.BARRIER && (!(block != this && !(block instanceof BlockFenceGate)) || ((worldState.getMaterial().isOpaque() && worldState.isFullCube()) && worldState.getMaterial() != Material.GOURD));
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
- return side != EnumFacing.DOWN || super.shouldSideBeRendered(blockState, blockAccess, pos, side);
- }
-
- @Override
- public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
- boolean canNorth = this.canConnectTo(worldIn, pos.north());
- boolean canEast = this.canConnectTo(worldIn, pos.east());
- boolean canSouth = this.canConnectTo(worldIn, pos.south());
- boolean canWest = this.canConnectTo(worldIn, pos.west());
- boolean flag4 = canNorth && !canEast && canSouth && !canWest || !canNorth && canEast && !canSouth && canWest;
- return state.withProperty(UP, !flag4 || !worldIn.isAirBlock(pos.up())).withProperty(NORTH, canNorth).withProperty(EAST, canEast).withProperty(SOUTH, canSouth).withProperty(WEST, canWest);
- }
-
- @Override
- protected ItemStack getSilkTouchDrop(IBlockState state) {
- return new ItemStack(this, 1, damageDropped(state));
- }
-
- @Override
- public int damageDropped(IBlockState state) {
- return super.getMetaFromState(state);
- }
-
- private static int getAABBIndex(IBlockState state) {
- int i = 0;
-
- if (state.getValue(NORTH)) {
- i |= 1 << EnumFacing.NORTH.getHorizontalIndex();
- }
-
- if (state.getValue(EAST)) {
- i |= 1 << EnumFacing.EAST.getHorizontalIndex();
- }
-
- if (state.getValue(SOUTH)) {
- i |= 1 << EnumFacing.SOUTH.getHorizontalIndex();
- }
-
- if (state.getValue(WEST)) {
- i |= 1 << EnumFacing.WEST.getHorizontalIndex();
- }
-
- return i;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockInteger.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockInteger.java
deleted file mode 100644
index 3e2a13f9..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/base/BlockInteger.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package WayofTime.bloodmagic.block.base;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyInteger;
-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;
-
-/**
- * Creates a block that has multiple meta-based states.
- *
- * These states will be numbered 0 through {@code maxMeta}.
- */
-public class BlockInteger extends Block {
- private final int maxMeta;
- private final PropertyInteger property;
- private final BlockStateContainer realStateContainer;
-
- public BlockInteger(Material material, int maxMeta, String propName) {
- super(material);
-
- this.maxMeta = maxMeta;
- this.property = PropertyInteger.create(propName, 0, maxMeta);
- this.realStateContainer = createStateContainer();
- setDefaultState(getBlockState().getBaseState());
- }
-
- public BlockInteger(Material material, int maxMeta) {
- this(material, maxMeta, "meta");
- }
-
- @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, meta);
- }
-
- @Override
- public int getMetaFromState(IBlockState state) {
- return state.getValue(property);
- }
-
- @Override
- public int damageDropped(IBlockState state) {
- return getMetaFromState(state);
- }
-
- @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() {
- return new BlockStateContainer.Builder(this).add(property).build();
- }
-
- public int getMaxMeta() {
- return maxMeta;
- }
-
- public PropertyInteger getProperty() {
- return property;
- }
-
- public BlockStateContainer getRealStateContainer() {
- return realStateContainer;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumDecorative.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumDecorative.java
deleted file mode 100644
index d9cdcdff..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumDecorative.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumDecorative implements IStringSerializable {
- BLOODSTONE_TILE,
- BLOODSTONE_BRICK,
- CRYSTAL_TILE,
- CRYSTAL_BRICK,;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ROOT);
- }
-
- @Override
- public String getName() {
- return toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock1.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock1.java
deleted file mode 100644
index 84b42602..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock1.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumDemonBlock1 implements IStringSerializable {
- BRICK1_RAW,
- BRICK1_CORROSIVE,
- BRICK1_DESTRUCTIVE,
- BRICK1_VENGEFUL,
- BRICK1_STEADFAST;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock2.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock2.java
deleted file mode 100644
index b9a35aab..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumDemonBlock2 implements IStringSerializable {
- SMALLBRICK_RAW,
- SMALLBRICK_CORROSIVE,
- SMALLBRICK_DESTRUCTIVE,
- SMALLBRICK_VENGEFUL,
- SMALLBRICK_STEADFAST,
- TILE_RAW,
- TILE_CORROSIVE,
- TILE_DESTRUCTIVE,
- TILE_VENGEFUL,
- TILE_STEADFAST,
- TILESPECIAL_RAW,
- TILESPECIAL_CORROSIVE,
- TILESPECIAL_DESTRUCTIVE,
- TILESPECIAL_VENGEFUL,
- TILESPECIAL_STEADFAST;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock3.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock3.java
deleted file mode 100644
index c7a54ac6..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumDemonBlock3.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumDemonBlock3 implements IStringSerializable {
- STONE_RAW,
- STONE_CORROSIVE,
- STONE_DESTRUCTIVE,
- STONE_VENGEFUL,
- STONE_STEADFAST,
- POLISHED_RAW,
- POLISHED_CORROSIVE,
- POLISHED_DESTRUCTIVE,
- POLISHED_VENGEFUL,
- POLISHED_STEADFAST,
- METAL_RAW,
- METAL_CORROSIVE,
- METAL_DESTRUCTIVE,
- METAL_VENGEFUL,
- METAL_STEADFAST;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumInversionCap.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumInversionCap.java
deleted file mode 100644
index b760a46b..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumInversionCap.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumInversionCap implements IStringSerializable {
- RAW_BOTTOM,
- RAW_TOP,
- CORROSIVE_BOTTOM,
- CORROSIVE_TOP,
- DESTRUCTIVE_BOTTOM,
- DESTRUCTIVE_TOP,
- VENGEFUL_BOTTOM,
- VENGEFUL_TOP,
- STEADFAST_BOTTOM,
- STEADFAST_TOP;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumMimic.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumMimic.java
deleted file mode 100644
index 18e2053e..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumMimic.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumMimic implements IStringSerializable {
- NOHITBOX,
- SOLIDOPAQUE,
- SOLIDCLEAR,
- SOLIDLIGHT,
- SENTIENT;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumPath.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumPath.java
deleted file mode 100644
index 79c768bb..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumPath.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumPath implements IStringSerializable {
- WOOD,
- WOODTILE,
- STONE,
- STONETILE,
- WORNSTONE,
- WORNSTONETILE,
- OBSIDIAN,
- OBSIDIANTILE;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumRitualController.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumRitualController.java
deleted file mode 100644
index 531ab6a2..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumRitualController.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumRitualController implements IStringSerializable {
- MASTER,
- IMPERFECT,
- INVERTED,;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType.java
deleted file mode 100644
index 01c05b88..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import WayofTime.bloodmagic.soul.EnumDemonWillType;
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumSubWillType implements IStringSerializable {
- RAW,
- CORROSIVE,
- DESTRUCTIVE,
- VENGEFUL,
- STEADFAST;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-
- public EnumDemonWillType getType() {
- String name = name();
-
- if (this == RAW)
- name = EnumDemonWillType.DEFAULT.name();
-
- return EnumDemonWillType.valueOf(name);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType1.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType1.java
deleted file mode 100644
index 4f51f8e8..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType1.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumSubWillType1 implements IStringSerializable {
- RAW,
- CORROSIVE;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType2.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType2.java
deleted file mode 100644
index 5f1a6aca..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType2.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumSubWillType2 implements IStringSerializable {
- DESTRUCTIVE,
- VENGEFUL;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType3.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType3.java
deleted file mode 100644
index 963704e8..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumSubWillType3.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumSubWillType3 implements IStringSerializable {
- STEADFAST;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/block/enums/EnumWillWall.java b/src/main/java/WayofTime/bloodmagic/block/enums/EnumWillWall.java
deleted file mode 100644
index 172c6d2b..00000000
--- a/src/main/java/WayofTime/bloodmagic/block/enums/EnumWillWall.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package WayofTime.bloodmagic.block.enums;
-
-import net.minecraft.util.IStringSerializable;
-
-import java.util.Locale;
-
-public enum EnumWillWall implements IStringSerializable {
- BRICK_RAW,
- BRICK_CORROSIVE,
- BRICK_DESTRUCTIVE,
- BRICK_VENGEFUL,
- BRICK_STEADFAST,
- SMALLBRICK_RAW,
- SMALLBRICK_CORROSIVE,
- SMALLBRICK_DESTRUCTIVE,
- SMALLBRICK_VENGEFUL,
- SMALLBRICK_STEADFAST,
- LARGE_RAW,
- LARGE_CORROSIVE,
- LARGE_DESTRUCTIVE,
- LARGE_VENGEFUL,
- LARGE_STEADFAST;
-
- @Override
- public String toString() {
- return name().toLowerCase(Locale.ENGLISH);
- }
-
- @Override
- public String getName() {
- return this.toString();
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/IMeshProvider.java b/src/main/java/WayofTime/bloodmagic/client/IMeshProvider.java
deleted file mode 100644
index fb8ec3c2..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/IMeshProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package WayofTime.bloodmagic.client;
-
-import net.minecraft.client.renderer.ItemMeshDefinition;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.annotation.Nullable;
-import java.util.function.Consumer;
-
-/**
- * Provides a custom {@link ItemMeshDefinition} for automatic registration of
- * renders.
- */
-public interface IMeshProvider {
- /**
- * Gets the custom ItemMeshDefinition to use for the item.
- *
- * @return - the custom ItemMeshDefinition to use for the item.
- */
- @SideOnly(Side.CLIENT)
- ItemMeshDefinition getMeshDefinition();
-
- /**
- * Gathers all possible variants for this item
- */
- void gatherVariants(Consumer variants);
-
- /**
- * If a custom ResourceLocation is required, return it here.
- *
- * Can be null if unneeded.
- *
- * @return - The custom ResourceLocation
- */
- @Nullable
- default ResourceLocation getCustomLocation() {
- return null;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/IVariantProvider.java b/src/main/java/WayofTime/bloodmagic/client/IVariantProvider.java
deleted file mode 100644
index cffbd900..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/IVariantProvider.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package WayofTime.bloodmagic.client;
-
-import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.minecraft.block.Block;
-
-import javax.annotation.Nonnull;
-
-public interface IVariantProvider {
-
- default void gatherVariants(@Nonnull Int2ObjectMap variants) {
- variants.put(0, this instanceof Block ? "normal" : "inventory");
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiAlchemyTable.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiAlchemyTable.java
deleted file mode 100644
index 3392b3f3..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiAlchemyTable.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package WayofTime.bloodmagic.client.gui;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.tile.TileAlchemyTable;
-import WayofTime.bloodmagic.tile.container.ContainerAlchemyTable;
-import WayofTime.bloodmagic.util.helper.TextHelper;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-@SideOnly(Side.CLIENT)
-public class GuiAlchemyTable extends GuiContainer {
- public IInventory tileTable;
-
- public GuiAlchemyTable(InventoryPlayer playerInventory, IInventory tileTable) {
- super(new ContainerAlchemyTable(playerInventory, tileTable));
- this.tileTable = tileTable;
- this.xSize = 176;
- this.ySize = 205;
- }
-
- @Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- this.drawDefaultBackground();
- super.drawScreen(mouseX, mouseY, partialTicks);
- this.renderHoveredToolTip(mouseX, mouseY);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
- this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.alchemyTable.name"), 8, 5, 4210752);
- this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- ResourceLocation soulForgeGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/alchemyTable.png");
- this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
- int i = (this.width - this.xSize) / 2;
- int j = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
-
- int l = this.getCookProgressScaled(90);
- this.drawTexturedModalRect(i + 115, j + 14 + 90 - l, 176, 90 - l, 18, l);
-
- for (int slotId = 0; slotId < 6; slotId++) {
- if (!((TileAlchemyTable) tileTable).isInputSlotAccessible(slotId)) {
- Slot slot = this.inventorySlots.getSlot(slotId);
-
- this.drawTexturedModalRect(i + slot.xPos, j + slot.yPos, 195, 1, 16, 16);
- }
- }
- }
-
- public int getCookProgressScaled(int scale) {
- double progress = ((TileAlchemyTable) tileTable).getProgressForGui();
- return (int) (progress * scale);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiBloodMagicConfig.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiBloodMagicConfig.java
deleted file mode 100644
index f96654ca..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiBloodMagicConfig.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package WayofTime.bloodmagic.client.gui;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.ConfigHandler;
-import WayofTime.bloodmagic.client.hud.ConfigEntryEditHUD;
-import com.google.common.collect.Lists;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraftforge.common.config.ConfigElement;
-import net.minecraftforge.fml.client.IModGuiFactory;
-import net.minecraftforge.fml.client.config.DummyConfigElement;
-import net.minecraftforge.fml.client.config.GuiConfig;
-import net.minecraftforge.fml.client.config.IConfigElement;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-public class GuiBloodMagicConfig extends GuiConfig {
-
- public GuiBloodMagicConfig(GuiScreen parentScreen) {
- super(parentScreen, getElements(), BloodMagic.MODID, false, false, BloodMagic.NAME);
- }
-
- public static List getElements() {
- List elements = Lists.newArrayList();
-
- elements.addAll(ConfigElement.from(ConfigHandler.class).getChildElements());
- elements.add(new ConfigElement(BloodMagic.RITUAL_MANAGER.getConfig().getCategory("rituals")));
- if (Minecraft.getMinecraft().world != null)
- elements.add(new DummyElementEditHUD(BloodMagic.NAME, "config." + BloodMagic.MODID + ".edit_hud"));
-
- return elements;
- }
-
- public static class DummyElementEditHUD extends DummyConfigElement.DummyCategoryElement {
-
- public DummyElementEditHUD(String name, String langKey) {
- super(name, langKey, Collections.emptyList(), ConfigEntryEditHUD.class);
- }
- }
-
- public static class Factory implements IModGuiFactory {
- @Override
- public void initialize(Minecraft minecraftInstance) {
-
- }
-
- @Override
- public boolean hasConfigGui() {
- return true;
- }
-
- @Override
- public GuiScreen createConfigGui(GuiScreen parentScreen) {
- return new GuiBloodMagicConfig(parentScreen);
- }
-
- @Override
- public Set runtimeGuiCategories() {
- return null;
- }
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiHandler.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiHandler.java
deleted file mode 100644
index 80705ac1..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiHandler.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package WayofTime.bloodmagic.client.gui;
-
-import WayofTime.bloodmagic.util.Constants;
-import WayofTime.bloodmagic.item.inventory.ContainerHolding;
-import WayofTime.bloodmagic.item.inventory.InventoryHolding;
-import WayofTime.bloodmagic.tile.TileAlchemyTable;
-import WayofTime.bloodmagic.tile.TileSoulForge;
-import WayofTime.bloodmagic.tile.TileTeleposer;
-import WayofTime.bloodmagic.tile.container.*;
-import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
-import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.common.network.IGuiHandler;
-
-public class GuiHandler implements IGuiHandler {
- @Override
- public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
- BlockPos pos = new BlockPos(x, y, z);
-
- switch (id) {
- case Constants.Gui.TELEPOSER_GUI:
- return new ContainerTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
- case Constants.Gui.SOUL_FORGE_GUI:
- return new ContainerSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
- case Constants.Gui.ROUTING_NODE_GUI:
- return new ContainerItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
- case Constants.Gui.MASTER_ROUTING_NODE_GUI:
- return new ContainerMasterRoutingNode(player.inventory, (TileMasterRoutingNode) world.getTileEntity(pos));
- case Constants.Gui.ALCHEMY_TABLE_GUI:
- return new ContainerAlchemyTable(player.inventory, (TileAlchemyTable) world.getTileEntity(pos));
- case Constants.Gui.SIGIL_HOLDING_GUI:
- return new ContainerHolding(player, new InventoryHolding(player.getHeldItemMainhand()));
- }
-
- return null;
- }
-
- @Override
- public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
- if (world instanceof WorldClient) {
- BlockPos pos = new BlockPos(x, y, z);
-
- switch (id) {
- case Constants.Gui.TELEPOSER_GUI:
- return new GuiTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
- case Constants.Gui.SOUL_FORGE_GUI:
- return new GuiSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
- case Constants.Gui.ROUTING_NODE_GUI:
- return new GuiItemRoutingNode(player.inventory, (TileFilteredRoutingNode) world.getTileEntity(pos));
- case Constants.Gui.MASTER_ROUTING_NODE_GUI:
- return new GuiMasterRoutingNode(player.inventory, (TileMasterRoutingNode) world.getTileEntity(pos));
- case Constants.Gui.ALCHEMY_TABLE_GUI:
- return new GuiAlchemyTable(player.inventory, (TileAlchemyTable) world.getTileEntity(pos));
- case Constants.Gui.SIGIL_HOLDING_GUI:
- return new GuiHolding(player, new InventoryHolding(player.getHeldItemMainhand()));
- }
- }
-
- return null;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiHolding.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiHolding.java
deleted file mode 100644
index 95fbd50f..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiHolding.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package WayofTime.bloodmagic.client.gui;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
-import WayofTime.bloodmagic.item.inventory.ContainerHolding;
-import WayofTime.bloodmagic.item.inventory.InventoryHolding;
-import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
-import WayofTime.bloodmagic.util.helper.TextHelper;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-@SideOnly(Side.CLIENT)
-public class GuiHolding extends GuiContainer {
- private ResourceLocation texture = new ResourceLocation(BloodMagic.MODID, "gui/SigilHolding.png");
- private EntityPlayer player;
-
- public GuiHolding(EntityPlayer player, InventoryHolding inventoryHolding) {
- super(new ContainerHolding(player, inventoryHolding));
- xSize = 176;
- ySize = 121;
- this.player = player;
- }
-
- @Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- this.drawDefaultBackground();
- super.drawScreen(mouseX, mouseY, partialTicks);
- this.renderHoveredToolTip(mouseX, mouseY);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
- //the parameters for drawString are: string, x, y, color
- fontRenderer.drawString(TextHelper.localize("item.bloodmagic.sigil.holding.name"), 53, 4, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouse) {
- //draw your Gui here, only thing you need to change is the path
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(texture);
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- ItemStack held = player.getHeldItem(EnumHand.MAIN_HAND);
- if (!held.isEmpty() && held.getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING) {
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- this.drawTexturedModalRect(4 + x + 36 * ItemSigilHolding.getCurrentItemOrdinal(player.getHeldItemMainhand()), y + 13, 0, 123, 24, 24);
- }
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java
deleted file mode 100644
index e879512a..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java
+++ /dev/null
@@ -1,200 +0,0 @@
-package WayofTime.bloodmagic.client.gui;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
-import WayofTime.bloodmagic.network.ItemRouterAmountPacketProcessor;
-import WayofTime.bloodmagic.network.ItemRouterButtonPacketProcessor;
-import WayofTime.bloodmagic.tile.container.ContainerItemRoutingNode;
-import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode;
-import WayofTime.bloodmagic.util.GhostItemHelper;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.GuiTextField;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import java.io.IOException;
-
-@SideOnly(Side.CLIENT)
-public class GuiItemRoutingNode extends GuiContainer {
- private GuiTextField textBox;
-
- private TileFilteredRoutingNode inventory;
- private ContainerItemRoutingNode container;
-
- private int left, top;
-
- public GuiItemRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) {
- super(new ContainerItemRoutingNode(playerInventory, tileRoutingNode));
- this.xSize = 201;
- this.ySize = 169;
- inventory = (TileFilteredRoutingNode) tileRoutingNode;
- container = (ContainerItemRoutingNode) this.inventorySlots;
- }
-
- private int getCurrentActiveSlotPriority() {
- EnumFacing direction = EnumFacing.getFront(inventory.currentActiveSlot);
- if (direction != null) {
- return inventory.getPriority(direction);
- }
-
- return 0;
- }
-
- @Override
- public void initGui() {
- super.initGui();
- left = (this.width - this.xSize) / 2;
- top = (this.height - this.ySize) / 2;
-
- this.buttonList.clear();
- this.buttonList.add(new GuiButton(0, left + 176, top + 14, 18, 18, "D"));
- this.buttonList.add(new GuiButton(1, left + 176, top + 32, 18, 18, "U"));
- this.buttonList.add(new GuiButton(2, left + 176, top + 50, 18, 18, "N"));
- this.buttonList.add(new GuiButton(3, left + 176, top + 68, 18, 18, "S"));
- this.buttonList.add(new GuiButton(4, left + 176, top + 86, 18, 18, "W"));
- this.buttonList.add(new GuiButton(5, left + 176, top + 104, 18, 18, "E"));
- this.buttonList.add(new GuiButton(6, left + 160, top + 50, 10, 18, ">"));
- this.buttonList.add(new GuiButton(7, left + 132, top + 50, 10, 18, "<"));
- disableDirectionalButton(inventory.currentActiveSlot);
-
- this.textBox = new GuiTextField(0, this.fontRenderer, left + 94, top + 37, 70, 12);
- this.textBox.setEnableBackgroundDrawing(false);
- this.textBox.setText("");
- }
-
- @Override
- protected void keyTyped(char typedChar, int keyCode) throws IOException {
- if (this.textBox.textboxKeyTyped(typedChar, keyCode)) {
- if (container.lastGhostSlotClicked != -1) {
-// this.renameItem();
- String str = this.textBox.getText();
- int amount = 0;
-
- if (!str.isEmpty()) {
- try {
- Integer testVal = Integer.decode(str);
- if (testVal != null) {
- amount = testVal;
- }
- } catch (NumberFormatException d) {
- }
- }
-
-// inventory.setGhostItemAmount(container.lastGhostSlotClicked, amount);
- setValueOfGhostItemInSlot(container.lastGhostSlotClicked, amount);
- }
- } else {
- super.keyTyped(typedChar, keyCode);
- }
- }
-
- private void setValueOfGhostItemInSlot(int ghostItemSlot, int amount) {
- BloodMagicPacketHandler.INSTANCE.sendToServer(new ItemRouterAmountPacketProcessor(ghostItemSlot, amount, inventory.getPos(), inventory.getWorld()));
- }
-
- /**
- * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
- */
- @Override
- protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
- super.mouseClicked(mouseX, mouseY, mouseButton);
- this.textBox.mouseClicked(mouseX, mouseY, mouseButton);
- if (container.lastGhostSlotClicked != -1) {
- Slot slot = container.getSlot(container.lastGhostSlotClicked + 1);
- ItemStack stack = slot.getStack();
- if (!stack.isEmpty()) {
- int amount = GhostItemHelper.getItemGhostAmount(stack);
- this.textBox.setText("" + amount);
- } else {
- this.textBox.setText("");
- }
- }
- }
-
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- this.drawDefaultBackground();
- super.drawScreen(mouseX, mouseY, partialTicks);
- this.renderHoveredToolTip(mouseX, mouseY);
-
- Minecraft.getMinecraft().fontRenderer.drawString(inventory.getName(), xSize, ySize / 4, 4210752);
- }
-
- /**
- * Called by the controls from the buttonList when activated. (Mouse pressed
- * for buttons)
- */
- @Override
- protected void actionPerformed(GuiButton button) throws IOException {
- if (button.enabled) {
- BloodMagicPacketHandler.INSTANCE.sendToServer(new ItemRouterButtonPacketProcessor(button.id, inventory.getPos(), inventory.getWorld()));
- if (button.id < 6) {
- inventory.currentActiveSlot = button.id;
- enableAllDirectionalButtons();
- button.enabled = false;
- }
- }
- }
-
- private void enableAllDirectionalButtons() {
- for (GuiButton button : this.buttonList) {
- button.enabled = true;
- }
- }
-
- private void disableDirectionalButton(int id) {
- this.buttonList.get(id).enabled = false;
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
- this.fontRenderer.drawString("" + getCurrentActiveSlotPriority(), 143 + 5, 51 + 4, 0xFFFFFF);
- String s = "";
- if (container.lastGhostSlotClicked != -1) {
- ItemStack clickedStack = inventorySlots.getSlot(1 + container.lastGhostSlotClicked).getStack();
- if (!clickedStack.isEmpty()) {
- s = clickedStack.getDisplayName();
- }
- }
-
- this.fontRenderer.drawStringWithShadow(s.substring(0, Math.min(16, s.length())), 81, 19, 0xFFFFFF);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- ResourceLocation soulForgeGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/routingNode.png");
- this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
- this.drawTexturedModalRect(left, top, 0, 0, this.xSize, this.ySize);
- GlStateManager.disableLighting();
- GlStateManager.disableBlend();
- this.textBox.drawTextBox();
- }
-
-// @Override
-// public void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack)
-// {
-// if (slotInd == 0)
-// {
-// this.nameField.setText(stack == null ? "" : stack.getOwnerName());
-// this.nameField.setEnabled(stack != null);
-//
-// if (stack != null)
-// {
-// this.renameItem();
-// }
-// }
-// }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiMasterRoutingNode.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiMasterRoutingNode.java
deleted file mode 100644
index c64d1b21..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiMasterRoutingNode.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package WayofTime.bloodmagic.client.gui;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.tile.container.ContainerMasterRoutingNode;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-@SideOnly(Side.CLIENT)
-public class GuiMasterRoutingNode extends GuiContainer {
-
- public GuiMasterRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) {
- super(new ContainerMasterRoutingNode(playerInventory, tileRoutingNode));
- this.xSize = 216;
- this.ySize = 216;
- }
-
- @Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- this.drawDefaultBackground();
- super.drawScreen(mouseX, mouseY, partialTicks);
- this.renderHoveredToolTip(mouseX, mouseY);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
-// this.fontRendererObj.drawString(TextHelper.localize("tile.bloodmagic.soulForge.name"), 8, 5, 4210752);
-// this.fontRendererObj.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- ResourceLocation soulForgeGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/masterRoutingNode.png");
- this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
- int i = (this.width - this.xSize) / 2;
- int j = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiSoulForge.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiSoulForge.java
deleted file mode 100644
index 6a1d85b0..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiSoulForge.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package WayofTime.bloodmagic.client.gui;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.tile.TileSoulForge;
-import WayofTime.bloodmagic.tile.container.ContainerSoulForge;
-import WayofTime.bloodmagic.util.helper.TextHelper;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-@SideOnly(Side.CLIENT)
-public class GuiSoulForge extends GuiContainer {
- public IInventory tileSoulForge;
-
- public GuiSoulForge(InventoryPlayer playerInventory, IInventory tileSoulForge) {
- super(new ContainerSoulForge(playerInventory, tileSoulForge));
- this.tileSoulForge = tileSoulForge;
- this.xSize = 176;
- this.ySize = 205;
- }
-
- @Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- this.drawDefaultBackground();
- super.drawScreen(mouseX, mouseY, partialTicks);
- this.renderHoveredToolTip(mouseX, mouseY);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
- this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.soulForge.name"), 8, 5, 4210752);
- this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- ResourceLocation soulForgeGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/soulForge.png");
- this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
- int i = (this.width - this.xSize) / 2;
- int j = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
-
- int l = this.getCookProgressScaled(90);
- this.drawTexturedModalRect(i + 115, j + 14 + 90 - l, 176, 90 - l, 18, l);
- }
-
- public int getCookProgressScaled(int scale) {
- double progress = ((TileSoulForge) tileSoulForge).getProgressForGui();
- return (int) (progress * scale);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiTeleposer.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiTeleposer.java
deleted file mode 100644
index e5db4c67..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiTeleposer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package WayofTime.bloodmagic.client.gui;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.tile.container.ContainerTeleposer;
-import WayofTime.bloodmagic.util.helper.TextHelper;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-@SideOnly(Side.CLIENT)
-public class GuiTeleposer extends GuiContainer {
- public GuiTeleposer(InventoryPlayer playerInventory, IInventory tileTeleposer) {
- super(new ContainerTeleposer(playerInventory, tileTeleposer));
- }
-
- @Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- this.drawDefaultBackground();
- super.drawScreen(mouseX, mouseY, partialTicks);
- this.renderHoveredToolTip(mouseX, mouseY);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
- this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.teleposer.name"), 64, 23, 4210752);
- this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 47, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- ResourceLocation teleposerGuiTextures = new ResourceLocation(BloodMagic.MODID + ":textures/gui/teleposer.png");
- this.mc.getTextureManager().bindTexture(teleposerGuiTextures);
- int i = (this.width - this.xSize) / 2;
- int j = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(i, j + 18, 0, 0, this.xSize, this.ySize);
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/helper/ShaderHelper.java b/src/main/java/WayofTime/bloodmagic/client/helper/ShaderHelper.java
deleted file mode 100644
index 950af569..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/helper/ShaderHelper.java
+++ /dev/null
@@ -1,182 +0,0 @@
-package WayofTime.bloodmagic.client.helper;
-
-import net.minecraft.client.renderer.OpenGlHelper;
-import net.minecraftforge.fml.common.FMLLog;
-import org.apache.logging.log4j.Level;
-import org.lwjgl.opengl.ARBFragmentShader;
-import org.lwjgl.opengl.ARBShaderObjects;
-import org.lwjgl.opengl.ARBVertexShader;
-import org.lwjgl.opengl.GL11;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-/**
- * This class was created by . It's distributed as
- * part of the Botania Mod. Get the Source Code in github:
- * https://github.com/Vazkii/Botania
- *
- * Botania is Open Source and distributed under the
- * Botania License: http://botaniamod.net/license.php
- *
- * File Created @ [Apr 9, 2014, 11:20:26 PM (GMT)]
- */
-public final class ShaderHelper {
- private static final int VERT_ST = ARBVertexShader.GL_VERTEX_SHADER_ARB;
- private static final int FRAG_ST = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB;
-
- private static final int VERT = 1;
- private static final int FRAG = 2;
-
- private static final String VERT_EXTENSION = ".vsh";
- private static final String FRAG_EXTENSION = ".frag";
-
- public static int psiBar;
-
- public static void init() {
- if (!useShaders())
- return;
-
- psiBar = createProgram("/assets/bloodmagic/shaders/beam", FRAG);
- }
-
- public static void useShader(int shader, int ticks) {
- if (!useShaders())
- return;
-
- ARBShaderObjects.glUseProgramObjectARB(shader);
-
- if (shader != 0) {
- int time = ARBShaderObjects.glGetUniformLocationARB(shader, "time");
- ARBShaderObjects.glUniform1iARB(time, ticks);
- }
- }
-
- public static void releaseShader() {
- useShader(0, 0);
- }
-
- public static boolean useShaders() {
- return OpenGlHelper.shadersSupported;
- }
-
- private static int createProgram(String s, int sides) {
- boolean vert = (sides & VERT) != 0;
- boolean frag = (sides & FRAG) != 0;
-
- return createProgram(vert ? (s + VERT_EXTENSION) : null, frag ? (s + FRAG_EXTENSION) : null);
- }
-
- // Most of the code taken from the LWJGL wiki
- // http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL
-
- private static int createProgram(String vert, String frag) {
- int vertId = 0, fragId = 0, program = 0;
- if (vert != null)
- vertId = createShader(vert, VERT_ST);
- if (frag != null)
- fragId = createShader(frag, FRAG_ST);
-
- program = ARBShaderObjects.glCreateProgramObjectARB();
- if (program == 0)
- return 0;
-
- if (vert != null)
- ARBShaderObjects.glAttachObjectARB(program, vertId);
- if (frag != null)
- ARBShaderObjects.glAttachObjectARB(program, fragId);
-
- ARBShaderObjects.glLinkProgramARB(program);
- if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) {
- FMLLog.log(Level.ERROR, getLogInfo(program));
- return 0;
- }
-
- ARBShaderObjects.glValidateProgramARB(program);
- if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
- FMLLog.log(Level.ERROR, getLogInfo(program));
- return 0;
- }
-
- return program;
- }
-
- private static int createShader(String filename, int shaderType) {
- int shader = 0;
- try {
- shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType);
-
- if (shader == 0)
- return 0;
-
- ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename));
- ARBShaderObjects.glCompileShaderARB(shader);
-
- if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE)
- throw new RuntimeException("Error creating shader: " + getLogInfo(shader));
-
- return shader;
- } catch (Exception e) {
- ARBShaderObjects.glDeleteObjectARB(shader);
- e.printStackTrace();
- return -1;
- }
- }
-
- private static String getLogInfo(int obj) {
- return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
- }
-
- private static String readFileAsString(String filename) throws Exception {
- StringBuilder source = new StringBuilder();
- InputStream in = ShaderHelper.class.getResourceAsStream(filename);
- Exception exception = null;
- BufferedReader reader;
-
- if (in == null)
- return "";
-
- try {
- reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
-
- Exception innerExc = null;
- try {
- String line;
- while ((line = reader.readLine()) != null)
- source.append(line).append('\n');
- } catch (Exception exc) {
- exception = exc;
- } finally {
- try {
- reader.close();
- } catch (Exception exc) {
- if (innerExc == null)
- innerExc = exc;
- else
- exc.printStackTrace();
- }
- }
-
- if (innerExc != null)
- throw innerExc;
- } catch (Exception exc) {
- exception = exc;
- } finally {
- try {
- in.close();
- } catch (Exception exc) {
- if (exception == null)
- exception = exc;
- else
- exc.printStackTrace();
- }
-
- if (exception != null)
- throw exception;
- }
-
- return source.toString();
- }
-
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/hud/ConfigEntryEditHUD.java b/src/main/java/WayofTime/bloodmagic/client/hud/ConfigEntryEditHUD.java
deleted file mode 100644
index d713e3b6..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/hud/ConfigEntryEditHUD.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package WayofTime.bloodmagic.client.hud;
-
-import net.minecraftforge.fml.client.config.GuiConfig;
-import net.minecraftforge.fml.client.config.GuiConfigEntries;
-import net.minecraftforge.fml.client.config.IConfigElement;
-
-public class ConfigEntryEditHUD extends GuiConfigEntries.CategoryEntry {
-
- public ConfigEntryEditHUD(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement element) {
- super(owningScreen, owningEntryList, element);
-
- this.childScreen = new GuiEditHUD(owningScreen);
- }
-
- @Override
- public boolean isDefault() {
- return true;
- }
-
- @Override
- public void setToDefault() {
- ElementRegistry.resetPos();
- }
-
- @Override
- public boolean isChanged() {
- return ((GuiEditHUD) childScreen).changes;
- }
-
- @Override
- public void undoChanges() {
-
- }
-
- @Override
- public boolean saveConfigElement() {
- return false;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/hud/ElementInfo.java b/src/main/java/WayofTime/bloodmagic/client/hud/ElementInfo.java
deleted file mode 100644
index 9544dcdc..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/hud/ElementInfo.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package WayofTime.bloodmagic.client.hud;
-
-import javax.vecmath.Vector2f;
-
-public class ElementInfo {
-
- public static final ElementInfo DUMMY = new ElementInfo(new Vector2f(0F, 0F), ElementRegistry.getRandomColor());
-
- private final Vector2f defaultPosition;
- private final int boxColor;
- private Vector2f currentPosition;
-
- public ElementInfo(Vector2f defaultPosition, int boxColor) {
- this.defaultPosition = defaultPosition;
- this.boxColor = boxColor;
- this.currentPosition = defaultPosition;
- }
-
- public Vector2f getDefaultPosition() {
- return defaultPosition;
- }
-
- public int getBoxColor() {
- return boxColor;
- }
-
- public ElementInfo setPosition(Vector2f position) {
- this.currentPosition = position;
- return this;
- }
-
- public Vector2f getPosition() {
- return currentPosition;
- }
-
- public void resetPosition() {
- this.currentPosition = defaultPosition;
- }
-}
diff --git a/src/main/java/WayofTime/bloodmagic/client/hud/ElementRegistry.java b/src/main/java/WayofTime/bloodmagic/client/hud/ElementRegistry.java
deleted file mode 100644
index d83cb03c..00000000
--- a/src/main/java/WayofTime/bloodmagic/client/hud/ElementRegistry.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package WayofTime.bloodmagic.client.hud;
-
-import WayofTime.bloodmagic.BloodMagic;
-import WayofTime.bloodmagic.client.hud.element.HUDElement;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Maps;
-import com.google.common.reflect.TypeToken;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.ScaledResolution;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.client.event.RenderGameOverlayEvent;
-import net.minecraftforge.fml.common.Loader;
-import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-import javax.vecmath.Vector2f;
-import java.awt.Color;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.function.BiFunction;
-
-@Mod.EventBusSubscriber(modid = BloodMagic.MODID, value = Side.CLIENT)
-public class ElementRegistry {
-
- private static final File CONFIG = new File(Loader.instance().getConfigDir(), BloodMagic.MODID + "/hud_elements.json");
- private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
- private static final Map HUD_ELEMENTS = Maps.newLinkedHashMap();
- private static final Map REVERSE = Maps.newHashMap();
- private static final Map ELEMENT_INFO = Maps.newHashMap();
-
- public static void registerHandler(ResourceLocation key, HUDElement element, Vector2f defaultPosition) {
- HUD_ELEMENTS.put(key, element);
- REVERSE.put(element, key);
-
-
- ELEMENT_INFO.put(key, new ElementInfo(defaultPosition, getRandomColor()));
- }
-
- public static void resetPos() {
- ELEMENT_INFO.values().forEach(ElementInfo::resetPosition);
- }
-
- public static List getElements() {
- return ImmutableList.copyOf(HUD_ELEMENTS.values());
- }
-
- public static ResourceLocation getKey(HUDElement element) {
- return REVERSE.get(element);
- }
-
- public static int getColor(ResourceLocation element) {
- return ELEMENT_INFO.getOrDefault(element, ElementInfo.DUMMY).getBoxColor();
- }
-
- public static Vector2f getPosition(ResourceLocation element) {
- return ELEMENT_INFO.get(element).getPosition();
- }
-
- public static void setPosition(ResourceLocation element, Vector2f point) {
- ELEMENT_INFO.compute(element, (resourceLocation, elementInfo) -> {
- if (elementInfo == null)
- return new ElementInfo(point, getRandomColor());
-
- elementInfo.setPosition(point);
- return elementInfo;
- });
- }
-
- public static void save(Map newLocations) {
- newLocations.forEach((k, v) -> {
- ElementInfo info = ELEMENT_INFO.get(k);
- if (info != null)
- info.setPosition(v);
- });
-
- Map toWrite = Maps.newHashMap();
- for (Map.Entry entry : ELEMENT_INFO.entrySet())
- toWrite.put(entry.getKey().toString(), entry.getValue().getPosition());
-
- String json = GSON.toJson(toWrite);
- try (FileWriter writer = new FileWriter(CONFIG)) {
- writer.write(json);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public static void readConfig() {
- if (!CONFIG.exists())
- return;
-
- try (FileReader reader = new FileReader(CONFIG)) {
- Map toLoad = GSON.fromJson(reader, new TypeToken