Compare commits

..

4 commits

Author SHA1 Message Date
Ell
0a27bad878 41.5
Fixes
- Fixed a crash with the Armorer's Aid
- Fixed a crash with the Eye of the Blaze
- Fixed armor not having the proper tags
2024-11-20 22:05:56 +01:00
Ell
ad22ce7342 fixed armor not having the proper tags
closes #369
2024-11-20 21:59:25 +01:00
Ell
0d2f6f5389 fixed fortress finder crashing servers
closes #372
2024-11-20 21:48:20 +01:00
Ell
a4f9dd0f95 fixed a blast furnace booster crash
closes #373
2024-11-20 21:28:25 +01:00
9 changed files with 49 additions and 11 deletions

View file

@ -31,7 +31,7 @@ mod_name=NaturesAura
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT mod_license=MIT
# The mod version. See https://semver.org/ # The mod version. See https://semver.org/
mod_version=41.4 mod_version=41.5
mod_release_state=BETA mod_release_state=BETA
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources. # This should match the base package used for the mod sources.

View file

@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_chest",
"naturesaura:infused_iron_chest",
"naturesaura:sky_chest"
]
}

View file

@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_shoes",
"naturesaura:infused_iron_shoes",
"naturesaura:sky_shoes"
]
}

View file

@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_helmet",
"naturesaura:infused_iron_helmet",
"naturesaura:sky_helmet"
]
}

View file

@ -0,0 +1,7 @@
{
"values": [
"naturesaura:depth_pants",
"naturesaura:infused_iron_pants",
"naturesaura:sky_pants"
]
}

View file

@ -37,10 +37,10 @@ public class BlockEntityBlastFurnaceBooster extends BlockEntityImpl implements I
if (!(below instanceof BlastFurnaceBlockEntity tile)) if (!(below instanceof BlastFurnaceBlockEntity tile))
return; return;
var input = new SingleRecipeInput(tile.getItem(0)); var input = new SingleRecipeInput(tile.getItem(0));
Recipe<?> recipe = this.level.getRecipeManager().getRecipeFor(BlockEntityFurnaceHeater.getRecipeType(tile), input, this.level).orElse(null).value(); var recipe = this.level.getRecipeManager().getRecipeFor(BlockEntityFurnaceHeater.getRecipeType(tile), input, this.level).orElse(null);
if (recipe == null) if (recipe == null)
return; return;
if (!this.isApplicable(recipe.getIngredients())) if (!this.isApplicable(recipe.value().getIngredients()))
return; return;
var data = BlockEntityFurnaceHeater.getFurnaceData(tile); var data = BlockEntityFurnaceHeater.getFurnaceData(tile);
@ -59,7 +59,7 @@ public class BlockEntityBlastFurnaceBooster extends BlockEntityImpl implements I
return; return;
if (output.isEmpty()) { if (output.isEmpty()) {
var result = recipe.getResultItem(this.level.registryAccess()); var result = recipe.value().getResultItem(this.level.registryAccess());
tile.setItem(2, result.copy()); tile.setItem(2, result.copy());
} else { } else {
output.grow(1); output.grow(1);

View file

@ -51,6 +51,16 @@ public class ItemTagProvider extends ItemTagsProvider {
this.tag(ItemTags.SWORDS).add(i); this.tag(ItemTags.SWORDS).add(i);
} else if (i instanceof ItemShovel) { } else if (i instanceof ItemShovel) {
this.tag(ItemTags.SHOVELS).add(i); this.tag(ItemTags.SHOVELS).add(i);
} else if (i instanceof ItemArmor a) {
var tag = switch (a.getType()) {
case HELMET -> ItemTags.HEAD_ARMOR;
case CHESTPLATE -> ItemTags.CHEST_ARMOR;
case LEGGINGS -> ItemTags.LEG_ARMOR;
case BOOTS -> ItemTags.FOOT_ARMOR;
default -> null;
};
if (tag != null)
this.tag(tag).add(i);
} }
}); });
@ -62,4 +72,5 @@ public class ItemTagProvider extends ItemTagsProvider {
// super is protected, but CuriosCompat needs this // super is protected, but CuriosCompat needs this
return super.tag(tag); return super.tag(tag);
} }
} }

View file

@ -18,13 +18,11 @@ public class ItemStructureFinder extends ItemImpl {
private final ResourceKey<Structure> structure; private final ResourceKey<Structure> structure;
private final int color; private final int color;
private final int radius;
public ItemStructureFinder(String baseName, ResourceKey<Structure> structure, int color, int radius) { public ItemStructureFinder(String baseName, ResourceKey<Structure> structure, int color) {
super(baseName); super(baseName);
this.structure = structure; this.structure = structure;
this.color = color; this.color = color;
this.radius = radius;
} }
@Override @Override
@ -34,7 +32,8 @@ public class ItemStructureFinder extends ItemImpl {
var registry = levelIn.registryAccess().registryOrThrow(Registries.STRUCTURE); var registry = levelIn.registryAccess().registryOrThrow(Registries.STRUCTURE);
var holderSet = registry.getHolder(this.structure).map(HolderSet::direct).orElse(null); var holderSet = registry.getHolder(this.structure).map(HolderSet::direct).orElse(null);
if (holderSet != null) { if (holderSet != null) {
var pos = ((ServerLevel) levelIn).getChunkSource().getGenerator().findNearestMapStructure((ServerLevel) levelIn, holderSet, playerIn.blockPosition(), this.radius, false); // apparently the radius isn't really the radius anymore and even the locate command uses 100, which still allows it to find structures further away
var pos = ((ServerLevel) levelIn).getChunkSource().getGenerator().findNearestMapStructure((ServerLevel) levelIn, holderSet, playerIn.blockPosition(), 100, false);
if (pos != null) { if (pos != null) {
var entity = new EntityStructureFinder(ModEntities.STRUCTURE_FINDER, levelIn); var entity = new EntityStructureFinder(ModEntities.STRUCTURE_FINDER, levelIn);
entity.setPos(playerIn.getX(), playerIn.getY(0.5D), playerIn.getZ()); entity.setPos(playerIn.getX(), playerIn.getY(0.5D), playerIn.getZ());

View file

@ -219,9 +219,9 @@ public final class ModRegistry {
new ItemArmor("sky_chest", ModArmorMaterial.SKY, ArmorItem.Type.CHESTPLATE), new ItemArmor("sky_chest", ModArmorMaterial.SKY, ArmorItem.Type.CHESTPLATE),
new ItemArmor("sky_pants", ModArmorMaterial.SKY, ArmorItem.Type.LEGGINGS), new ItemArmor("sky_pants", ModArmorMaterial.SKY, ArmorItem.Type.LEGGINGS),
new ItemArmor("sky_shoes", ModArmorMaterial.SKY, ArmorItem.Type.BOOTS), new ItemArmor("sky_shoes", ModArmorMaterial.SKY, ArmorItem.Type.BOOTS),
new ItemStructureFinder("fortress_finder", BuiltinStructures.FORTRESS, 0xba2800, 1024), new ItemStructureFinder("fortress_finder", BuiltinStructures.FORTRESS, 0xba2800),
new ItemStructureFinder("end_city_finder", BuiltinStructures.END_CITY, 0xca5cd6, 1024), new ItemStructureFinder("end_city_finder", BuiltinStructures.END_CITY, 0xca5cd6),
new ItemStructureFinder("outpost_finder", BuiltinStructures.PILLAGER_OUTPOST, 0xab9f98, 2048), new ItemStructureFinder("outpost_finder", BuiltinStructures.PILLAGER_OUTPOST, 0xab9f98),
new ItemBreakPrevention(), new ItemBreakPrevention(),
new ItemPetReviver(), new ItemPetReviver(),
new ItemNetheriteFinder(), new ItemNetheriteFinder(),