mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-25 06:14:46 +00:00
Clean up sprite registration, remove all IDs
This commit is contained in:
1 parent
30aea48952
commit
2155f9eac9
22 files changed
+182
-303
No files matched your search
@@ -12,6 +12,7 @@ import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -30,7 +31,7 @@ public interface IFruitProvider {
|
||||
/** return the color to use for decorative leaves. Usually the ripe color. */
|
||||
int getDecorativeColor();
|
||||
|
||||
boolean markAsFruitLeaf(ITreeGenome genome, World world, BlockPos pos);
|
||||
boolean isFruitLeaf(ITreeGenome genome, World world, BlockPos pos);
|
||||
|
||||
int getRipeningPeriod();
|
||||
|
||||
@@ -59,18 +60,15 @@ public interface IFruitProvider {
|
||||
/* TEXTURE OVERLAY */
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @param world
|
||||
* @param pos
|
||||
* @param ripeningTime
|
||||
* Elapsed ripening time for the fruit.
|
||||
* @param fancy
|
||||
* @return IIcon index of the texture to overlay on the leaf block.
|
||||
* @param ripeningTime Elapsed ripening time for the fruit.
|
||||
* @return ResourceLocation of the texture to overlay on the leaf block.
|
||||
*/
|
||||
short getSpriteIndex(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime, boolean fancy);
|
||||
@Nullable
|
||||
ResourceLocation getSprite(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime);
|
||||
|
||||
/** return the sprite index to display on decorative leaves */
|
||||
short getDecorativeSpriteIndex();
|
||||
/** return the ResourceLocation to display on decorative leaves */
|
||||
@Nullable
|
||||
ResourceLocation getDecorativeSprite();
|
||||
|
||||
/**
|
||||
* @return true if this fruit provider requires fruit blocks to spawn, false otherwise.
|
||||
|
||||
@@ -7,7 +7,7 @@ package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
* Provides icons for leaves. Used by TreeManager.treeFactory.createSpecies()
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
*/
|
||||
public interface ILeafSpriteProvider {
|
||||
@Nonnull
|
||||
TextureAtlasSprite getSprite(boolean pollinated, boolean fancy);
|
||||
ResourceLocation getSprite(boolean pollinated, boolean fancy);
|
||||
|
||||
int getColor(boolean pollinated);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Provides icons, needed in some interfaces, most notably for bees and trees.
|
||||
*/
|
||||
public interface ISpriteProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
TextureAtlasSprite getSprite(short texUID);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerSprites();
|
||||
|
||||
}
|
||||
@@ -13,9 +13,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface ITextureManager {
|
||||
|
||||
void registerIconProvider(ISpriteProvider provider);
|
||||
|
||||
TextureAtlasSprite getSprite(short texUID);
|
||||
|
||||
TextureAtlasSprite getDefault(String ident);
|
||||
|
||||
}
|
||||
@@ -11,8 +11,9 @@ import java.util.Map;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.ISpriteProvider;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public interface IAlleleButterflySpecies extends IAlleleSpecies {
|
||||
@@ -64,7 +65,8 @@ public interface IAlleleButterflySpecies extends IAlleleSpecies {
|
||||
|
||||
Map<ItemStack, Float> getCaterpillarLoot();
|
||||
|
||||
ISpriteProvider getSpriteProvider();
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerSprites();
|
||||
|
||||
/**
|
||||
* @return The modid from the mod of the species.
|
||||
|
||||
Reference in new issue
Block a user