diff --git a/src/main/java/de/ellpeck/naturesaura/NaturesAura.java b/src/main/java/de/ellpeck/naturesaura/NaturesAura.java index b3533b1e..44f37fa8 100644 --- a/src/main/java/de/ellpeck/naturesaura/NaturesAura.java +++ b/src/main/java/de/ellpeck/naturesaura/NaturesAura.java @@ -35,7 +35,7 @@ import org.apache.logging.log4j.Logger; @Mod(modid = NaturesAura.MOD_ID, name = NaturesAura.MOD_NAME, version = NaturesAura.VERSION, dependencies = NaturesAura.DEPS) public final class NaturesAura { - public static final String MOD_ID = "naturesaura"; + public static final String MOD_ID = NaturesAuraAPI.MOD_ID; public static final String PROXY_LOCATION = "de.ellpeck." + MOD_ID + ".proxy."; public static final String MOD_NAME = "Nature's Aura"; public static final String VERSION = "@VERSION@"; diff --git a/src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java b/src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java index afbe36d6..2c8f377d 100644 --- a/src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java +++ b/src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java @@ -2,6 +2,8 @@ package de.ellpeck.naturesaura.api; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.container.IAuraContainer; +import de.ellpeck.naturesaura.api.aura.type.BasicAuraType; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.api.internal.StubHooks; import de.ellpeck.naturesaura.api.recipes.AltarRecipe; import de.ellpeck.naturesaura.api.recipes.TreeRitualRecipe; @@ -10,6 +12,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.DimensionType; import net.minecraft.world.World; import org.apache.commons.lang3.mutable.MutableInt; @@ -25,18 +28,19 @@ import java.util.function.BiConsumer; * internal mod functions not exposed to the API. */ public final class NaturesAuraAPI { + public static final String MOD_ID = "naturesaura"; private static IInternalHooks instance = new StubHooks(); /** * The list of all {@link AltarRecipe} instances which are the recipes used - * by the Natural Altar. Newly created recipes are automatically added to - * this list. + * by the Natural Altar. Newly created recipes can be easily added using + * {@link AltarRecipe#register()}. */ public static final Map ALTAR_RECIPES = new HashMap<>(); /** * The list of all {@link TreeRitualRecipe} instances which are the recipes - * used in the Ritual of the Forest. Newly created recipes are automatically - * added to this list. + * used in the Ritual of the Forest. Newly created recipes can be easily + * added using {@link TreeRitualRecipe#register()}. */ public static final Map TREE_RITUAL_RECIPES = new HashMap<>(); /** @@ -51,6 +55,16 @@ public final class NaturesAuraAPI { * by default, along with all blocks specified in the config file */ public static final Map BOTANIST_PICKAXE_CONVERSIONS = new HashMap<>(); + /** + * A map of all {@link IAuraType} instances which are types of Aura present + * in different types of worlds. {@link BasicAuraType} instances can be + * easily registered using {@link BasicAuraType#register()}. + */ + public static final Map AURA_TYPES = new HashMap<>(); + public static final IAuraType TYPE_OVERWORLD = new BasicAuraType(new ResourceLocation(MOD_ID, "overworld"), DimensionType.OVERWORLD, 0xbef224).register(); + public static final IAuraType TYPE_NETHER = new BasicAuraType(new ResourceLocation(MOD_ID, "nether"), DimensionType.NETHER, 0x871c0c).register(); + public static final IAuraType TYPE_END = new BasicAuraType(new ResourceLocation(MOD_ID, "end"), DimensionType.THE_END, 0x302624).register(); + public static final IAuraType TYPE_OTHER = new BasicAuraType(new ResourceLocation(MOD_ID, "other"), null, 0x2fa8a0).register(); /** * This method returns the active {@link IInternalHooks} instance which can diff --git a/src/main/java/de/ellpeck/naturesaura/api/aura/AuraType.java b/src/main/java/de/ellpeck/naturesaura/api/aura/AuraType.java deleted file mode 100644 index 2f0c7932..00000000 --- a/src/main/java/de/ellpeck/naturesaura/api/aura/AuraType.java +++ /dev/null @@ -1,27 +0,0 @@ -package de.ellpeck.naturesaura.api.aura; - -import net.minecraft.world.World; - -public enum AuraType { - OVERWORLD, - NETHER, - END, - OTHER; - - public boolean isPresent(World world) { - return forWorld(world) == this; - } - - public static AuraType forWorld(World world) { - switch (world.provider.getDimensionType()) { - case OVERWORLD: - return OVERWORLD; - case NETHER: - return NETHER; - case THE_END: - return END; - default: - return OTHER; - } - } -} diff --git a/src/main/java/de/ellpeck/naturesaura/api/aura/chunk/IAuraChunk.java b/src/main/java/de/ellpeck/naturesaura/api/aura/chunk/IAuraChunk.java index a15d9947..9380b87f 100644 --- a/src/main/java/de/ellpeck/naturesaura/api/aura/chunk/IAuraChunk.java +++ b/src/main/java/de/ellpeck/naturesaura/api/aura/chunk/IAuraChunk.java @@ -2,7 +2,7 @@ package de.ellpeck.naturesaura.api.aura.chunk; import de.ellpeck.naturesaura.api.NACapabilities; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.aura.AuraType; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -126,7 +126,7 @@ public interface IAuraChunk extends ICapabilityProvider, INBTSerializable drainSpots = new HashMap<>(); private final List effects = new ArrayList<>(); private boolean needsSync; - public AuraChunk(Chunk chunk, AuraType type) { + public AuraChunk(Chunk chunk, IAuraType type) { this.chunk = chunk; this.type = type; @@ -96,7 +96,7 @@ public class AuraChunk implements IAuraChunk { } @Override - public AuraType getType() { + public IAuraType getType() { return this.type; } diff --git a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java index fc81c9d7..f9697be1 100644 --- a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java @@ -1,8 +1,9 @@ package de.ellpeck.naturesaura.aura.chunk.effect; -import de.ellpeck.naturesaura.api.aura.AuraType; +import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.chunk.IDrainSpotEffect; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.blocks.ModBlocks; import net.minecraft.block.*; import net.minecraft.block.state.IBlockState; @@ -52,7 +53,7 @@ public class GrassDieEffect implements IDrainSpotEffect { } @Override - public boolean appliesToType(AuraType type) { - return type == AuraType.OVERWORLD; + public boolean appliesToType(IAuraType type) { + return type == NaturesAuraAPI.TYPE_OVERWORLD; } } diff --git a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/PlantBoostEffect.java b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/PlantBoostEffect.java index 2f48ccb0..6007e9b7 100644 --- a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/PlantBoostEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/PlantBoostEffect.java @@ -1,8 +1,9 @@ package de.ellpeck.naturesaura.aura.chunk.effect; -import de.ellpeck.naturesaura.api.aura.AuraType; +import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.chunk.IDrainSpotEffect; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; import net.minecraft.block.Block; @@ -54,7 +55,7 @@ public class PlantBoostEffect implements IDrainSpotEffect { } @Override - public boolean appliesToType(AuraType type) { - return type == AuraType.OVERWORLD; + public boolean appliesToType(IAuraType type) { + return type == NaturesAuraAPI.TYPE_OVERWORLD; } } diff --git a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/ReplenishingEffect.java b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/ReplenishingEffect.java index 5e50386e..7cb7d410 100644 --- a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/ReplenishingEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/ReplenishingEffect.java @@ -2,11 +2,11 @@ package de.ellpeck.naturesaura.aura.chunk.effect; import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.api.NACapabilities; -import de.ellpeck.naturesaura.api.aura.AuraType; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.chunk.IDrainSpotEffect; import de.ellpeck.naturesaura.api.aura.chunk.ISpotDrainable; import de.ellpeck.naturesaura.api.aura.container.IAuraContainer; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; @@ -20,7 +20,6 @@ public class ReplenishingEffect implements IDrainSpotEffect { public void update(World world, Chunk chunk, IAuraChunk auraChunk, BlockPos pos, MutableInt spot) { int amount = spot.intValue(); if (amount < 0) { - AuraType type = AuraType.forWorld(world); List tiles = new ArrayList<>(); Helper.getTileEntitiesInArea(world, pos, 25, tile -> { if (tile.hasCapability(NACapabilities.auraContainer, null)) { @@ -31,6 +30,7 @@ public class ReplenishingEffect implements IDrainSpotEffect { } }); if (!tiles.isEmpty()) { + IAuraType type = IAuraType.forWorld(world); for (int i = world.rand.nextInt(6); i >= 0; i--) { ISpotDrainable tile = tiles.get(world.rand.nextInt(tiles.size())); if (!tile.isAcceptableType(type)) @@ -49,7 +49,7 @@ public class ReplenishingEffect implements IDrainSpotEffect { } @Override - public boolean appliesToType(AuraType type) { + public boolean appliesToType(IAuraType type) { return true; } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAncientLeaves.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAncientLeaves.java index 45c9093d..dbf4acfc 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAncientLeaves.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAncientLeaves.java @@ -1,6 +1,6 @@ package de.ellpeck.naturesaura.blocks.tiles; -import de.ellpeck.naturesaura.api.aura.AuraType; +import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.container.IAuraContainer; import de.ellpeck.naturesaura.api.aura.container.NaturalAuraContainer; import net.minecraft.nbt.NBTTagCompound; @@ -8,7 +8,7 @@ import net.minecraft.util.EnumFacing; public class TileEntityAncientLeaves extends TileEntityImpl { - private final NaturalAuraContainer container = new NaturalAuraContainer(AuraType.OVERWORLD, 20, 5) { + private final NaturalAuraContainer container = new NaturalAuraContainer(NaturesAuraAPI.TYPE_OVERWORLD, 20, 5) { @Override public int getAuraColor() { return 0xc46df9; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java index 9d348523..7b86e021 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java @@ -2,7 +2,6 @@ package de.ellpeck.naturesaura.blocks.tiles; import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.aura.AuraType; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticleStream; @@ -62,7 +61,7 @@ public class TileEntityFlowerGenerator extends TileEntityImpl implements ITickab int toAdd = Math.max(0, addAmount - curr.getValue()); if (toAdd > 0) { BlockPos auraPos = IAuraChunk.getLowestSpot(this.world, this.pos, 30, this.pos); - if (AuraType.OVERWORLD.isPresent(this.world) && IAuraChunk.getAuraInArea(this.world, auraPos, 30) < 20000) + if (NaturesAuraAPI.TYPE_OVERWORLD.isPresentInWorld(this.world) && IAuraChunk.getAuraInArea(this.world, auraPos, 30) < 20000) IAuraChunk.getAuraChunk(this.world, auraPos).storeAura(auraPos, toAdd); else toAdd = 0; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java index db8e82ed..e9a0a6d9 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityNatureAltar.java @@ -1,13 +1,12 @@ package de.ellpeck.naturesaura.blocks.tiles; import de.ellpeck.naturesaura.Helper; -import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.NACapabilities; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import de.ellpeck.naturesaura.api.aura.AuraType; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.container.BasicAuraContainer; import de.ellpeck.naturesaura.api.aura.container.IAuraContainer; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.api.recipes.AltarRecipe; import de.ellpeck.naturesaura.blocks.multi.Multiblocks; import de.ellpeck.naturesaura.packet.PacketHandler; @@ -55,7 +54,7 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickable { @SideOnly(Side.CLIENT) public int bobTimer; - private final BasicAuraContainer container = new BasicAuraContainer(AuraType.OVERWORLD, 5000); + private final BasicAuraContainer container = new BasicAuraContainer(NaturesAuraAPI.TYPE_OVERWORLD, 5000); public boolean structureFine; private AltarRecipe currentRecipe; @@ -78,7 +77,7 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickable { if (this.structureFine) { int space = this.container.storeAura(3, true); - if (space > 0 && this.container.isAcceptableType(AuraType.forWorld(this.world))) { + if (space > 0 && this.container.isAcceptableType(IAuraType.forWorld(this.world))) { int toStore = Math.min(IAuraChunk.getAuraInArea(this.world, this.pos, 20), space); if (toStore > 0) { BlockPos spot = IAuraChunk.getHighestSpot(this.world, this.pos, 20, this.pos); diff --git a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java index f7d98e0c..99efa64a 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java @@ -3,9 +3,9 @@ package de.ellpeck.naturesaura.events; import baubles.api.BaublesApi; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.NACapabilities; -import de.ellpeck.naturesaura.api.aura.AuraType; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; import de.ellpeck.naturesaura.api.aura.container.IAuraContainer; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.blocks.tiles.TileEntityNatureAltar; import de.ellpeck.naturesaura.compat.Compat; import de.ellpeck.naturesaura.items.ModItems; @@ -61,7 +61,7 @@ public class ClientEvents { left.add(prefix + drainSpot.intValue() + " @ " + blockPos.getX() + " " + blockPos.getY() + " " + blockPos.getZ()); })); left.add(prefix + "Total: " + amount.intValue() + " in " + spots.intValue() + " spots"); - left.add(prefix + "Type: " + AuraType.forWorld(mc.world)); + left.add(prefix + "Type: " + IAuraType.forWorld(mc.world).getName()); } } } diff --git a/src/main/java/de/ellpeck/naturesaura/events/CommonEvents.java b/src/main/java/de/ellpeck/naturesaura/events/CommonEvents.java index b5898395..52fee0e0 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/CommonEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/CommonEvents.java @@ -3,7 +3,7 @@ package de.ellpeck.naturesaura.events; import de.ellpeck.naturesaura.ModConfig; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.api.NACapabilities; -import de.ellpeck.naturesaura.api.aura.AuraType; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.aura.chunk.AuraChunk; import de.ellpeck.naturesaura.packet.PacketHandler; import net.minecraft.util.ResourceLocation; @@ -24,7 +24,7 @@ public class CommonEvents { @SubscribeEvent public void onChunkCapsAttach(AttachCapabilitiesEvent event) { Chunk chunk = event.getObject(); - AuraType type = AuraType.forWorld(chunk.getWorld()); + IAuraType type = IAuraType.forWorld(chunk.getWorld()); event.addCapability(new ResourceLocation(NaturesAura.MOD_ID, "aura"), new AuraChunk(chunk, type)); } diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemAuraBottle.java b/src/main/java/de/ellpeck/naturesaura/items/ItemAuraBottle.java index 072da149..58690afb 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemAuraBottle.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemAuraBottle.java @@ -1,8 +1,10 @@ package de.ellpeck.naturesaura.items; -import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.aura.AuraType; +import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; +import de.ellpeck.naturesaura.reg.IColorProvidingItem; +import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -18,13 +20,13 @@ import net.minecraft.util.text.translation.I18n; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; -public class ItemAuraBottle extends ItemImpl { +public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem { public ItemAuraBottle() { super("aura_bottle"); - this.addPropertyOverride(new ResourceLocation(NaturesAura.MOD_ID, "type"), - (stack, worldIn, entityIn) -> getType(stack).ordinal()); MinecraftForge.EVENT_BUS.register(this); } @@ -45,7 +47,7 @@ public class ItemAuraBottle extends ItemImpl { held.shrink(1); player.inventory.addItemStackToInventory( - setType(new ItemStack(this), AuraType.forWorld(player.world))); + setType(new ItemStack(this), IAuraType.forWorld(player.world))); BlockPos spot = IAuraChunk.getHighestSpot(player.world, pos, 30, pos); IAuraChunk.getAuraChunk(player.world, spot).drainAura(spot, 200); @@ -59,7 +61,7 @@ public class ItemAuraBottle extends ItemImpl { @Override public void getSubItems(CreativeTabs tab, NonNullList items) { if (this.isInCreativeTab(tab)) { - for (AuraType type : AuraType.values()) { + for (IAuraType type : NaturesAuraAPI.AURA_TYPES.values()) { ItemStack stack = new ItemStack(this); setType(stack, type); items.add(stack); @@ -69,22 +71,28 @@ public class ItemAuraBottle extends ItemImpl { @Override public String getItemStackDisplayName(ItemStack stack) { - return I18n.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + "." + getType(stack).name().toLowerCase() + ".name").trim(); + return I18n.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + "." + getType(stack).getName() + ".name").trim(); } - public static AuraType getType(ItemStack stack) { + public static IAuraType getType(ItemStack stack) { if (!stack.hasTagCompound()) - return AuraType.OTHER; - String type = stack.getTagCompound().getString("type"); + return NaturesAuraAPI.TYPE_OTHER; + String type = stack.getTagCompound().getString("stored_type"); if (type.isEmpty()) - return AuraType.OTHER; - return AuraType.valueOf(type); + return NaturesAuraAPI.TYPE_OTHER; + return NaturesAuraAPI.AURA_TYPES.get(new ResourceLocation(type)); } - public static ItemStack setType(ItemStack stack, AuraType type) { + public static ItemStack setType(ItemStack stack, IAuraType type) { if (!stack.hasTagCompound()) stack.setTagCompound(new NBTTagCompound()); - stack.getTagCompound().setString("type", type.name()); + stack.getTagCompound().setString("stored_type", type.getName().toString()); return stack; } + + @Override + @SideOnly(Side.CLIENT) + public IItemColor getItemColor() { + return (stack, tintIndex) -> tintIndex > 0 ? getType(stack).getBottledColor() : 0xFFFFFF; + } } diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java index 700127f0..896a6ff1 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java @@ -1,7 +1,7 @@ package de.ellpeck.naturesaura.recipes; import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.aura.AuraType; +import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.recipes.AltarRecipe; import de.ellpeck.naturesaura.api.recipes.TreeRitualRecipe; import de.ellpeck.naturesaura.blocks.ModBlocks; @@ -28,7 +28,7 @@ public final class ModRecipes { new ItemStack(Blocks.STONE), new ItemStack(ModItems.GOLD_LEAF), new ItemStack(Items.GOLD_INGOT), - ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), AuraType.OVERWORLD)).register(); + ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_OVERWORLD)).register(); new TreeRitualRecipe(new ResourceLocation(NaturesAura.MOD_ID, "ancient_sapling"), new ItemStack(Blocks.SAPLING), new ItemStack(ModBlocks.ANCIENT_SAPLING), 200, new ItemStack(Blocks.SAPLING), @@ -46,7 +46,7 @@ public final class ModRecipes { new ItemStack(Items.FIRE_CHARGE), new ItemStack(Items.FLINT), new ItemStack(Blocks.MAGMA), - ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), AuraType.NETHER)).register(); + ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_NETHER)).register(); new TreeRitualRecipe(new ResourceLocation(NaturesAura.MOD_ID, "conversion_catalyst"), new ItemStack(Blocks.SAPLING, 1, 3), new ItemStack(ModBlocks.CONVERSION_CATALYST), 600, new ItemStack(Blocks.STONEBRICK, 1, 1), @@ -64,7 +64,7 @@ public final class ModRecipes { null, 150, 40).register(); new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "chorus"), - ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), AuraType.END), new ItemStack(Items.DRAGON_BREATH), + ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_END), new ItemStack(Items.DRAGON_BREATH), ModBlocks.CONVERSION_CATALYST, 350, 80).register(); new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "leather"), new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER), diff --git a/src/main/resources/assets/naturesaura/advancements/aura_bottle_end.json b/src/main/resources/assets/naturesaura/advancements/aura_bottle_end.json index 1d4880ce..f6770ef4 100644 --- a/src/main/resources/assets/naturesaura/advancements/aura_bottle_end.json +++ b/src/main/resources/assets/naturesaura/advancements/aura_bottle_end.json @@ -2,7 +2,7 @@ "display": { "icon": { "item": "naturesaura:aura_bottle", - "nbt": "{\"type\":\"END\"}" + "nbt": "{\"stored_type\":\"naturesaura:end\"}" }, "title": { "translate": "advancement.naturesaura.aura_bottle_end" @@ -19,7 +19,7 @@ "items": [ { "item": "naturesaura:aura_bottle", - "nbt": "{\"type\":\"END\"}" + "nbt": "{\"stored_type\":\"naturesaura:end\"}" } ] } diff --git a/src/main/resources/assets/naturesaura/advancements/aura_bottle_nether.json b/src/main/resources/assets/naturesaura/advancements/aura_bottle_nether.json index 76f0745c..a166d3ab 100644 --- a/src/main/resources/assets/naturesaura/advancements/aura_bottle_nether.json +++ b/src/main/resources/assets/naturesaura/advancements/aura_bottle_nether.json @@ -2,7 +2,7 @@ "display": { "icon": { "item": "naturesaura:aura_bottle", - "nbt": "{\"type\":\"NETHER\"}" + "nbt": "{\"stored_type\":\"naturesaura:nether\"}" }, "title": { "translate": "advancement.naturesaura.aura_bottle_nether" @@ -19,7 +19,7 @@ "items": [ { "item": "naturesaura:aura_bottle", - "nbt": "{\"type\":\"NETHER\"}" + "nbt": "{\"stored_type\":\"naturesaura:nether\"}" } ] } diff --git a/src/main/resources/assets/naturesaura/advancements/aura_bottle_overworld.json b/src/main/resources/assets/naturesaura/advancements/aura_bottle_overworld.json index 8f824d8d..509f53b4 100644 --- a/src/main/resources/assets/naturesaura/advancements/aura_bottle_overworld.json +++ b/src/main/resources/assets/naturesaura/advancements/aura_bottle_overworld.json @@ -2,7 +2,7 @@ "display": { "icon": { "item": "naturesaura:aura_bottle", - "nbt": "{\"type\":\"OVERWORLD\"}" + "nbt": "{\"stored_type\":\"naturesaura:overworld\"}" }, "title": { "translate": "advancement.naturesaura.aura_bottle_overworld" @@ -19,7 +19,7 @@ "items": [ { "item": "naturesaura:aura_bottle", - "nbt": "{\"type\":\"OVERWORLD\"}" + "nbt": "{\"stored_type\":\"naturesaura:overworld\"}" } ] } diff --git a/src/main/resources/assets/naturesaura/lang/en_US.lang b/src/main/resources/assets/naturesaura/lang/en_US.lang index c58f2e76..b072bd82 100644 --- a/src/main/resources/assets/naturesaura/lang/en_US.lang +++ b/src/main/resources/assets/naturesaura/lang/en_US.lang @@ -44,10 +44,10 @@ item.naturesaura.color_changer.name=Bucket of Infinite Color item.naturesaura.book.name=Book of Natural Aura item.naturesaura.shockwave_creator.name=Amulet of Wrath item.naturesaura.multiblock_maker.name=Multiblock Maker -item.naturesaura.aura_bottle.overworld.name=Bottled Sunlight -item.naturesaura.aura_bottle.nether.name=Bottled Ghosts -item.naturesaura.aura_bottle.end.name=Bottled Darkness -item.naturesaura.aura_bottle.other.name=Bottled Substance +item.naturesaura.aura_bottle.naturesaura:overworld.name=Bottled Sunlight +item.naturesaura.aura_bottle.naturesaura:nether.name=Bottled Ghosts +item.naturesaura.aura_bottle.naturesaura:end.name=Bottled Darkness +item.naturesaura.aura_bottle.naturesaura:other.name=Bottled Substance item.naturesaura.farming_stencil.name=Farming Stencil container.naturesaura.tree_ritual.name=Ritual of the Forest diff --git a/src/main/resources/assets/naturesaura/models/item/aura_bottle.json b/src/main/resources/assets/naturesaura/models/item/aura_bottle.json index fc0685c3..8c60a4ea 100644 --- a/src/main/resources/assets/naturesaura/models/item/aura_bottle.json +++ b/src/main/resources/assets/naturesaura/models/item/aura_bottle.json @@ -1,26 +1,7 @@ { "parent": "item/generated", "textures": { - "layer0": "naturesaura:items/aura_bottle_overworld" - }, - "overrides": [ - { - "predicate": { - "naturesaura:type": 1 - }, - "model": "naturesaura:item/aura_bottle_nether" - }, - { - "predicate": { - "naturesaura:type": 2 - }, - "model": "naturesaura:item/aura_bottle_end" - }, - { - "predicate": { - "naturesaura:type": 3 - }, - "model": "naturesaura:item/aura_bottle_other" - } - ] + "layer0": "naturesaura:items/aura_bottle", + "layer1": "naturesaura:items/aura_bottle_overlay" + } } \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/models/item/aura_bottle_end.json b/src/main/resources/assets/naturesaura/models/item/aura_bottle_end.json deleted file mode 100644 index e4ad0195..00000000 --- a/src/main/resources/assets/naturesaura/models/item/aura_bottle_end.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "naturesaura:items/aura_bottle_end" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/models/item/aura_bottle_nether.json b/src/main/resources/assets/naturesaura/models/item/aura_bottle_nether.json deleted file mode 100644 index a7bf0b8b..00000000 --- a/src/main/resources/assets/naturesaura/models/item/aura_bottle_nether.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "naturesaura:items/aura_bottle_nether" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/models/item/aura_bottle_other.json b/src/main/resources/assets/naturesaura/models/item/aura_bottle_other.json deleted file mode 100644 index ada33030..00000000 --- a/src/main/resources/assets/naturesaura/models/item/aura_bottle_other.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "naturesaura:items/aura_bottle_other" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/collecting/aura_bottle.json b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/collecting/aura_bottle.json index d1802ac2..1e1b5672 100644 --- a/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/collecting/aura_bottle.json +++ b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/collecting/aura_bottle.json @@ -1,6 +1,6 @@ { "name": "Aura Bottling", - "icon": "naturesaura:aura_bottle{type:'OVERWORLD'}", + "icon": "naturesaura:aura_bottle{stored_type:'naturesaura:overworld'}", "category": "collecting", "advancement": "naturesaura:wood_stand", "pages": [ @@ -10,7 +10,7 @@ }, { "type": "spotlight", - "item": "naturesaura:aura_bottle{type:'OVERWORLD'}", + "item": "naturesaura:aura_bottle{stored_type:'naturesaura:overworld'}", "link_recipe": true, "text": "Of course, based on the world that you are currently in, the type of $(aura) collected will slightly vary. For instance, in the normal world, $(aura) can be gathered in the form of sunlight, while in the Nether realm, $(aura) can be gathered in the form of ghosts." } diff --git a/src/main/resources/assets/naturesaura/recipes/flower_generator.json b/src/main/resources/assets/naturesaura/recipes/flower_generator.json index 8c9b8fef..e850d3cc 100644 --- a/src/main/resources/assets/naturesaura/recipes/flower_generator.json +++ b/src/main/resources/assets/naturesaura/recipes/flower_generator.json @@ -21,7 +21,7 @@ "type": "minecraft:item_nbt", "item": "naturesaura:aura_bottle", "nbt": { - "type": "OVERWORLD" + "stored_type": "naturesaura:overworld" } } }, diff --git a/src/main/resources/assets/naturesaura/recipes/potion_generator.json b/src/main/resources/assets/naturesaura/recipes/potion_generator.json index 8562217b..28532f6f 100644 --- a/src/main/resources/assets/naturesaura/recipes/potion_generator.json +++ b/src/main/resources/assets/naturesaura/recipes/potion_generator.json @@ -19,7 +19,7 @@ "type": "minecraft:item_nbt", "item": "naturesaura:aura_bottle", "nbt": { - "type": "NETHER" + "stored_type": "naturesaura:nether" } } }, diff --git a/src/main/resources/assets/naturesaura/textures/items/aura_bottle.png b/src/main/resources/assets/naturesaura/textures/items/aura_bottle.png new file mode 100644 index 00000000..9fbc512b Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/items/aura_bottle.png differ diff --git a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_end.png b/src/main/resources/assets/naturesaura/textures/items/aura_bottle_end.png deleted file mode 100644 index b1bc5c87..00000000 Binary files a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_end.png and /dev/null differ diff --git a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_nether.png b/src/main/resources/assets/naturesaura/textures/items/aura_bottle_nether.png deleted file mode 100644 index db1fdb30..00000000 Binary files a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_nether.png and /dev/null differ diff --git a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_other.png b/src/main/resources/assets/naturesaura/textures/items/aura_bottle_other.png deleted file mode 100644 index 360ec68c..00000000 Binary files a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_other.png and /dev/null differ diff --git a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_overlay.png b/src/main/resources/assets/naturesaura/textures/items/aura_bottle_overlay.png new file mode 100644 index 00000000..ee27ef13 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/items/aura_bottle_overlay.png differ diff --git a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_overworld.png b/src/main/resources/assets/naturesaura/textures/items/aura_bottle_overworld.png deleted file mode 100644 index 23449358..00000000 Binary files a/src/main/resources/assets/naturesaura/textures/items/aura_bottle_overworld.png and /dev/null differ