mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Fix #264
This commit is contained in:
4 files changed
+14
-16
No files matched your search
@@ -86,10 +86,11 @@ public class MiscellaneousIcons {
|
||||
@SubscribeEvent
|
||||
public void onModelBake(ModelBakeEvent evt) {
|
||||
// Floating flowers
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:miniIsland", "normal"), FloatingFlowerModel.INSTANCE);
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:miniIsland", "inventory"), FloatingFlowerModel.INSTANCE);
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "normal"), FloatingFlowerModel.INSTANCE);
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory"), FloatingFlowerModel.INSTANCE);
|
||||
FloatingFlowerModel model = new FloatingFlowerModel();
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:miniIsland", "normal"), model);
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:miniIsland", "inventory"), model);
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "normal"), model);
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory"), model);
|
||||
|
||||
// Platforms
|
||||
evt.getModelRegistry().putObject(new ModelResourceLocation("botania:platform", "normal"), new PlatformModel());
|
||||
|
||||
@@ -126,7 +126,6 @@ public final class ModelHandler {
|
||||
public static void registerModels() {
|
||||
ModelLoaderRegistry.registerLoader(SpecialFlowerModel.Loader.INSTANCE);
|
||||
OBJLoader.INSTANCE.addDomain(LibMisc.MOD_ID.toLowerCase(Locale.ROOT));
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(FloatingFlowerModel.INSTANCE);
|
||||
|
||||
/** Subtile block models **/
|
||||
registerSubtiles();
|
||||
|
||||
@@ -50,9 +50,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadListener {
|
||||
|
||||
public static final FloatingFlowerModel INSTANCE = new FloatingFlowerModel();
|
||||
private static final String MUNDANE_PREFIX = "botania:shimmeringFlower_";
|
||||
private static final Table<IFloatingFlower.IslandType, String, CompositeBakedModel> CACHE = HashBasedTable.create();
|
||||
private final Table<IFloatingFlower.IslandType, String, CompositeBakedModel> CACHE = HashBasedTable.create();
|
||||
|
||||
protected static BakedQuad transform(BakedQuad quad, final TRSRTransformation transform) {
|
||||
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(DefaultVertexFormats.ITEM);
|
||||
@@ -139,7 +138,7 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
|
||||
|
||||
@Override
|
||||
public ItemOverrideList getOverrides() {
|
||||
return ItemHandler.INSTANCE;
|
||||
return itemHandler;
|
||||
}
|
||||
|
||||
@Override public boolean isAmbientOcclusion() { return false; }
|
||||
@@ -212,10 +211,7 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
|
||||
@Override public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; }
|
||||
}
|
||||
|
||||
private static class ItemHandler extends ItemOverrideList {
|
||||
private static final ItemHandler INSTANCE = new ItemHandler();
|
||||
private ItemHandler() { super(ImmutableList.of()); }
|
||||
|
||||
private final ItemOverrideList itemHandler = new ItemOverrideList(ImmutableList.of()) {
|
||||
@Override
|
||||
public IBakedModel handleItemState(IBakedModel model, ItemStack stack, World world, EntityLivingBase entity) {
|
||||
// Items always have GRASS island
|
||||
@@ -230,8 +226,7 @@ public class FloatingFlowerModel implements IBakedModel, IResourceManagerReloadL
|
||||
identifier = MUNDANE_PREFIX + stack.getItemDamage();
|
||||
}
|
||||
|
||||
return FloatingFlowerModel.INSTANCE.getModel(islandType, identifier);
|
||||
return FloatingFlowerModel.this.getModel(islandType, identifier);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -50,7 +52,8 @@ public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
|
||||
|
||||
IBlockState state = tile.getWorld().getBlockState(tile.getPos());
|
||||
state = state.getBlock().getExtendedState(state, tile.getWorld(), tile.getPos());
|
||||
brd.getBlockModelRenderer().renderModelBrightness(FloatingFlowerModel.INSTANCE, state, 1.0F, true);
|
||||
IBakedModel model = brd.getBlockModelShapes().getModelManager().getModel(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory"));
|
||||
brd.getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, true);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
|
||||
Reference in new issue
Block a user