mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Compare commits
10
Commits
1.7.12-pre
..
1.7.23
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
097c0c62e4 | ||
|
|
c04775398a | ||
|
|
62789ce20b | ||
|
|
8685e1fd72 | ||
|
|
6b016444ba | ||
|
|
1552b81459 | ||
|
|
5e6c4e848c | ||
|
|
9f2d0b5241 | ||
|
|
e75e9f778a | ||
|
|
6bd083125a |
No files matched your search
+4
-2
@@ -26,17 +26,19 @@ dependencies {
|
||||
api("com.github.GTNewHorizons:waila:1.8.4:dev")
|
||||
api("com.github.GTNewHorizons:NotEnoughItems:2.7.40-GTNH:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.254:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.275:dev") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.12.6-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.10.7:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.6.2:dev") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:2.16.2-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:2.16.4-GTNH:api") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.1:dev") {transitive = false }
|
||||
|
||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false }
|
||||
compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.10:dev")
|
||||
}
|
||||
+2
-2
@@ -41,11 +41,11 @@ developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = false
|
||||
enableModernJavaSyntax = true
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
enableGenericInjection = false
|
||||
enableGenericInjection = true
|
||||
|
||||
# Generate a class with a String field for the mod version named as defined below.
|
||||
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||
|
||||
@@ -277,6 +277,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler;
|
||||
import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration;
|
||||
import WayofTime.alchemicalWizardry.compat.BloodMagicWailaPlugin;
|
||||
import WayofTime.alchemicalWizardry.compat.structurelib.CompatStructureLib;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
@@ -493,6 +494,7 @@ public class AlchemicalWizardry {
|
||||
public static boolean causeHungerWithRegen;
|
||||
public static boolean causeHungerChatMessage = true;
|
||||
public static boolean disableBoundToolsRightClick;
|
||||
public static boolean allowPotionRepair;
|
||||
|
||||
public static BlockStack[] secondTierRunes = new BlockStack[10];
|
||||
public static BlockStack[] thirdTierRunes = new BlockStack[10];
|
||||
@@ -3331,6 +3333,10 @@ public class AlchemicalWizardry {
|
||||
isFMPLoaded = Loader.isModLoaded("ForgeMultipart");
|
||||
isChiselLoaded = Loader.isModLoaded("chisel");
|
||||
|
||||
if (Loader.isModLoaded("structurelib")) {
|
||||
CompatStructureLib.init();
|
||||
}
|
||||
|
||||
BloodMagicConfiguration.loadBlacklist();
|
||||
BloodMagicConfiguration.blacklistRituals();
|
||||
BloodMagicConfiguration.loadCustomLPValues();
|
||||
|
||||
@@ -131,6 +131,7 @@ public class BloodMagicConfiguration {
|
||||
.getBoolean();
|
||||
AlchemicalWizardry.causeHungerChatMessage = config.get("WimpySettings", "causeHungerChatMessage", true)
|
||||
.getBoolean();
|
||||
AlchemicalWizardry.allowPotionRepair = config.get("WimpySettings", "allowPotionRepair", true).getBoolean();
|
||||
// AlchemicalWizardry.lockdownAltar = config.get("WimpySettings", "LockdownAltarWithRegen", true).getBoolean();
|
||||
AlchemicalWizardry.lockdownAltar = false;
|
||||
AlchemicalWizardry.disableBoundToolsRightClick = config
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
|
||||
public class PlayerSacrificeHandler {
|
||||
|
||||
public static float scalingOfSacrifice = 0.001f;
|
||||
public static int soulFrayDuration = 400;
|
||||
public static int soulFrayDuration = 240;
|
||||
public static Potion soulFrayId;
|
||||
|
||||
public static float getPlayerIncense(EntityPlayer player) {
|
||||
|
||||
@@ -7,9 +7,8 @@ import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
public class IMCForNEI {
|
||||
|
||||
public static void IMCSender() {
|
||||
sendHandler("alchemicalwizardry.meteor", "AWWayofTime:masterStone", 181);
|
||||
sendHandler("alchemicalwizardry.meteor", "AWWayofTime:masterStone", 130);
|
||||
sendCatalyst("alchemicalwizardry.meteor", "AWWayofTime:masterStone");
|
||||
sendCatalyst("alchemicalwizardry.bindingritual", "AWWayofTime:masterStone");
|
||||
}
|
||||
|
||||
private static void sendHandler(String handlerName, String stack, int height) {
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.ReagentInfo;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.RitualInfo;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
/**
|
||||
@@ -24,9 +16,6 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
*/
|
||||
public class NEIBindingRitualHandler extends TemplateRecipeHandler {
|
||||
|
||||
private static final RitualInfo ritualInfo = new RitualInfo("AW006Binding", 1f);
|
||||
private static final ReagentInfo reagentInfo = new ReagentInfo(1f);
|
||||
|
||||
public class CachedBindingRecipe extends CachedRecipe {
|
||||
|
||||
PositionedStack input, output;
|
||||
@@ -64,7 +53,7 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler {
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (BindingRecipe recipe : BindingRegistry.bindingRecipes) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.outputItem, result)) {
|
||||
if (recipe.outputItem != null) {
|
||||
if (recipe != null && recipe.outputItem != null) {
|
||||
arecipes.add(new CachedBindingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
@@ -75,45 +64,13 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler {
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
for (BindingRecipe recipe : BindingRegistry.bindingRecipes) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.requiredItem, ingredient)) {
|
||||
if (recipe.outputItem != null) {
|
||||
if (recipe != null && recipe.outputItem != null) {
|
||||
arecipes.add(new CachedBindingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
super.drawExtras(recipe);
|
||||
|
||||
// Only shows these for the first result
|
||||
if (recipe == 0) {
|
||||
ritualInfo.onDraw(0, 0);
|
||||
reagentInfo.onDraw(150, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> list, int recipeIndex) {
|
||||
if (GuiContainerManager.shouldShowTooltip(gui) && list.isEmpty()) {
|
||||
CachedRecipe cRecipe = arecipes.get(recipeIndex);
|
||||
Point mousePos = GuiDraw.getMousePosition();
|
||||
|
||||
if (recipeIndex == 0 && cRecipe instanceof NEIBindingRitualHandler.CachedBindingRecipe) {
|
||||
Rectangle rect = ritualInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
ritualInfo.onHover(list);
|
||||
}
|
||||
|
||||
rect = reagentInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
list.add(StatCollector.translateToLocal("nei.recipe.reagent.none"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.handleTooltip(gui, list, recipeIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return "alchemicalwizardry.bindingritual";
|
||||
|
||||
@@ -13,7 +13,6 @@ import codechicken.nei.api.IConfigureNEI;
|
||||
public class NEIConfig implements IConfigureNEI {
|
||||
|
||||
private static ArrayList<Item> bloodOrbs = null;
|
||||
private static ArrayList<Item> byCapacity = null;
|
||||
|
||||
public static ArrayList<Item> getBloodOrbs() {
|
||||
if (bloodOrbs == null) {
|
||||
@@ -45,19 +44,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
return bloodOrbsTemp;
|
||||
}
|
||||
|
||||
public static ArrayList<Item> getOrbsByCapacity() {
|
||||
if (byCapacity == null) {
|
||||
byCapacity = new ArrayList<>(getBloodOrbs());
|
||||
byCapacity.sort((a, b) -> {
|
||||
if (a instanceof IBloodOrb && b instanceof IBloodOrb) {
|
||||
return Integer.compare(((IBloodOrb) a).getMaxEssence(), ((IBloodOrb) b).getMaxEssence());
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
return byCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
API.registerRecipeHandler(new NEIAlchemyRecipeHandler());
|
||||
|
||||
+15
-130
@@ -1,70 +1,51 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.CostInfo;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.RadiusInfo;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.ReagentInfo;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.RitualInfo;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.Meteor;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorComponent;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorReagent;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
private static final RitualInfo ritualInfo = new RitualInfo("AW019FallingTower", 0.75f);
|
||||
private static final ReagentInfo reagentInfo = new ReagentInfo(0.75f);
|
||||
|
||||
public class CachedMeteorRecipe extends CachedRecipe {
|
||||
|
||||
private final List<PositionedStack> input = new ArrayList<>();
|
||||
private final List<PositionedStack> outputs = new ArrayList<>();
|
||||
private final CostInfo costInfo;
|
||||
private final RadiusInfo radiusInfo;
|
||||
private final int cost;
|
||||
private final int radius;
|
||||
private Point focus;
|
||||
|
||||
public float fillerChance;
|
||||
|
||||
public CachedMeteorRecipe(Meteor meteor, ItemStack focusStack) {
|
||||
this.input.add(new PositionedStack(meteor.focusItem, 75, 4));
|
||||
this.input.add(new PositionedStack(meteor.focusItem, 74, 4));
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
float totalComponentWeight = MeteorComponent.getTotalListWeight(meteor.ores);
|
||||
fillerChance = meteor.fillerChance;
|
||||
float fillerChance = meteor.fillerChance;
|
||||
List<MeteorComponent> sortedComponents = new ArrayList<>(meteor.ores);
|
||||
sortedComponents.sort(Comparator.comparingInt(c -> -c.getWeight()));
|
||||
|
||||
@@ -134,8 +115,8 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
}
|
||||
|
||||
this.costInfo = new CostInfo(meteor.cost);
|
||||
this.radiusInfo = new RadiusInfo(meteor.radius);
|
||||
this.radius = meteor.radius;
|
||||
this.cost = meteor.cost;
|
||||
}
|
||||
|
||||
private String getReagentStrings(MeteorComponent component) {
|
||||
@@ -163,11 +144,11 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
return costInfo.getCost();
|
||||
return cost;
|
||||
}
|
||||
|
||||
public int getRadius() {
|
||||
return radiusInfo.getRadius();
|
||||
return radius;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,10 +238,12 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
CachedMeteorRecipe meteorRecipe = (CachedMeteorRecipe) this.arecipes.get(recipe);
|
||||
meteorRecipe.costInfo.onDraw(30, 4);
|
||||
meteorRecipe.radiusInfo.onDraw(120, 4);
|
||||
ritualInfo.onDraw(0, 0);
|
||||
reagentInfo.onDraw(153, 0);
|
||||
int cost = meteorRecipe.getCost();
|
||||
int radius = meteorRecipe.getRadius();
|
||||
Minecraft.getMinecraft().fontRenderer
|
||||
.drawString(I18n.format("nei.recipe.meteor.cost", String.format("%,d", cost)), 2, 168, 0x000000);
|
||||
Minecraft.getMinecraft().fontRenderer
|
||||
.drawString(I18n.format("nei.recipe.meteor.radius", radius), 2, 179, 0x000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -292,96 +275,6 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> list, int recipeIndex) {
|
||||
if (GuiContainerManager.shouldShowTooltip(gui) && list.isEmpty()) {
|
||||
CachedRecipe cRecipe = arecipes.get(recipeIndex);
|
||||
Point mousePos = GuiDraw.getMousePosition();
|
||||
|
||||
if (cRecipe instanceof CachedMeteorRecipe) {
|
||||
CachedMeteorRecipe cachedRecipe = (CachedMeteorRecipe) cRecipe;
|
||||
Rectangle rect = cachedRecipe.costInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
list.add(StatCollector.translateToLocal("nei.recipe.meteor.cost"));
|
||||
if (SoulNetworkHandler.getCurrentEssence(mc.thePlayer.getDisplayName()) < cachedRecipe.getCost()) {
|
||||
list.add(
|
||||
EnumChatFormatting.RED
|
||||
+ StatCollector.translateToLocal("nei.recipe.meteor.tooExpensive"));
|
||||
}
|
||||
}
|
||||
|
||||
rect = cachedRecipe.radiusInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
list.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"nei.recipe.meteor.diameter",
|
||||
2 * cachedRecipe.radiusInfo.getRadius() + 1));
|
||||
}
|
||||
|
||||
rect = ritualInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
ritualInfo.onHover(list);
|
||||
}
|
||||
|
||||
rect = reagentInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
reagentInfo.onHover(list);
|
||||
addMeteorReagentInfo(list, cachedRecipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.handleTooltip(gui, list, recipeIndex);
|
||||
}
|
||||
|
||||
private void addMeteorReagentInfo(List<String> list, CachedMeteorRecipe cachedRecipe) {
|
||||
DecimalFormat fmt = new DecimalFormat("###.##");
|
||||
for (Map.Entry<Reagent, MeteorReagent> entry : MeteorReagentRegistry.reagents.entrySet()) {
|
||||
ArrayList<String> l = new ArrayList<>();
|
||||
Reagent r = entry.getKey();
|
||||
MeteorReagent mr = entry.getValue();
|
||||
|
||||
if (mr.radiusChange != 0) {
|
||||
l.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"nei.recipe.reagent.meteor.radius",
|
||||
mr.radiusChange,
|
||||
Meteor.getNewRadius(cachedRecipe.getRadius(), Collections.singletonList(r))));
|
||||
}
|
||||
|
||||
if (cachedRecipe.fillerChance > 0) {
|
||||
if (mr.fillerChanceChange != 0 || mr.rawFillerChanceChange != 0) {
|
||||
l.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"nei.recipe.reagent.meteor.filler.chance",
|
||||
fmt.format(
|
||||
Meteor.getNewFillerChance(
|
||||
cachedRecipe.fillerChance,
|
||||
Collections.singletonList(r)))));
|
||||
}
|
||||
|
||||
if (!mr.filler.isEmpty()) {
|
||||
l.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"nei.recipe.reagent.meteor.filler.blocks",
|
||||
reagentFillerBlockNames(mr)));
|
||||
}
|
||||
}
|
||||
|
||||
if (mr.disableExplosions) {
|
||||
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.explosions"));
|
||||
} else if (mr.invertExplosionBlockDamage && AlchemicalWizardry.doMeteorsDestroyBlocks) {
|
||||
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.blockDamage.off"));
|
||||
} else if (mr.invertExplosionBlockDamage) {
|
||||
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.blockDamage.on"));
|
||||
}
|
||||
|
||||
if (!l.isEmpty()) {
|
||||
list.add(r.name + ":");
|
||||
list.addAll(l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return I18n.format("nei.recipe.meteor.category");
|
||||
@@ -399,12 +292,4 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
private int getEstimatedAmount(float chance, int radius) {
|
||||
return (int) Math.ceil(4f / 3 * Math.PI * Math.pow(radius + 0.5, 3) * chance);
|
||||
}
|
||||
|
||||
private String reagentFillerBlockNames(MeteorReagent mr) {
|
||||
ArrayList<String> blockNames = new ArrayList<>();
|
||||
for (MeteorComponent mc : mr.filler) {
|
||||
blockNames.add(mc.getBlock().getDisplayName());
|
||||
}
|
||||
return Joiner.on(", ").join(blockNames);
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getBloodOrbs;
|
||||
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getOrbsByCapacity;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
public class CostInfo {
|
||||
|
||||
private final int cost;
|
||||
private int prevX, prevY;
|
||||
private final int orbLP;
|
||||
private final ItemStack orbStack;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
static {
|
||||
renderItem.renderWithColor = false;
|
||||
}
|
||||
|
||||
public CostInfo(int cost) {
|
||||
this.cost = cost;
|
||||
|
||||
Item orb = null;
|
||||
getOrbsByCapacity();
|
||||
ArrayList<Item> orbList = getBloodOrbs();
|
||||
for (Item o : orbList) {
|
||||
if (((IBloodOrb) o).getMaxEssence() >= cost) {
|
||||
orb = o;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (orb == null) {
|
||||
orb = orbList.get(orbList.size() - 1);
|
||||
}
|
||||
|
||||
orbLP = ((IBloodOrb) orb).getMaxEssence();
|
||||
orbStack = new ItemStack(orb);
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public void onDraw(int x, int y) {
|
||||
prevX = x;
|
||||
prevY = y;
|
||||
|
||||
int currentLP = SoulNetworkHandler.getCurrentEssence(mc.thePlayer.getDisplayName());
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
if (orbLP > currentLP) {
|
||||
GL11.glColor4f(0.4f, 0.4f, 0.4f, 1.0f);
|
||||
} else {
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), orbStack, x, y);
|
||||
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
String costText = String.format("%,d", cost);
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
|
||||
int textWidth = fontRenderer.getStringWidth(costText);
|
||||
int textX = x + 9 - (textWidth / 2);
|
||||
int textY = y + 18;
|
||||
|
||||
fontRenderer.drawString(costText, textX, textY, 0x000000);
|
||||
}
|
||||
|
||||
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, 18, 18);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
public class RadiusInfo {
|
||||
|
||||
private final int radius;
|
||||
private int prevX, prevY;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
// It's a circle with a dot in the center. Couldn't ask for a better item!
|
||||
private static final ItemStack item = new ItemStack(ModItems.demonPlacer);
|
||||
|
||||
public RadiusInfo(int radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public int getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public void onDraw(int x, int y) {
|
||||
prevX = x;
|
||||
prevY = y;
|
||||
|
||||
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), item, x, y);
|
||||
|
||||
String costText = StatCollector.translateToLocalFormatted("nei.recipe.meteor.radius", radius);
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
|
||||
int textWidth = fontRenderer.getStringWidth(costText);
|
||||
int textX = x + 9 - (textWidth / 2);
|
||||
int textY = y + 18;
|
||||
|
||||
fontRenderer.drawString(costText, textX, textY, 0x000000);
|
||||
}
|
||||
|
||||
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||
return new Rectangle(gui.guiLeft + prevX + 5, gui.guiTop + prevY + 15, 16, 16);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
public class ReagentInfo {
|
||||
|
||||
private final float scale;
|
||||
private int prevX, prevY;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
private static final ItemStack item = new ItemStack(ModBlocks.blockReagentConduit);
|
||||
|
||||
public ReagentInfo(float scale) {
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
public void onDraw(int x, int y) {
|
||||
prevX = x;
|
||||
prevY = y;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, 0);
|
||||
GL11.glScalef(scale, scale, 1.0f);
|
||||
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), item, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, (int) (18 * scale), (int) (18 * scale));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the text Reagent effects: to the tooltip list.
|
||||
*/
|
||||
public void onHover(List<String> list) {
|
||||
list.add(StatCollector.translateToLocal("nei.recipe.reagent.text"));
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
public class RitualInfo {
|
||||
|
||||
private final String id;
|
||||
private final int cost;
|
||||
private final float scale;
|
||||
private final ItemStack crystal;
|
||||
private int prevX, prevY;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
|
||||
public RitualInfo(String id, float scale) {
|
||||
this.id = id;
|
||||
this.scale = scale;
|
||||
this.cost = Rituals.getCostForActivation(id);
|
||||
Rituals r = Rituals.ritualMap.get(id);
|
||||
|
||||
// This is hardcoded unlike the orbs. I'm not aware of any addon that makes tier 3 rituals or crystals.
|
||||
if (r == null || r.crystalLevel == 1) {
|
||||
crystal = new ItemStack(ModItems.activationCrystal);
|
||||
} else {
|
||||
crystal = new ItemStack(ModItems.activationCrystal, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public void onDraw(int x, int y) {
|
||||
prevX = x;
|
||||
prevY = y;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, 0);
|
||||
GL11.glScalef(scale, scale, 1.0f);
|
||||
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), crystal, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, (int) (18 * scale), (int) (18 * scale));
|
||||
}
|
||||
|
||||
public void onHover(List<String> list) {
|
||||
list.add(
|
||||
StatCollector
|
||||
.translateToLocalFormatted("nei.recipe.ritual.name", Rituals.getLocalizedNameOfRitual(id)));
|
||||
list.add(StatCollector.translateToLocalFormatted("nei.recipe.ritual.cost", this.cost));
|
||||
}
|
||||
}
|
||||
@@ -5,21 +5,28 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockAlchemicCalcinator extends BlockContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon icon;
|
||||
|
||||
public BlockAlchemicCalcinator() {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
@@ -28,6 +35,18 @@ public class BlockAlchemicCalcinator extends BlockContainer {
|
||||
this.setBlockName("alchemicCalcinator");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.icon = iconRegister.registerIcon("AlchemicalWizardry:BlankRune");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TEAlchemicCalcinator();
|
||||
|
||||
@@ -3,8 +3,10 @@ package WayofTime.alchemicalWizardry.common.block;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -13,6 +15,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
@@ -26,12 +29,36 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBelljar extends BlockContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bottomIcon;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon otherIcon;
|
||||
|
||||
public BlockBelljar() {
|
||||
super(Material.glass);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("crystalBelljar");
|
||||
this.setStepSound(Block.soundTypeGlass);
|
||||
this.setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (side == 0) {
|
||||
return bottomIcon;
|
||||
}
|
||||
return otherIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.bottomIcon = iconRegister.registerIcon("minecraft:planks_oak");
|
||||
this.otherIcon = iconRegister.registerIcon("minecraft:glass");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -142,6 +142,9 @@ public class ItemIncense extends Item implements IIncense {
|
||||
ItemStack quartzStack = new ItemStack(Items.quartz, 1, WILDCARD);
|
||||
ItemStack blazePowderStack = new ItemStack(Items.blaze_powder);
|
||||
ItemStack netherwartStack = new ItemStack(Items.nether_wart);
|
||||
|
||||
ItemStack blankSlateStack = new ItemStack(ModItems.blankSlate);
|
||||
ItemStack reinforcedSlateStack = new ItemStack(ModItems.reinforcedSlate);
|
||||
ItemStack fracturedBoneStack = new ItemStack(ModItems.baseAlchemyItems, 1, 5);
|
||||
|
||||
ItemStack woodashStack = new ItemStack(ModItems.itemIncense, 1, 0);
|
||||
@@ -156,7 +159,7 @@ public class ItemIncense extends Item implements IIncense {
|
||||
new ItemStack(Items.redstone),
|
||||
leavesStack,
|
||||
leavesStack,
|
||||
new ItemStack(ModItems.apprenticeBloodOrb)));
|
||||
new ItemStack(ModItems.weakBloodOrb)));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapelessBloodOrbRecipe(
|
||||
new ItemStack(ModItems.itemIncense, 1, 2),
|
||||
@@ -168,7 +171,7 @@ public class ItemIncense extends Item implements IIncense {
|
||||
glowstoneStack,
|
||||
stringStack,
|
||||
stringStack,
|
||||
new ItemStack(ModItems.magicianBloodOrb)));
|
||||
new ItemStack(ModItems.apprenticeBloodOrb)));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapelessBloodOrbRecipe(
|
||||
new ItemStack(ModItems.itemIncense, 1, 3),
|
||||
@@ -178,7 +181,8 @@ public class ItemIncense extends Item implements IIncense {
|
||||
soulSandStack,
|
||||
gunpowderStack,
|
||||
fermentedEyeStack,
|
||||
new ItemStack(ModItems.masterBloodOrb)));
|
||||
blankSlateStack,
|
||||
new ItemStack(ModItems.apprenticeBloodOrb)));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapelessBloodOrbRecipe(
|
||||
new ItemStack(ModItems.itemIncense, 1, 4),
|
||||
@@ -189,17 +193,17 @@ public class ItemIncense extends Item implements IIncense {
|
||||
netherwartStack,
|
||||
blazePowderStack,
|
||||
fracturedBoneStack,
|
||||
goldNuggetStack,
|
||||
new ItemStack(ModItems.archmageBloodOrb)));
|
||||
reinforcedSlateStack,
|
||||
new ItemStack(ModItems.magicianBloodOrb)));
|
||||
}
|
||||
|
||||
public enum EnumIncense {
|
||||
|
||||
WOODASH(0, 200, 1.0f, 1000, 0.937f, 0.898f, 0.820f),
|
||||
RED(200, 600, 1.5f, 1000, 1.0f, 0, 0),
|
||||
BLUE(600, 1200, 3.0f, 1000, 0, 0, 1.0f),
|
||||
GREEN(1200, 2000, 4.0f, 1000, 0, 1.0f, 0),
|
||||
PURPLE(2000, 3000, 5.0f, 1000, 1.0f, 0, 1.0f);
|
||||
WOODASH(0, 400, 1.0f, 2000, 0.937f, 0.898f, 0.820f),
|
||||
RED(400, 800, 1.5f, 2000, 1.0f, 0, 0),
|
||||
BLUE(800, 1500, 3.0f, 2000, 0, 0, 1.0f),
|
||||
GREEN(1500, 2400, 4.0f, 2000, 0, 1.0f, 0),
|
||||
PURPLE(2400, 3500, 5.0f, 2000, 1.0f, 0, 1.0f);
|
||||
|
||||
public final int minValue;
|
||||
public final int maxValue;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.AlchemicalWizardry.allowPotionRepair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -347,4 +349,10 @@ public class AlchemyFlask extends Item {
|
||||
potionStack.getTagCompound().setTag("CustomPotionEffects", nbttaglist);
|
||||
return new EntityPotion(worldObj, entityLivingBase, potionStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
if (allowPotionRepair) return super.isRepairable();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -87,13 +87,13 @@ public class Meteor {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getNewRadius(int radius, List<Reagent> reagents) {
|
||||
private int getNewRadius(int radius, List<Reagent> reagents) {
|
||||
radius += MeteorReagentRegistry.getLargestRadiusIncrease(reagents);
|
||||
radius += MeteorReagentRegistry.getLargestRadiusDecrease(reagents);
|
||||
return Math.max(radius, 1);
|
||||
}
|
||||
|
||||
public static float getNewFillerChance(float fillerChance, List<Reagent> reagents) {
|
||||
private float getNewFillerChance(float fillerChance, List<Reagent> reagents) {
|
||||
// Don't add filler to meteors that have none
|
||||
if (fillerChance <= 0) {
|
||||
return 0;
|
||||
@@ -120,7 +120,7 @@ public class Meteor {
|
||||
* @return a new filler list. The original list is entirely replaced if any of the supplied reagents have a filler
|
||||
* config.
|
||||
*/
|
||||
public static List<MeteorComponent> getNewFillerList(List<MeteorComponent> fillerList, List<Reagent> reagents) {
|
||||
private List<MeteorComponent> getNewFillerList(List<MeteorComponent> fillerList, List<Reagent> reagents) {
|
||||
List<MeteorComponent> reagentFillers = getFillerList(reagents);
|
||||
reagentFillers = removeBlocksMissingRequiredReagents(reagentFillers, reagents);
|
||||
if (!reagentFillers.isEmpty() && reagentFillers.get(0) != defaultMeteorBlock) {
|
||||
@@ -129,7 +129,7 @@ public class Meteor {
|
||||
return removeBlocksMissingRequiredReagents(fillerList, reagents);
|
||||
}
|
||||
|
||||
public static List<MeteorComponent> removeBlocksMissingRequiredReagents(List<MeteorComponent> blockList,
|
||||
private List<MeteorComponent> removeBlocksMissingRequiredReagents(List<MeteorComponent> blockList,
|
||||
List<Reagent> reagents) {
|
||||
ArrayList<MeteorComponent> newList = new ArrayList<>();
|
||||
for (MeteorComponent component : blockList) {
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
* Original class by https://github.com/Superfrogman98, copied with permission Original PR:
|
||||
* https://github.com/GTNewHorizons/StructureCompat/pull/6 Link to message giving permission (GT: New Horizons Discord
|
||||
* server): https://discord.com/channels/181078474394566657/603348502637969419/1367345532376453130
|
||||
*/
|
||||
|
||||
package WayofTime.alchemicalWizardry.compat.structurelib;
|
||||
|
||||
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
|
||||
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta;
|
||||
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
|
||||
import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.gtnewhorizon.structurelib.alignment.constructable.IMultiblockInfoContainer;
|
||||
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
|
||||
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
|
||||
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
|
||||
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.BlockStack;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
|
||||
public class AltarStructure {
|
||||
|
||||
private static final String STRUCTURE_ALTAR = "tier1";
|
||||
private static final String STRUCTURE_TIER_2 = "tier2";
|
||||
private static final String STRUCTURE_TIER_3 = "tier3";
|
||||
private static final String STRUCTURE_TIER_4 = "tier4";
|
||||
private static final String STRUCTURE_TIER_5 = "tier5";
|
||||
private static final String STRUCTURE_TIER_6 = "tier6";
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static final AnyBlock ANY_BLOCK = new AnyBlock();
|
||||
|
||||
public static final int[][] TIER_OFFSET = { { 0, 0, 0 }, { 1, -1, 1 }, { 3, 1, 3 }, { 5, 2, 5 }, { 8, -3, 8 },
|
||||
{ 11, 3, 11 } };
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void registerAltarStructureInfo() {
|
||||
StructureDefinition.Builder<TEAltar> altarBuilder = IStructureDefinition.builder();
|
||||
String T6_S = " ";
|
||||
String T6_SR = "r r";
|
||||
// region Structure
|
||||
// spotless:off
|
||||
altarBuilder
|
||||
.addShape(STRUCTURE_ALTAR, new String[][] {{"a"}})
|
||||
.addShape(STRUCTURE_TIER_2, transpose(new String[][] {{"rrr","r r","rrr"}}))
|
||||
.addShape(STRUCTURE_TIER_3, transpose(new String[][] {{"g g"," "," "," "," "," ","g g"},
|
||||
{"t t"," "," "," "," "," ","t t"},
|
||||
{"t t"," "," "," "," "," ","t t"},
|
||||
{" rrrrr ","r r","r r","r r","r r","r r"," rrrrr "}}))
|
||||
.addShape(STRUCTURE_TIER_4, transpose(new String[][]
|
||||
{{"b b"," "," "," "," "," "," "," "," "," ","b b"},
|
||||
{"v v"," "," "," "," "," "," "," "," "," ","v v"},
|
||||
{"v v"," "," "," "," "," "," "," "," "," ","v v"},
|
||||
{"v v"," "," "," "," "," "," "," "," "," ","v v"},
|
||||
{"v v"," "," "," "," "," "," "," "," "," ","v v"},
|
||||
{" rrrrrrr "," ","r r","r r","r r","r r","r r","r r","r r"," "," rrrrrrr "}}))
|
||||
.addShape(STRUCTURE_TIER_5, transpose(new String[][] {{"e e"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","e e"},
|
||||
{" rrrrrrrrrrrrr "," ","r r","r r","r r","r r","r r","r r","r r","r r","r r","r r","r r","r r","r r"," "," rrrrrrrrrrrrr "}}))
|
||||
.addShape(STRUCTURE_TIER_6, transpose(new String[][]
|
||||
{
|
||||
{"c c",T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,"c c"},
|
||||
{"i i",T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,"i i"},
|
||||
{"i i",T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,"i i"},
|
||||
{"i i",T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,"i i"},
|
||||
{"i i",T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,"i i"},
|
||||
{"i i",T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,"i i"},
|
||||
{"i i",T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,"i i"},
|
||||
{"i i",T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,T6_S,"i i"},
|
||||
{" rrrrrrrrrrrrrrrrrrr ",T6_S,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_SR,T6_S, " rrrrrrrrrrrrrrrrrrr "},
|
||||
}))
|
||||
.addElement('a',ofBlock(ModBlocks.blockAltar,0))
|
||||
.addElement('r',ofChain(ofBlockAnyMeta(ModBlocks.bloodRune),ofBlockAnyMeta(ModBlocks.speedRune),ofBlockAnyMeta(ModBlocks.runeOfSelfSacrifice),ofBlockAnyMeta(ModBlocks.runeOfSacrifice),ofBlockAnyMeta(ModBlocks.efficiencyRune)));
|
||||
|
||||
char[] keys = {'t', 'g', 'v', 'b', 'e', 'i', 'c'};
|
||||
for (int i = 0; i < keys.length; i++) {
|
||||
BlockStack stack = AlchemicalWizardry.specialAltarBlock[i];
|
||||
if (stack != null && stack.getBlock() != Blocks.air) {
|
||||
altarBuilder.addElement(keys[i], ofBlock(stack.getBlock(), stack.getMeta()));
|
||||
} else {
|
||||
altarBuilder.addElement(keys[i], ANY_BLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
IMultiblockInfoContainer.registerTileClass(TEAltar.class,
|
||||
new AltarStructure.AltarMultiblockInfoContainer(altarBuilder.build()));
|
||||
// spotless:on
|
||||
}
|
||||
|
||||
private static class AltarMultiblockInfoContainer implements IMultiblockInfoContainer<TEAltar> {
|
||||
|
||||
private final IStructureDefinition<TEAltar> structureAltar;
|
||||
|
||||
public AltarMultiblockInfoContainer(IStructureDefinition<TEAltar> structureAltar) {
|
||||
this.structureAltar = structureAltar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void construct(ItemStack triggerStack, boolean hintsOnly, TEAltar ctx, ExtendedFacing aSide) {
|
||||
int tier = triggerStack.stackSize;
|
||||
if (tier > 6) {
|
||||
tier = 6;
|
||||
}
|
||||
for (int i = 1; i <= tier; i++) {
|
||||
this.structureAltar.buildOrHints(
|
||||
ctx,
|
||||
triggerStack,
|
||||
"tier" + i,
|
||||
ctx.getWorldObj(),
|
||||
ExtendedFacing.DEFAULT,
|
||||
ctx.xCoord,
|
||||
ctx.yCoord,
|
||||
ctx.zCoord,
|
||||
TIER_OFFSET[i - 1][0],
|
||||
TIER_OFFSET[i - 1][1],
|
||||
TIER_OFFSET[i - 1][2],
|
||||
hintsOnly);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int survivalConstruct(ItemStack triggerStack, int elementBudge, ISurvivalBuildEnvironment env,
|
||||
TEAltar altar, ExtendedFacing aSide) {
|
||||
int built = 0;
|
||||
int tier = triggerStack.stackSize;
|
||||
if (tier > 6) {
|
||||
tier = 6;
|
||||
}
|
||||
if (altar.getTier() >= tier) return -1;
|
||||
|
||||
for (int i = 1; i <= tier; i++) {
|
||||
built += this.structureAltar.survivalBuild(
|
||||
altar,
|
||||
triggerStack,
|
||||
"tier" + i,
|
||||
altar.getWorldObj(),
|
||||
ExtendedFacing.DEFAULT,
|
||||
altar.xCoord,
|
||||
altar.yCoord,
|
||||
altar.zCoord,
|
||||
TIER_OFFSET[i - 1][0],
|
||||
TIER_OFFSET[i - 1][1],
|
||||
TIER_OFFSET[i - 1][2],
|
||||
elementBudge,
|
||||
env,
|
||||
false);
|
||||
}
|
||||
return built;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDescription(ItemStack stackSize) {
|
||||
ArrayList<String> out = new ArrayList<>();
|
||||
out.add(StatCollector.translateToLocal("structurelib.bloodmagic.altar.1"));
|
||||
out.add(StatCollector.translateToLocal("structurelib.bloodmagic.altar.2"));
|
||||
|
||||
int[] pillarIndices = { 0, 2, 5 };
|
||||
int[] pillarTiers = { 3, 4, 6 };
|
||||
ArrayList<Integer> pillars = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < pillarIndices.length; i++) {
|
||||
if (AlchemicalWizardry.specialAltarBlock[pillarIndices[i]].getBlock() == Blocks.air) {
|
||||
pillars.add(pillarTiers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!pillars.isEmpty()) {
|
||||
out.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"structurelib.bloodmagic.altar.3",
|
||||
Joiner.on(", ").join(pillars)));
|
||||
}
|
||||
|
||||
int[] capIndices = { 1, 3, 6 };
|
||||
int[] capTiers = { 3, 4, 6 };
|
||||
ArrayList<Integer> caps = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < capIndices.length; i++) {
|
||||
if (AlchemicalWizardry.specialAltarBlock[capIndices[i]].getBlock() == Blocks.air) {
|
||||
caps.add(capTiers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!caps.isEmpty()) {
|
||||
out.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"structurelib.bloodmagic.altar.4",
|
||||
Joiner.on(", ").join(caps)));
|
||||
}
|
||||
|
||||
if (AlchemicalWizardry.specialAltarBlock[4].getBlock() == Blocks.air) { // T5 Beacon
|
||||
out.add(StatCollector.translateToLocal("structurelib.bloodmagic.altar.5"));
|
||||
}
|
||||
|
||||
return out.toArray(new String[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package WayofTime.alchemicalWizardry.compat.structurelib;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.gtnewhorizon.structurelib.StructureLibAPI;
|
||||
import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment;
|
||||
import com.gtnewhorizon.structurelib.structure.IStructureElement;
|
||||
|
||||
public class AnyBlock<T> implements IStructureElement<T> {
|
||||
|
||||
@Override
|
||||
public boolean check(Object t, World world, int x, int y, int z) {
|
||||
return !world.isAirBlock(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean couldBeValid(Object t, World world, int x, int y, int z, ItemStack trigger) {
|
||||
return check(t, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) {
|
||||
StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 14);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) {
|
||||
world.setBlock(x, y, z, Blocks.stonebrick, 0, 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlocksToPlace getBlocksToPlace(Object o, World world, int x, int y, int z, ItemStack trigger,
|
||||
AutoPlaceEnvironment env) {
|
||||
return BlocksToPlace.create(Blocks.stonebrick, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlaceResult survivalPlaceBlock(Object o, World world, int x, int y, int z, ItemStack trigger,
|
||||
AutoPlaceEnvironment env) {
|
||||
if (world.provider.dimensionId == Integer.MAX_VALUE) { // Required for the NEI preview to work
|
||||
world.setBlock(x, y, z, Blocks.stonebrick, 0, 2);
|
||||
return PlaceResult.ACCEPT;
|
||||
}
|
||||
return PlaceResult.SKIP;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package WayofTime.alchemicalWizardry.compat.structurelib;
|
||||
|
||||
public class CompatStructureLib {
|
||||
|
||||
public static void init() {
|
||||
AltarStructure.registerAltarStructureInfo();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.6 KiB |
@@ -275,24 +275,12 @@ text.recipe.altar.tier=Tier: %s
|
||||
text.recipe.altar.bloodRequired=LP: %s
|
||||
text.recipe.shapedOrb=Shaped Orb Recipe
|
||||
nei.recipe.meteor.category=Meteor Ritual
|
||||
nei.recipe.meteor.cost=LP cost to summon this meteor
|
||||
nei.recipe.meteor.tooExpensive=Insufficient LP in Soul Network
|
||||
nei.recipe.meteor.cost=Cost: %s LP
|
||||
nei.recipe.meteor.radius=Radius: %s
|
||||
nei.recipe.meteor.diameter=Diameter: %d (2r + 1)
|
||||
nei.recipe.meteor.chance=Chance: %s%%
|
||||
nei.recipe.meteor.amount=Estimated amount: %s
|
||||
nei.recipe.meteor.filler=§7Filler block
|
||||
nei.recipe.meteor.reagent=§nRequired reagent§r: %s
|
||||
nei.recipe.ritual.name=Ritual Name: %s
|
||||
nei.recipe.ritual.cost=Activation Cost: %,d
|
||||
nei.recipe.reagent.text=Reagent Effects:
|
||||
nei.recipe.reagent.meteor.radius= %+d radius (%s)
|
||||
nei.recipe.reagent.meteor.filler.chance= Changes chance for filler block to %f%%
|
||||
nei.recipe.reagent.meteor.filler.blocks= Replaces filler with %s
|
||||
nei.recipe.reagent.meteor.explosions= Entirely disables meteor explosions
|
||||
nei.recipe.reagent.meteor.blockDamage.on= Enables meteor block damage
|
||||
nei.recipe.reagent.meteor.blockDamage.off= Disables meteor block damage
|
||||
nei.recipe.reagent.none=No reagents can be added to this ritual.
|
||||
|
||||
#Rituals
|
||||
ritual.AW001Water.name=Ritual of the Full Spring
|
||||
@@ -652,3 +640,10 @@ option.bm.bloodAltar=Blood Altar
|
||||
option.bm.ritualController=Ritual Stones
|
||||
option.bm.teleposer=Teleposer
|
||||
option.bm.chemistrySet=Alchemical Chemistry Set
|
||||
|
||||
# StructureLib
|
||||
structurelib.bloodmagic.altar.1=Blood Altar
|
||||
structurelib.bloodmagic.altar.2=Hold 1-6 Hologram Projectors to determine the tier
|
||||
structurelib.bloodmagic.altar.3=Tier %s pillars accept any block
|
||||
structurelib.bloodmagic.altar.4=Tier %s caps accept any block
|
||||
structurelib.bloodmagic.altar.5=Tier 5 beacons accept any block
|
||||
Reference in new issue
Block a user