mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab08e6dd7b | ||
|
|
8dbbe9c069 | ||
|
|
49485fc6ac | ||
|
|
7a23bb7e24 | ||
|
|
97666386b1 | ||
|
|
df191ea45e | ||
|
|
d630bfb2e0 | ||
|
|
c0b4b797c8 | ||
|
|
bd584c6d52 |
No files matched your search
+5
-5
@@ -23,13 +23,13 @@
|
||||
*/
|
||||
|
||||
dependencies {
|
||||
api("com.github.GTNewHorizons:waila:1.8.2:dev")
|
||||
api("com.github.GTNewHorizons:NotEnoughItems:2.7.23-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:waila:1.8.4:dev")
|
||||
api("com.github.GTNewHorizons:NotEnoughItems:2.7.34-GTNH:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.85:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.203:dev") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.12.5-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.10.1:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.12.6-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.10.5: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 }
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -206,7 +205,7 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.31'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.37'
|
||||
}
|
||||
|
||||
|
||||
@@ -665,10 +665,19 @@ public class BloodMagicConfiguration {
|
||||
new BlockStack(ModBlocks.bloodRune, 6) });
|
||||
AlchemicalWizardry.specialAltarBlock = getAltarRunesForTier(
|
||||
"specialBlocks",
|
||||
new BlockStack[] { new BlockStack(Blocks.stonebrick, 0), new BlockStack(Blocks.glowstone, 0),
|
||||
new BlockStack(Blocks.stonebrick, 0), new BlockStack(ModBlocks.largeBloodStoneBrick, 0),
|
||||
new BlockStack(Blocks.beacon, 0), new BlockStack(Blocks.stonebrick, 0),
|
||||
new BlockStack(ModBlocks.blockCrystal, 0) });
|
||||
new BlockStack[] { new BlockStack(Blocks.air, 0), new BlockStack(Blocks.glowstone, 0),
|
||||
new BlockStack(Blocks.air, 0), new BlockStack(ModBlocks.largeBloodStoneBrick, 0),
|
||||
new BlockStack(Blocks.beacon, 0), new BlockStack(Blocks.air, 0),
|
||||
new BlockStack(ModBlocks.blockCrystal, 0) },
|
||||
"Set the special blocks for the altar with the format mod:block(:meta) in the following order:\n"
|
||||
+ "Tier 3 pillar\n"
|
||||
+ "Tier 3 cap\n"
|
||||
+ "Tier 4 pillar\n"
|
||||
+ "Tier 4 cap\n"
|
||||
+ "Tier 5 beacon\n"
|
||||
+ "Tier 6 pillar\n"
|
||||
+ "Tier 6 cap\n"
|
||||
+ "Set any of these to minecraft:air to allow for that component to be any block EXCEPT air (e.g., let any block be used for a pillar).");
|
||||
config.save();
|
||||
}
|
||||
|
||||
@@ -808,12 +817,16 @@ public class BloodMagicConfiguration {
|
||||
}
|
||||
|
||||
private static BlockStack[] getAltarRunesForTier(String tierName, BlockStack[] defaultValues) {
|
||||
return getAltarRunesForTier(tierName, defaultValues, "");
|
||||
}
|
||||
|
||||
private static BlockStack[] getAltarRunesForTier(String tierName, BlockStack[] defaultValues, String comment) {
|
||||
String[] defaultNames = new String[defaultValues.length];
|
||||
for (int i = 0; i < defaultValues.length; i++) {
|
||||
defaultNames[i] = Block.blockRegistry.getNameForObject(defaultValues[i].getBlock()) + ":"
|
||||
+ defaultValues[i].getMeta();
|
||||
}
|
||||
Property property = config.get("rune overrides", tierName, defaultNames);
|
||||
Property property = config.get("rune overrides", tierName, defaultNames, comment);
|
||||
String[] names = property.getStringList();
|
||||
if (names.length != defaultNames.length) {
|
||||
property.set(defaultNames);
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -173,7 +174,7 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
if (meteor.ores.stream().anyMatch(m -> matchItem(result, m.getBlock()))) {
|
||||
arecipes.add(new CachedMeteorRecipe(meteor, result));
|
||||
}
|
||||
if (meteor.filler.stream().anyMatch(m -> matchItem(result, m.getBlock()))) {
|
||||
if (meteor.fillerChance > 0 && meteor.filler.stream().anyMatch(m -> matchItem(result, m.getBlock()))) {
|
||||
arecipes.add(new CachedMeteorRecipe(meteor, result));
|
||||
}
|
||||
}
|
||||
@@ -193,11 +194,34 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(compared, compareTo)) {
|
||||
return true;
|
||||
}
|
||||
// ignore ore variants (like basalt ore)
|
||||
|
||||
// Ignore GregTech ore variants (like basalt ore)
|
||||
if (compared.getUnlocalizedName().startsWith("gt.blockores")
|
||||
&& compareTo.getUnlocalizedName().startsWith("gt.blockores")) {
|
||||
return compared.getItemDamage() % 1000 == compareTo.getItemDamage() % 1000;
|
||||
}
|
||||
|
||||
// Check oredicts for ores. Checks for direct matches (oreIron with oreIron) as well as IC2/GT crushed ores
|
||||
// (crushedGold with oreGold), EFR raw ores (rawCopper with oreCopper (although those all seem to have oreX
|
||||
// anyways)), and GT:NH raw ores (rawOreDiamond with oreDiamond).
|
||||
String[] prefixes = { "crushed", "rawOre", "raw" };
|
||||
for (int i : OreDictionary.getOreIDs(compareTo)) {
|
||||
String s1 = OreDictionary.getOreName(i);
|
||||
if (s1.startsWith("ore")) {
|
||||
for (int j : OreDictionary.getOreIDs(compared)) {
|
||||
if (i == j) {
|
||||
return true;
|
||||
}
|
||||
String s2 = OreDictionary.getOreName(j);
|
||||
for (String prefix : prefixes) {
|
||||
if (i == OreDictionary.getOreID(s2.replaceFirst("^" + prefix, "ore"))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+9
-3
@@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -65,9 +66,14 @@ public class UpgradedAltars {
|
||||
|
||||
private static boolean checkAltarComponent(AltarComponent altarComponent, IBlockAccess world, int x, int y, int z,
|
||||
int altarTier) {
|
||||
Block block = world.getBlock(x + altarComponent.getX(), y + altarComponent.getY(), z + altarComponent.getZ());
|
||||
int metadata = world
|
||||
.getBlockMetadata(x + altarComponent.getX(), y + altarComponent.getY(), z + altarComponent.getZ());
|
||||
int compX = x + altarComponent.getX();
|
||||
int compY = y + altarComponent.getY();
|
||||
int compZ = z + altarComponent.getZ();
|
||||
if (altarComponent.getBlock() == Blocks.air) {
|
||||
return !world.isAirBlock(compX, compY, compZ);
|
||||
}
|
||||
Block block = world.getBlock(compX, compY, compZ);
|
||||
int metadata = world.getBlockMetadata(compX, compY, compZ);
|
||||
if (altarComponent.isBloodRune()) {
|
||||
boolean result = false;
|
||||
BlockStack[] runes = getRuneOverrides(altarTier);
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package WayofTime.alchemicalWizardry.common.summoning.meteor;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
class ItemStackAdapter extends TypeAdapter<ItemStack> {
|
||||
|
||||
@Override
|
||||
public ItemStack read(JsonReader reader) throws IOException {
|
||||
String str = reader.nextString();
|
||||
String[] input = str.split(":");
|
||||
if (input.length < 2) {
|
||||
AlchemicalWizardry.logger
|
||||
.warn("Unable to read item stack \"{}\". Valid format is \"modid:name(:meta optional)\"", str);
|
||||
return null;
|
||||
}
|
||||
ItemStack itemStack = GameRegistry.findItemStack(input[0], input[1], 1);
|
||||
if (itemStack == null) {
|
||||
AlchemicalWizardry.logger.warn("Unable to find item stack \"{}\".", str);
|
||||
return null;
|
||||
}
|
||||
if (input.length < 3) {
|
||||
return itemStack;
|
||||
}
|
||||
try {
|
||||
itemStack.setItemDamage(Integer.parseInt(input[2]));
|
||||
} catch (NumberFormatException e) {
|
||||
AlchemicalWizardry.logger
|
||||
.warn("Invalid metadata value {} for item stack {}:{}", input[2], input[0], input[1]);
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JsonWriter writer, ItemStack mpc) throws IOException {
|
||||
// Not implemented because it is not needed.
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -27,7 +26,7 @@ public class Meteor {
|
||||
public int radius;
|
||||
public int cost;
|
||||
public float fillerChance; // Out of 100.0
|
||||
public transient ItemStack focusItem;
|
||||
public ItemStack focusItem;
|
||||
private String focusModId;
|
||||
private String focusName;
|
||||
private int focusMeta;
|
||||
@@ -203,13 +202,17 @@ public class Meteor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct the focus item for this meteor from its modid, name, and metadata
|
||||
* Construct the focus item for this meteor from its modid, name, and metadata if using the old config format.
|
||||
*/
|
||||
private void buildFocusItem() {
|
||||
if (this.focusItem != null) return;
|
||||
this.focusItem = GameRegistry.findItemStack(this.focusModId, this.focusName, 1);
|
||||
if (this.focusItem == null) return;
|
||||
Items.feather.setDamage(this.focusItem, this.focusMeta);
|
||||
this.focusItem.setItemDamage(this.focusMeta);
|
||||
AlchemicalWizardry.logger.warn(
|
||||
"Setting focusModId, focusName, and focusMeta individually in meteor"
|
||||
+ "configs has been deprecated. Set \"focusItem\" with format \"modId:name(:meta optional)\""
|
||||
+ " instead.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class MeteorComponentAdapter extends TypeAdapter<MeteorComponent> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JsonWriter writer, MeteorComponent mpc) throws IOException {
|
||||
public void write(JsonWriter writer, MeteorComponent component) throws IOException {
|
||||
// Not implemented because it is not needed.
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -24,7 +24,8 @@ public class MeteorRegistry {
|
||||
|
||||
public static void loadConfig() {
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting()
|
||||
.registerTypeAdapter(MeteorComponent.class, new MeteorComponentAdapter()).create();
|
||||
.registerTypeAdapter(MeteorComponent.class, new MeteorComponentAdapter())
|
||||
.registerTypeAdapter(ItemStack.class, new ItemStackAdapter()).create();
|
||||
File file = new File("config/BloodMagic/meteors");
|
||||
File[] files = file.listFiles();
|
||||
if (files != null) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user