mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-23 04:08:34 +01:00
Compare commits
4 commits
2c8a615988
...
0a27bad878
Author | SHA1 | Date | |
---|---|---|---|
0a27bad878 | |||
ad22ce7342 | |||
0d2f6f5389 | |||
a4f9dd0f95 |
9 changed files with 49 additions and 11 deletions
|
@ -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.
|
||||
mod_license=MIT
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=41.4
|
||||
mod_version=41.5
|
||||
mod_release_state=BETA
|
||||
# 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.
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"values": [
|
||||
"naturesaura:depth_chest",
|
||||
"naturesaura:infused_iron_chest",
|
||||
"naturesaura:sky_chest"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"values": [
|
||||
"naturesaura:depth_shoes",
|
||||
"naturesaura:infused_iron_shoes",
|
||||
"naturesaura:sky_shoes"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"values": [
|
||||
"naturesaura:depth_helmet",
|
||||
"naturesaura:infused_iron_helmet",
|
||||
"naturesaura:sky_helmet"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"values": [
|
||||
"naturesaura:depth_pants",
|
||||
"naturesaura:infused_iron_pants",
|
||||
"naturesaura:sky_pants"
|
||||
]
|
||||
}
|
|
@ -37,10 +37,10 @@ public class BlockEntityBlastFurnaceBooster extends BlockEntityImpl implements I
|
|||
if (!(below instanceof BlastFurnaceBlockEntity tile))
|
||||
return;
|
||||
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)
|
||||
return;
|
||||
if (!this.isApplicable(recipe.getIngredients()))
|
||||
if (!this.isApplicable(recipe.value().getIngredients()))
|
||||
return;
|
||||
|
||||
var data = BlockEntityFurnaceHeater.getFurnaceData(tile);
|
||||
|
@ -59,7 +59,7 @@ public class BlockEntityBlastFurnaceBooster extends BlockEntityImpl implements I
|
|||
return;
|
||||
|
||||
if (output.isEmpty()) {
|
||||
var result = recipe.getResultItem(this.level.registryAccess());
|
||||
var result = recipe.value().getResultItem(this.level.registryAccess());
|
||||
tile.setItem(2, result.copy());
|
||||
} else {
|
||||
output.grow(1);
|
||||
|
|
|
@ -51,6 +51,16 @@ public class ItemTagProvider extends ItemTagsProvider {
|
|||
this.tag(ItemTags.SWORDS).add(i);
|
||||
} else if (i instanceof ItemShovel) {
|
||||
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
|
||||
return super.tag(tag);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,13 +18,11 @@ public class ItemStructureFinder extends ItemImpl {
|
|||
|
||||
private final ResourceKey<Structure> structure;
|
||||
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);
|
||||
this.structure = structure;
|
||||
this.color = color;
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,7 +32,8 @@ public class ItemStructureFinder extends ItemImpl {
|
|||
var registry = levelIn.registryAccess().registryOrThrow(Registries.STRUCTURE);
|
||||
var holderSet = registry.getHolder(this.structure).map(HolderSet::direct).orElse(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) {
|
||||
var entity = new EntityStructureFinder(ModEntities.STRUCTURE_FINDER, levelIn);
|
||||
entity.setPos(playerIn.getX(), playerIn.getY(0.5D), playerIn.getZ());
|
||||
|
|
|
@ -219,9 +219,9 @@ public final class ModRegistry {
|
|||
new ItemArmor("sky_chest", ModArmorMaterial.SKY, ArmorItem.Type.CHESTPLATE),
|
||||
new ItemArmor("sky_pants", ModArmorMaterial.SKY, ArmorItem.Type.LEGGINGS),
|
||||
new ItemArmor("sky_shoes", ModArmorMaterial.SKY, ArmorItem.Type.BOOTS),
|
||||
new ItemStructureFinder("fortress_finder", BuiltinStructures.FORTRESS, 0xba2800, 1024),
|
||||
new ItemStructureFinder("end_city_finder", BuiltinStructures.END_CITY, 0xca5cd6, 1024),
|
||||
new ItemStructureFinder("outpost_finder", BuiltinStructures.PILLAGER_OUTPOST, 0xab9f98, 2048),
|
||||
new ItemStructureFinder("fortress_finder", BuiltinStructures.FORTRESS, 0xba2800),
|
||||
new ItemStructureFinder("end_city_finder", BuiltinStructures.END_CITY, 0xca5cd6),
|
||||
new ItemStructureFinder("outpost_finder", BuiltinStructures.PILLAGER_OUTPOST, 0xab9f98),
|
||||
new ItemBreakPrevention(),
|
||||
new ItemPetReviver(),
|
||||
new ItemNetheriteFinder(),
|
||||
|
|
Loading…
Reference in a new issue