mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Compare commits
1
Commits
1.3.17
..
1.3.11-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b1be24b1d |
No files matched your search
+3
-3
@@ -6,7 +6,7 @@ dependencies {
|
||||
transitive = false
|
||||
}
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.9.5-GTNH:api") {
|
||||
compileOnly("com.github.GTNewHorizons:Botania:master-SNAPSHOT:api") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:api") {
|
||||
@@ -17,14 +17,14 @@ dependencies {
|
||||
}
|
||||
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.20-GTNH:dev") {
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.2.7-GTNH:dev") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:2.10.6-GTNH:api") {
|
||||
transitive = false
|
||||
}
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {
|
||||
compileOnly("com.github.GTNewHorizons:ZenScript:master-SNAPSHOT") {
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.6:dev") {
|
||||
|
||||
@@ -5,31 +5,18 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class IMCForNEI {
|
||||
public static void IMCSender() {
|
||||
sendHandler("alchemicalwizardry.meteor", "AWWayofTime:masterStone", 130);
|
||||
sendCatalyst("alchemicalwizardry.meteor", "AWWayofTime:masterStone");
|
||||
setNBTAndSend("WayofTime.alchemicalWizardry.client.nei.NEIMeteorRecipeHandler", "AWWayofTime:masterStone", 130);
|
||||
}
|
||||
|
||||
private static void sendHandler(String handlerName, String stack, int height) {
|
||||
private static void setNBTAndSend(String handlerName, String aBlock, int height) {
|
||||
NBTTagCompound NBT = new NBTTagCompound();
|
||||
NBT.setString("handler", handlerName);
|
||||
NBT.setString("modName", "Blood Magic");
|
||||
NBT.setString("modId", "AWWayofTime");
|
||||
NBT.setBoolean("modRequired", true);
|
||||
NBT.setString("itemName", stack);
|
||||
NBT.setString("itemName", aBlock);
|
||||
NBT.setInteger("handlerHeight", height);
|
||||
NBT.setInteger("maxRecipesPerPage", 1);
|
||||
FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", NBT);
|
||||
}
|
||||
|
||||
private static void sendCatalyst(String handlerName, String stack, int priority) {
|
||||
NBTTagCompound aNBT = new NBTTagCompound();
|
||||
aNBT.setString("handlerID", handlerName);
|
||||
aNBT.setString("itemName", stack);
|
||||
aNBT.setInteger("priority", priority);
|
||||
FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT);
|
||||
}
|
||||
|
||||
private static void sendCatalyst(String handlerName, String stack) {
|
||||
sendCatalyst(handlerName, stack, 0);
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class NEIAltarRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> currenttip, int id) {
|
||||
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int id) {
|
||||
super.handleTooltip(gui, currenttip, id);
|
||||
Point mouse = GuiDraw.getMousePosition();
|
||||
Point root = gui.getRecipePosition(id);
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.awt.*;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
@@ -26,45 +25,34 @@ import java.util.stream.Collectors;
|
||||
public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
public class CachedMeteorRecipe extends CachedRecipe {
|
||||
|
||||
private final List<MeteorParadigmComponent> components;
|
||||
private final List<PositionedStack> input = new ArrayList<>();
|
||||
private final List<PositionedStack> outputs = new ArrayList<>();
|
||||
private final int cost;
|
||||
private final int radius;
|
||||
private Point focus;
|
||||
|
||||
public CachedMeteorRecipe(MeteorParadigm meteor, ItemStack focusStack) {
|
||||
public CachedMeteorRecipe(MeteorParadigm meteor) {
|
||||
this.components = meteor.componentList;
|
||||
this.input.add(new PositionedStack(meteor.focusStack, 74, 4));
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
float totalMeteorWeight = meteor.getTotalMeteorWeight();
|
||||
List<MeteorParadigmComponent> sortedComponents = new ArrayList<>(meteor.componentList);
|
||||
sortedComponents.sort(Comparator.comparingInt(c -> -c.chance));
|
||||
|
||||
for (MeteorParadigmComponent component : sortedComponents) {
|
||||
|
||||
for (MeteorParadigmComponent component : meteor.componentList) {
|
||||
ItemStack stack = component.getValidBlockParadigm();
|
||||
int xPos = 3 + 18 * col;
|
||||
int yPos = 37 + 18 * row;
|
||||
|
||||
List<String> tooltips = new ArrayList<>();
|
||||
if (stack == null) {
|
||||
stack = new ItemStack(Blocks.fire);
|
||||
tooltips.add(String.format("no entries found for oredict \"%s\"", component.getOreDictName()));
|
||||
}
|
||||
float chance = component.getChance() / totalMeteorWeight;
|
||||
tooltips.add(I18n.format("nei.recipe.meteor.chance", getFormattedChance(chance)));
|
||||
tooltips.add(I18n.format("nei.recipe.meteor.amount", getEstimatedAmount(chance, meteor.radius)));
|
||||
this.outputs.add(new TooltipStack(stack, xPos, yPos, tooltips));
|
||||
|
||||
tooltips.add(I18n.format("nei.recipe.meteor.chance", getFormattedChance(component.getChance() / totalMeteorWeight)));
|
||||
this.outputs.add(new TooltipStack(stack, 3 + 18 * col, 37 + 18 * row, tooltips));
|
||||
col++;
|
||||
if (col > 8) {
|
||||
col = 0;
|
||||
row++;
|
||||
}
|
||||
|
||||
if (focusStack != null && matchItem(focusStack, stack)) {
|
||||
this.focus = new Point(xPos - 1, yPos - 1);
|
||||
}
|
||||
}
|
||||
this.radius = meteor.radius;
|
||||
this.cost = meteor.cost;
|
||||
@@ -85,6 +73,10 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
return this.outputs;
|
||||
}
|
||||
|
||||
public List<MeteorParadigmComponent> getComponents() {
|
||||
return components;
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
@@ -103,7 +95,7 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(getOverlayIdentifier()) && getClass() == NEIMeteorRecipeHandler.class) {
|
||||
for (MeteorParadigm meteor : getSortedMeteors()) {
|
||||
arecipes.add(new CachedMeteorRecipe(meteor, null));
|
||||
arecipes.add(new CachedMeteorRecipe(meteor));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
@@ -113,8 +105,8 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (MeteorParadigm meteor : getSortedMeteors()) {
|
||||
if (meteor.componentList.stream().anyMatch(m -> matchItem(result, m.getValidBlockParadigm()))) {
|
||||
arecipes.add(new CachedMeteorRecipe(meteor, result));
|
||||
if (meteor.componentList.stream().anyMatch(m -> NEIServerUtils.areStacksSameTypeCrafting(result, m.getValidBlockParadigm()))) {
|
||||
arecipes.add(new CachedMeteorRecipe(meteor));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,25 +114,12 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
for (MeteorParadigm meteor : getSortedMeteors()) {
|
||||
if (matchItem(ingredient, meteor.focusStack)) {
|
||||
arecipes.add(new CachedMeteorRecipe(meteor, null));
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, meteor.focusStack)) {
|
||||
arecipes.add(new CachedMeteorRecipe(meteor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean matchItem(ItemStack compared, ItemStack compareTo) {
|
||||
if (compared == null || compareTo == null) return false;
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(compared, compareTo)) {
|
||||
return true;
|
||||
}
|
||||
// ignore ore variants (like basalt ore)
|
||||
if (compared.getUnlocalizedName().startsWith("gt.blockores")
|
||||
&& compareTo.getUnlocalizedName().startsWith("gt.blockores")) {
|
||||
return compared.getItemDamage() % 1000 == compareTo.getItemDamage() % 1000;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return new ResourceLocation("alchemicalwizardry", "gui/nei/meteor.png").toString();
|
||||
@@ -161,20 +140,14 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 166, 202);
|
||||
|
||||
CachedMeteorRecipe recipe = (CachedMeteorRecipe) this.arecipes.get(recipeIndex);
|
||||
Point focus = recipe.focus;
|
||||
if (focus != null) {
|
||||
GuiDraw.drawTexturedModalRect(focus.x, focus.y, 172, 0, 18, 18);
|
||||
}
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 172, 202);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack stack, List<String> currenttip, int recipe) {
|
||||
public List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe) {
|
||||
CachedMeteorRecipe meteorRecipe = (CachedMeteorRecipe) this.arecipes.get(recipe);
|
||||
for (PositionedStack pStack : meteorRecipe.outputs) {
|
||||
if (!gui.isMouseOver(pStack, recipe)) continue;
|
||||
@@ -202,10 +175,9 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
|
||||
private String getFormattedChance(float chance) {
|
||||
return new DecimalFormat("0.##").format(chance * 100);
|
||||
}
|
||||
|
||||
private int getEstimatedAmount(float chance, int radius) {
|
||||
return (int) Math.ceil(3f / 4 * Math.PI * Math.pow(radius, 3) * chance);
|
||||
float percentage = chance * 100.0f;
|
||||
boolean isInteger = percentage - (int) percentage <= 0.01;
|
||||
if (isInteger) return String.format("%,d", (int) percentage);
|
||||
else return String.format("%,.1f", percentage);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -158,7 +159,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
||||
{
|
||||
return super.getItemStackDisplayName(stack);
|
||||
}
|
||||
return StatCollector.translateToLocalFormatted("bm.string.ritualDiviner", Rituals.getLocalizedNameOfRitual(ritualID));
|
||||
return I18n.format("bm.string.ritualDiviner", Rituals.getLocalizedNameOfRitual(ritualID));
|
||||
} else
|
||||
{
|
||||
return super.getItemStackDisplayName(stack);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.5 KiB |
@@ -265,7 +265,6 @@ nei.recipe.meteor.category=Meteor Ritual
|
||||
nei.recipe.meteor.cost=Cost: %s LP
|
||||
nei.recipe.meteor.radius=Radius: %s
|
||||
nei.recipe.meteor.chance=Chance: %s%%
|
||||
nei.recipe.meteor.amount=Estimated amount: %s
|
||||
|
||||
#Rituals
|
||||
ritual.AW001Water.name=Ritual of the Full Spring
|
||||
@@ -369,6 +368,8 @@ commands.bind.remove.success=Unbinding successful
|
||||
commands.orb.usage=/bloodmagic orb [set|get] player [tier]
|
||||
commands.orb.help=Used to set or get the Player's max Blood Orb tier.
|
||||
|
||||
commands.bind.usage=/bind <player>
|
||||
commands.bind.success=Item successfully bound!
|
||||
commands.bind.failed.noPlayer=There is no player specified
|
||||
commands.bind.failed.alreadyBound=Item is already bound; use /unbind to unbind it
|
||||
commands.bind.failed.notBindable=Item cannot be bound
|
||||
|
||||
@@ -277,7 +277,7 @@ entity.AWWayofTime.MinorDemonGrunt.name=Демон Грунт
|
||||
|
||||
#Commands
|
||||
commands.soulnetwork.usage=/soulnetwork <игрок>
|
||||
commands.bind.usage=/bloodmagic bind [true|false] <игрок>
|
||||
commands.bind.usage=/bind <игрок>
|
||||
commands.bind.success=Предмет успешно привязан!
|
||||
commands.bind.failed.noPlayer=Игрок не выбран
|
||||
commands.bind.failed.alreadyBound=Предмет уже привязан; используйте /unbind для отвязки
|
||||
|
||||
@@ -265,7 +265,6 @@ nei.recipe.meteor.category=陨星仪式
|
||||
nei.recipe.meteor.cost=消耗: %s LP
|
||||
nei.recipe.meteor.radius=半径: %s
|
||||
nei.recipe.meteor.chance=几率: %s%%
|
||||
nei.recipe.meteor.amount=期望数量: %s
|
||||
|
||||
#Rituals
|
||||
ritual.AW001Water.name=涌泉仪式
|
||||
@@ -361,14 +360,16 @@ commands.network.fill.success=成功填充 %s 的LP网络.
|
||||
commands.network.cap.help=将指定玩家的LP网络填充到其持有的最高级气血宝珠可以存储的最大值。
|
||||
commands.network.cap.success=成功锁定了 %s 的LP网络.
|
||||
|
||||
commands.bind.usage=/bloodmagic bind [true|false] [玩家]
|
||||
commands.bind.usage=/bind <玩家>
|
||||
commands.bind.help=尝试将手持物品绑定(解绑)
|
||||
commands.bind.success=绑定成功
|
||||
commands.bind.success=物品成功绑定!
|
||||
commands.bind.remove.success=解绑成功
|
||||
|
||||
commands.orb.usage=/bloodmagic orb [set|get] player [等级]
|
||||
commands.orb.help=用来设定或获取指定玩家的最高等级气血宝珠.
|
||||
|
||||
commands.bind.usage=/bind <玩家>
|
||||
commands.bind.success=物品成功绑定!
|
||||
commands.bind.failed.noPlayer=没有指定玩家
|
||||
commands.bind.failed.alreadyBound=物品已经被绑定; 使用 /unbind 来解除绑定
|
||||
commands.bind.failed.notBindable=物品无法被绑定
|
||||
@@ -606,4 +607,5 @@ bm.versioning.doneDownloading=已完成下载 %s 重新加载您的游戏以进
|
||||
bm.versioning.error=下载mod时出错!
|
||||
bm.versioning.downloadedAlready=你已经拥有最新版本,重新加载游戏以进行更新!
|
||||
bm.versioning.downloadingAlready=正在下载! 耐心点!
|
||||
bm.versioning.disabled=此功能已禁用.
|
||||
bm.versioning.disabled=此功能已禁用.
|
||||
|
||||
@@ -284,7 +284,7 @@ entity.AWWayofTime.MinorDemonGrunt.name=格倫魔
|
||||
|
||||
#Commands
|
||||
commands.soulnetwork.usage=/soulnetwork <玩家>
|
||||
commands.bind.usage=/bloodmagic bind [true|false] <玩家>
|
||||
commands.bind.usage=/bind <玩家>
|
||||
commands.bind.success=物品成功綁定!
|
||||
commands.bind.failed.noPlayer=沒有指定玩家
|
||||
commands.bind.failed.alreadyBound=物品已經被綁定; 使用 /unbind 來解除綁定
|
||||
|
||||
Reference in new issue
Block a user