Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bfaf3b3
Spring cleaning
koolkrafter5 May 9, 2026
272cda0
Address review comments.
koolkrafter5 May 10, 2026
535164c
Clean up showAltarInfo a little more
koolkrafter5 May 10, 2026
29bb636
Remove List.of and add @Desugar
koolkrafter5 May 10, 2026
47c60e5
Spotless apply for branch spring-cleaning for #127 (#128)
github-actions[bot] May 10, 2026
e2d1e5c
Update to jvmdg
koolkrafter5 May 10, 2026
1e327f6
Clean up renderers
koolkrafter5 May 11, 2026
32fe0c4
Convert to record classes. This will need an update for Blood Arsenal.
koolkrafter5 May 11, 2026
3ba8bf3
Fix dropped cases
koolkrafter5 May 11, 2026
2645dd3
Clean event hooks
koolkrafter5 May 11, 2026
b44203c
Clean up spells
koolkrafter5 May 11, 2026
144580b
Spotless
koolkrafter5 May 11, 2026
23f917a
Readd null check
koolkrafter5 May 11, 2026
f14e3fe
Clean up rituals
koolkrafter5 May 11, 2026
6003a49
Spotless
koolkrafter5 May 11, 2026
80630ea
Clean up some switch blocks
koolkrafter5 May 11, 2026
a17ce37
Fix NBT tags that accidentally got changed in find and replace
koolkrafter5 May 11, 2026
494bb46
Clean up records
koolkrafter5 May 11, 2026
1b84238
This should not have been deleted
koolkrafter5 May 11, 2026
1f14ed1
Clean up RenderHelper and delete unused ClientUtils
koolkrafter5 May 11, 2026
38f95e6
Clean up demon grunts, fix bug I caused where wind grunt motion was p…
koolkrafter5 May 11, 2026
e80c9ee
Inlining
koolkrafter5 May 11, 2026
7681f54
Projectiles and instanceof
koolkrafter5 May 11, 2026
f98e7ff
Armor
koolkrafter5 May 11, 2026
d5f5c32
Sigils and other items
koolkrafter5 May 11, 2026
e5fe63b
Renderers: cache ResourceLocations and use the split constructor so i…
koolkrafter5 May 11, 2026
0255e94
Clarify this is a float for the axe
koolkrafter5 May 12, 2026
842589f
Clean up DigAreaEffect
koolkrafter5 May 12, 2026
39457f6
Cache block
koolkrafter5 May 12, 2026
5389995
Redundant else
koolkrafter5 May 12, 2026
72fb46f
Fix default
koolkrafter5 May 12, 2026
dddd5c2
Move switch and remove redundant null check before instanceof
koolkrafter5 May 12, 2026
93b4112
horizontalDistance
koolkrafter5 May 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,28 @@ developmentEnvironmentUserName = Developer
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
# - modern: Native modern Java bytecode, no downgrading
enableModernJavaSyntax = jabel
enableModernJavaSyntax = jvmDowngrader

# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
# and should *not* be used in most situations. -1 disables this.
# forceToolchainVersion = -1

# Target JVM version for JVM Downgrader bytecode downgrading.
# Only used when enableModernJavaSyntax = jvmDowngrader
# downgradeTargetVersion = 8
downgradeTargetVersion = 8

# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
# Classes will be available in META-INF/versions/N/ for each version N in this list.
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
# jvmDowngraderMultiReleaseVersions = 21,25
jvmDowngraderMultiReleaseVersions = 25

# Specifies how JVM Downgrader API stubs are provided. Options:
# - shade: Shade minimized stubs into the jar
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
# - external: Another dependency provides stubs (no constraint, no warning)
# - (empty): Warning reminding you to configure stubs
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
# jvmDowngraderStubsProvider =
jvmDowngraderStubsProvider = gtnhlib

# 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.
Expand Down
93 changes: 46 additions & 47 deletions src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Map.Entry;

import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityEnderman;
Expand Down Expand Up @@ -49,7 +50,7 @@ public class BloodMagicConfiguration {
public static void init(File configFile) {
for (String s : DEFAULT_COLOR_LIST.split(";")) {
String[] ct = s.split(",");
colorList.add(new ColourThreshold(Integer.valueOf(ct[0].trim()), ct[1].trim()));
colorList.add(new ColourThreshold(Integer.parseInt(ct[0].trim()), ct[1].trim()));
}

config = new Configuration(configFile);
Expand Down Expand Up @@ -109,15 +110,12 @@ public static void syncConfig() {
0,
Integer.MAX_VALUE,
"The default LP cost to use for meteors if the \"cost\" property is not present in its config file.\n");
AlchemicalWizardry.defaultMeteorBlock = config.getString(
"defaultMeteorBlock",
"meteor",
"",
"The block to use for filler in meteors if none is provided in the meteor's config file and "
+ "that\nmeteor's fillerChance is greater than 0. Also used as a fallback for empty ore "
+ "lists in meteor configs.\nSpecify the block with the "
+ "format:\n\"modId:itemName:meta\"\nDefaults to minecraft:stone:0 if no block is provided or "
+ "the provided block cannot be found.");
AlchemicalWizardry.defaultMeteorBlock = config.getString("defaultMeteorBlock", "meteor", "", """
The block to use for filler in meteors if none is provided in the meteor's config file and that
meteor's fillerChance is greater than 0. Also used as a fallback for empty ore lists in meteor configs.
Specify the block with the format:
"modId:itemName:meta"
Defaults to minecraft:stone:0 if no block is provided or the provided block cannot be found.""");
MeteorComponent.setDefaultMeteorBlock();
AlchemicalWizardry.allowedCrushedOresArray = config.get(
"oreCrushing",
Expand Down Expand Up @@ -639,10 +637,11 @@ public static void finishLoading() {
"altar blocks",
"fifthTierBeacons",
new String[] { "minecraft:beacon", "etfuturum:beacon", "chisel:beacon:*" },
"Valid blocks for the Blood Altar's tier 5 beacons:\n"
+ "Use the following format for all of these entries: mod:block(:meta). Meta * or 32767 allows for any meta.\n"
+ "An empty entry allows for any non-air block to be used for that part of the structure.\n"
+ "Invalid or missing blocks are skipped. If all entries are invalid, any block can be used as a fallback.");
"""
Valid blocks for the Blood Altar's tier 5 beacons:
Use the following format for all of these entries: mod:block(:meta). Meta * or 32767 allows for any meta.
An empty entry allows for any non-air block to be used for that part of the structure.
Invalid or missing blocks are skipped. If all entries are invalid, any block can be used as a fallback.""");
AlchemicalWizardry.thirdTierCaps = readBlockConfig(
"altar blocks",
"thirdTierCaps",
Expand Down Expand Up @@ -680,10 +679,9 @@ public static void finishLoading() {

public static void loadCustomLPValues() {
AlchemicalWizardry.lpPerSactificeCustom = new HashMap<>();
for (Object object : EntityList.stringToClassMapping.entrySet()) {
Entry entry = (Entry) object;
String entityName = (String) entry.getKey();
Class entityClass = (Class) entry.getValue();
for (Entry<String, Class<? extends Entity>> entry : EntityList.stringToClassMapping.entrySet()) {
String entityName = entry.getKey();
Class<? extends Entity> entityClass = entry.getValue();
if (EntityLivingBase.class.isAssignableFrom(entityClass)
&& !Modifier.isAbstract(entityClass.getModifiers())) {
int lpAmount = 500;
Expand Down Expand Up @@ -717,15 +715,13 @@ public static void set(String categoryName, String propertyName, String newValue
}

public static void loadBlacklist() {
AlchemicalWizardry.wellBlacklist = new ArrayList<Class>();
for (Object o : stringToClassMapping.entrySet()) {
Entry entry = (Entry) o;
Class curClass = (Class) entry.getValue();
AlchemicalWizardry.wellBlacklist = new ArrayList<>();
for (Entry<String, Class<? extends Entity>> entry : stringToClassMapping.entrySet()) {
Class<? extends Entity> curClass = entry.getValue();
boolean valid = EntityLivingBase.class.isAssignableFrom(curClass)
&& !Modifier.isAbstract(curClass.getModifiers());
if (valid) {
boolean blacklisted = config.get("wellOfSufferingBlackList", entry.getKey().toString(), false)
.getBoolean();
boolean blacklisted = config.get("wellOfSufferingBlackList", entry.getKey(), false).getBoolean();
if (blacklisted) AlchemicalWizardry.wellBlacklist.add(curClass);
}
}
Expand Down
37 changes: 4 additions & 33 deletions src/main/java/WayofTime/alchemicalWizardry/api/BlockStack.java
Original file line number Diff line number Diff line change
@@ -1,48 +1,19 @@
package WayofTime.alchemicalWizardry.api;

import javax.annotation.Nonnull;

import net.minecraft.block.Block;

import cpw.mods.fml.common.registry.GameData;

/**
* A Block with a set metadata. Similar to an ItemStack.
*/
public class BlockStack {

private final Block block;
private final int meta;

public BlockStack(Block block, int meta) {
this.block = block;
this.meta = meta;
}

public BlockStack(Block block) {
this(block, 0);
}

public Block getBlock() {
return block;
}

public int getMeta() {
return meta;
}
public record BlockStack(Block block, int meta) {

@Nonnull
@Override
public String toString() {
return GameData.getBlockRegistry().getNameForObject(block) + ":" + meta;
}

@Override
public boolean equals(Object obj) {
BlockStack blockStack = (BlockStack) obj;

return blockStack.block == this.getBlock() && blockStack.meta == this.getMeta();
}

@Override
public int hashCode() {
return super.hashCode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,7 @@

import net.minecraft.nbt.NBTTagCompound;

public class ColourAndCoords {

public int colourRed;
public int colourGreen;
public int colourBlue;
public int colourIntensity;

public int xCoord;
public int yCoord;
public int zCoord;

public ColourAndCoords(int red, int green, int blue, int intensity, int x, int y, int z) {
this.colourRed = red;
this.colourGreen = green;
this.colourBlue = blue;
this.colourIntensity = intensity;

this.xCoord = x;
this.yCoord = y;
this.zCoord = z;
}
public record ColourAndCoords(int red, int green, int blue, int intensity, int x, int y, int z) {

public static ColourAndCoords readFromNBT(NBTTagCompound tag) {
return new ColourAndCoords(
Expand All @@ -36,13 +16,13 @@ public static ColourAndCoords readFromNBT(NBTTagCompound tag) {
}

public NBTTagCompound writeToNBT(NBTTagCompound tag) {
tag.setInteger("colourRed", colourRed);
tag.setInteger("colourGreen", colourGreen);
tag.setInteger("colourBlue", colourBlue);
tag.setInteger("colourIntensity", colourIntensity);
tag.setInteger("xCoord", xCoord);
tag.setInteger("yCoord", yCoord);
tag.setInteger("zCoord", zCoord);
tag.setInteger("colourRed", red);
tag.setInteger("colourGreen", green);
tag.setInteger("colourBlue", blue);
tag.setInteger("colourIntensity", intensity);
tag.setInteger("xCoord", x);
tag.setInteger("yCoord", y);
tag.setInteger("zCoord", z);

return tag;
}
Expand Down
31 changes: 4 additions & 27 deletions src/main/java/WayofTime/alchemicalWizardry/api/Int3.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,17 @@

import net.minecraft.nbt.NBTTagCompound;

public class Int3 {

public int xCoord;
public int yCoord;
public int zCoord;

public Int3(int xCoord, int yCoord, int zCoord) {
this.xCoord = xCoord;
this.yCoord = yCoord;
this.zCoord = zCoord;
}
public record Int3(int x, int y, int z) {

public static Int3 readFromNBT(NBTTagCompound tag) {
return new Int3(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord"));
}

public NBTTagCompound writeToNBT(NBTTagCompound tag) {
tag.setInteger("xCoord", xCoord);
tag.setInteger("yCoord", yCoord);
tag.setInteger("zCoord", zCoord);
tag.setInteger("xCoord", x);
tag.setInteger("yCoord", y);
tag.setInteger("zCoord", z);

return tag;
}

@Override
public boolean equals(Object o) {
return o instanceof Int3
? ((Int3) o).xCoord == this.xCoord && ((Int3) o).yCoord == this.yCoord
&& ((Int3) o).zCoord == this.zCoord
: false;
}

@Override
public int hashCode() {
return this.xCoord + this.yCoord << 8 + this.zCoord << 16;
}
}
36 changes: 6 additions & 30 deletions src/main/java/WayofTime/alchemicalWizardry/api/Vector3.java
Original file line number Diff line number Diff line change
@@ -1,41 +1,17 @@
package WayofTime.alchemicalWizardry.api;

/*
* Created in Scala by Alex-Hawks Translated and implemented by Arcaratus
*/
public class Vector3 {
import javax.annotation.Nonnull;

public int x, y, z;
public record Vector3(int x, int y, int z) {

public Vector3(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}

public Vector3 add(Vector3 vec1) {
return new Vector3(this.x + vec1.x, this.y + vec1.y, this.z + vec1.z);
public Vector3 add(Vector3 vec) {
return new Vector3(this.x + vec.x, this.y + vec.y, this.z + vec.z);
}

@Override
@Nonnull
public String toString() {
return "V3(" + x + "}, " + y + "}," + z + "})";
return "V3({" + x + "}, {" + y + "}, {" + z + "})";
}

private boolean canEqual(Object object) {
return object instanceof Vector3;
}

@Override
public boolean equals(Object object) {
return object == this || object instanceof Vector3 && canEqual(this)
&& this.x == ((Vector3) object).x
&& this.y == ((Vector3) object).y
&& this.z == ((Vector3) object).z;
}

@Override
public int hashCode() {
return 48131 * x - 95021 * y + z;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public class AlchemicalPotionCreationHandler {

public static ArrayList<AlchemyPotionHandlerComponent> registeredPotionEffects = new ArrayList();
public static ArrayList<AlchemyPotionHandlerComponent> registeredPotionEffects = new ArrayList<>();

public static void addPotion(ItemStack itemStack, int potionID, int tickDuration) {
registeredPotionEffects.add(new AlchemyPotionHandlerComponent(itemStack, potionID, tickDuration));
Expand All @@ -15,7 +15,7 @@ public static void addPotion(ItemStack itemStack, int potionID, int tickDuration
public static int getPotionIDForStack(ItemStack itemStack) {
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects) {
if (aphc.compareItemStack(itemStack)) {
return aphc.getPotionID();
return aphc.potionID();
}
}

Expand All @@ -26,7 +26,7 @@ public static int getPotionTickDurationForStack(ItemStack itemStack) {
{
for (AlchemyPotionHandlerComponent aphc : registeredPotionEffects) {
if (aphc.compareItemStack(itemStack)) {
return aphc.getTickDuration();
return aphc.tickDuration();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;

public class AlchemyPotionHandlerComponent {

private ItemStack itemStack;
private int potionID;
private int tickDuration;

public AlchemyPotionHandlerComponent(ItemStack itemStack, int potionID, int tickDuration) {
this.itemStack = itemStack;
this.potionID = potionID;
this.tickDuration = tickDuration;
}
public record AlchemyPotionHandlerComponent(ItemStack itemStack, int potionID, int tickDuration) {

public boolean compareItemStack(ItemStack comparedStack) {
if (comparedStack != null && itemStack != null) {
Expand All @@ -30,16 +20,4 @@ public boolean compareItemStack(ItemStack comparedStack) {

return false;
}

public ItemStack getItemStack() {
return itemStack;
}

public int getPotionID() {
return this.potionID;
}

public int getTickDuration() {
return this.tickDuration;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

public class AlchemyPotionHelper {

private int potionID;
private int tickDuration;
private final int potionID;
private final int tickDuration;
private int concentration;
private int durationFactor;

Expand Down
Loading
Loading