mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 22:34:08 +00:00
Compare commits
76
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebf399edaa | ||
|
|
4448a6a498 | ||
|
|
a13d6fca53 | ||
|
|
fef9f1b406 | ||
|
|
86ce88f068 | ||
|
|
9b2fa9de65 | ||
|
|
f87e2373f8 | ||
|
|
4df1d500ed | ||
|
|
cec10471fb | ||
|
|
177f50ca61 | ||
|
|
e184394f55 | ||
|
|
eb28396d98 | ||
|
|
dda3151b73 | ||
|
|
4e5cb59ebe | ||
|
|
fef0857603 | ||
|
|
8922ad5362 | ||
|
|
be2b66dddf | ||
|
|
6e870f4e79 | ||
|
|
4d4ba74ac1 | ||
|
|
5e3345a1d7 | ||
|
|
568ee043df | ||
|
|
a615538289 | ||
|
|
7907d1d582 | ||
|
|
46900df6cb | ||
|
|
1d8c536139 | ||
|
|
eb028d6c05 | ||
|
|
406f89a968 | ||
|
|
2c15b6150c | ||
|
|
bee13337ad | ||
|
|
98e28a0967 | ||
|
|
4a4e583aa8 | ||
|
|
300b1926de | ||
|
|
3818d2879d | ||
|
|
e12163f70c | ||
|
|
dcb236607d | ||
|
|
08de553593 | ||
|
|
f6bf6589ad | ||
|
|
da43dd8ca0 | ||
|
|
fdd1ad8d4e | ||
|
|
d4dd4cf42f | ||
|
|
0595397943 | ||
|
|
d0faf3c3c6 | ||
|
|
b01e9dfed7 | ||
|
|
cbac5fbb32 | ||
|
|
f5210997ca | ||
|
|
4b7608fc2a | ||
|
|
103efe9c7b | ||
|
|
1402e2a50a | ||
|
|
c8d9764fe3 | ||
|
|
d3055c4c4d | ||
|
|
c94df0bf67 | ||
|
|
4abb2cdd89 | ||
|
|
cabcab80e2 | ||
|
|
3e19a84b6d | ||
|
|
a30887d6f9 | ||
|
|
80bd63be0b | ||
|
|
6c9a01978a | ||
|
|
19e387f359 | ||
|
|
f799f7bc32 | ||
|
|
a2f1776245 | ||
|
|
c20247b680 | ||
|
|
a7000e8a47 | ||
|
|
ac88d0627a | ||
|
|
d8a74e2e44 | ||
|
|
cbcc49b896 | ||
|
|
30578abfb4 | ||
|
|
a172a325e1 | ||
|
|
64e3a96651 | ||
|
|
94d72161a9 | ||
|
|
8e7f1cfac1 | ||
|
|
f3cce3d24e | ||
|
|
84204db587 | ||
|
|
b7975401b3 | ||
|
|
f641e165b0 | ||
|
|
7e5974cd7c | ||
|
|
753a03b291 |
No files matched your search
@@ -77,6 +77,11 @@ dependencies {
|
||||
sshAntTask "org.apache.ant:ant-jsch:1.7.1", "jsch:jsch:0.1.29"
|
||||
}
|
||||
|
||||
compileJava {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
|
||||
processResources {
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
|
||||
@@ -62,34 +62,34 @@ import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
public final class BotaniaAPI {
|
||||
|
||||
private static List<LexiconCategory> categories = new ArrayList<LexiconCategory>();
|
||||
private static List<LexiconEntry> allEntries = new ArrayList<LexiconEntry>();
|
||||
private static List<LexiconCategory> categories = new ArrayList<>();
|
||||
private static List<LexiconEntry> allEntries = new ArrayList<>();
|
||||
|
||||
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<String, KnowledgeType>();
|
||||
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<>();
|
||||
|
||||
public static Map<String, Brew> brewMap = new LinkedHashMap<String, Brew>();
|
||||
public static Map<String, Brew> brewMap = new LinkedHashMap<>();
|
||||
|
||||
public static List<RecipePetals> petalRecipes = new ArrayList<RecipePetals>();
|
||||
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<RecipePureDaisy>();
|
||||
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<RecipeManaInfusion>();
|
||||
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<RecipeRuneAltar>();
|
||||
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<RecipeElvenTrade>();
|
||||
public static List<RecipeBrew> brewRecipes = new ArrayList<RecipeBrew>();
|
||||
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<RecipeManaInfusion>();
|
||||
public static List<RecipePetals> petalRecipes = new ArrayList<>();
|
||||
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<>();
|
||||
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<>();
|
||||
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<>();
|
||||
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<>();
|
||||
public static List<RecipeBrew> brewRecipes = new ArrayList<>();
|
||||
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<>();
|
||||
|
||||
private static BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.<String, Class<? extends SubTileEntity>> create();
|
||||
private static Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<Class<? extends SubTileEntity>, SubTileSignature>();
|
||||
private static Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<>();
|
||||
public static Set<String> subtilesForCreativeMenu = new LinkedHashSet();
|
||||
public static Map<String, String> subTileMods = new HashMap<String, String>();
|
||||
public static Map<String, String> subTileMods = new HashMap<>();
|
||||
public static BiMap<String, String> miniFlowers = HashBiMap.<String, String> create();
|
||||
|
||||
public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();
|
||||
public static Map<String, Integer> oreWeightsNether = new HashMap<String, Integer>();
|
||||
public static Map<String, Integer> oreWeights = new HashMap<>();
|
||||
public static Map<String, Integer> oreWeightsNether = new HashMap<>();
|
||||
public static Map<Item, Block> seeds = new HashMap();
|
||||
|
||||
public static Set<Item> looniumBlacklist = new LinkedHashSet<Item>();
|
||||
public static Map<Block, PropertyEnum<EnumDyeColor>> paintableBlocks = new LinkedHashMap<Block, PropertyEnum<EnumDyeColor>>();
|
||||
public static Set<String> magnetBlacklist = new LinkedHashSet<String>();
|
||||
public static Set<Item> looniumBlacklist = new LinkedHashSet<>();
|
||||
public static Map<Block, PropertyEnum<EnumDyeColor>> paintableBlocks = new LinkedHashMap<>();
|
||||
public static Set<String> magnetBlacklist = new LinkedHashSet<>();
|
||||
|
||||
|
||||
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16, new int[] { 2, 6, 5, 2 }, 18);
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package vazkii.botania.api;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.LoaderState;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -16,8 +19,9 @@ import java.util.Map;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final class BotaniaAPIClient {
|
||||
|
||||
private static final Map<String, ModelResourceLocation> queuedBlockModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> queuedItemModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> subtileBlockModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> subtileItemModels = Maps.newHashMap();
|
||||
private static final Map<IFloatingFlower.IslandType, ModelResourceLocation> islandTypeModels = Maps.newHashMap();
|
||||
|
||||
/**
|
||||
* Register your model for the given subtile class here.
|
||||
@@ -30,13 +34,14 @@ public final class BotaniaAPIClient {
|
||||
* @param itemModel A path to a blockstate json and variant to be used for this subtile's item form
|
||||
*/
|
||||
public static void registerSubtileModel(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) {
|
||||
queuedBlockModels.put(subTileName, model);
|
||||
queuedItemModels.put(subTileName, itemModel);
|
||||
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
|
||||
subtileBlockModels.put(subTileName, model);
|
||||
subtileItemModels.put(subTileName, itemModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register your model for the given subtile class here.
|
||||
* Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work.
|
||||
* Call this DURING PREINIT.
|
||||
* Your model json must specify key "tintindex" in all the faces it wants tint applied.
|
||||
* Tint is applied whenever a player recolors the flower using floral dye
|
||||
*
|
||||
@@ -57,17 +62,35 @@ public final class BotaniaAPIClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable view of the registered subtile block model map
|
||||
* @return An immutable and live view of the registered subtile block model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
|
||||
return Collections.unmodifiableMap(queuedBlockModels);
|
||||
return Collections.unmodifiableMap(subtileBlockModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable view of the registered subtile item model map
|
||||
* @return An immutable and live view of the registered subtile item model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
|
||||
return Collections.unmodifiableMap(queuedItemModels);
|
||||
return Collections.unmodifiableMap(subtileItemModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers your model for island type islandType here.
|
||||
* Call this DURING PREINIT.
|
||||
* @param islandType The islandtype to register
|
||||
* @param model The variant within a blockstate json to use as the islandtype's model
|
||||
*/
|
||||
public static void registerIslandTypeModel(IFloatingFlower.IslandType islandType, ModelResourceLocation model) {
|
||||
Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION));
|
||||
islandTypeModels.put(islandType, model);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable and live view of the registered island type model map
|
||||
*/
|
||||
public static Map<IFloatingFlower.IslandType, ModelResourceLocation> getRegisteredIslandTypeModels() {
|
||||
return Collections.unmodifiableMap(islandTypeModels);
|
||||
}
|
||||
|
||||
private BotaniaAPIClient() {}
|
||||
|
||||
@@ -33,7 +33,7 @@ public final class CorporeaHelper {
|
||||
|
||||
private static final List<IInventory> empty = Collections.unmodifiableList(new ArrayList());
|
||||
private static final WeakHashMap<List<ICorporeaSpark>, List<IInventory>> cachedNetworks = new WeakHashMap();
|
||||
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<ICorporeaAutoCompleteController>();
|
||||
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<>();
|
||||
|
||||
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@ package vazkii.botania.api.internal;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -28,8 +26,6 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
|
||||
|
||||
@@ -13,8 +13,6 @@ package vazkii.botania.api.internal;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -10,13 +10,9 @@
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -37,7 +33,7 @@ public interface IBaubleRender {
|
||||
* has a cosmetic bauble attached to it.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type);
|
||||
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks);
|
||||
|
||||
/**
|
||||
* A few helper methods for the render.
|
||||
@@ -54,7 +50,7 @@ public interface IBaubleRender {
|
||||
}
|
||||
|
||||
public static void translateToHeadLevel(EntityPlayer player) {
|
||||
GlStateManager.translate(0, -player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0);
|
||||
GlStateManager.translate(0, -player.getDefaultEyeHeight() + (player.isSneaking() ? 0.25 : 0), 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Nov 17, 2014, 6:05:18 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.HashMap;
|
||||
|
||||
public interface IFloatingFlower {
|
||||
|
||||
public ItemStack getDisplayStack();
|
||||
|
||||
public IslandType getIslandType();
|
||||
|
||||
public void setIslandType(IslandType type);
|
||||
|
||||
public class IslandType {
|
||||
private static HashMap<String, IslandType> registry = new HashMap<String, IslandType>();
|
||||
|
||||
public static final IslandType GRASS = new IslandType("GRASS");
|
||||
public static final IslandType PODZOL = new IslandType("PODZOL");
|
||||
public static final IslandType MYCEL = new IslandType("MYCEL");
|
||||
public static final IslandType SNOW = new IslandType("SNOW");
|
||||
public static final IslandType DRY = new IslandType("DRY");
|
||||
public static final IslandType GOLDEN = new IslandType("GOLDEN");
|
||||
public static final IslandType VIVID = new IslandType("VIVID");
|
||||
public static final IslandType SCORCHED = new IslandType("SCORCHED");
|
||||
public static final IslandType INFUSED = new IslandType("INFUSED");
|
||||
public static final IslandType MUTATED = new IslandType("MUTATED");
|
||||
|
||||
/**
|
||||
* Instantiates and registers a new floating flower island type
|
||||
* Note that you need to register the model for this island type, see BotaniaAPIClient
|
||||
* @param name The name of this floating flower island type
|
||||
*/
|
||||
public IslandType(String name) {
|
||||
if (registry.containsKey(name)) throw new IllegalArgumentException(name+" already registered!");
|
||||
this.typeName = name;
|
||||
registry.put(name, this);
|
||||
}
|
||||
|
||||
public final String typeName;
|
||||
|
||||
public static IslandType ofType(String typeStr) {
|
||||
IslandType type = registry.get(typeStr);
|
||||
return type == null ? GRASS : type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.typeName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,14 +25,15 @@ public class TinyPotatoRenderEvent extends Event {
|
||||
public final String name;
|
||||
public final double x, y, z;
|
||||
public final float partTicks;
|
||||
public final int destroyStage;
|
||||
|
||||
public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks) {
|
||||
public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks, int destroyStage) {
|
||||
this.tile = tile;
|
||||
this.name = name;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.partTicks = partTicks;
|
||||
this.destroyStage = destroyStage;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class LexiconCategory implements Comparable<LexiconCategory> {
|
||||
private static int count = 0;
|
||||
|
||||
public final String unlocalizedName;
|
||||
public final List<LexiconEntry> entries = new ArrayList<LexiconEntry>();
|
||||
public final List<LexiconEntry> entries = new ArrayList<>();
|
||||
private final int sortingId;
|
||||
private ResourceLocation icon;
|
||||
private int priority = 5;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
|
||||
|
||||
private KnowledgeType type = BotaniaAPI.basicKnowledge;
|
||||
|
||||
public List<LexiconPage> pages = new ArrayList<LexiconPage>();
|
||||
public List<LexiconPage> pages = new ArrayList<>();
|
||||
private boolean priority = false;
|
||||
private ItemStack icon = null;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.api.lexicon.multiblock;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -33,7 +32,7 @@ public class Multiblock {
|
||||
public BlockPos maxPos = BlockPos.ORIGIN;
|
||||
public BlockPos offPos = BlockPos.ORIGIN;
|
||||
|
||||
public HashMap<BlockPos, MultiblockComponent> locationCache = new HashMap<BlockPos, MultiblockComponent>();
|
||||
public HashMap<BlockPos, MultiblockComponent> locationCache = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Adds a multiblock component to this multiblock. The component's x y z
|
||||
@@ -125,7 +124,7 @@ public class Multiblock {
|
||||
* orientations.
|
||||
*/
|
||||
public Map<EnumFacing, Multiblock> createRotations() {
|
||||
Map<EnumFacing, Multiblock> ret = new EnumMap<EnumFacing, Multiblock>(EnumFacing.class);
|
||||
Map<EnumFacing, Multiblock> ret = new EnumMap<>(EnumFacing.class);
|
||||
|
||||
ret.put(EnumFacing.SOUTH, this);
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.api.lexicon.multiblock;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.api.lexicon.multiblock.component;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
-2
@@ -1,8 +1,6 @@
|
||||
package vazkii.botania.api.lexicon.multiblock.component;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ package vazkii.botania.api.mana;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* A block that implements this can provide an IIcon (block icons only)
|
||||
@@ -21,6 +23,7 @@ import net.minecraft.world.World;
|
||||
*/
|
||||
public interface IPoolOverlayProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public TextureAtlasSprite getIcon(World world, BlockPos pos);
|
||||
|
||||
}
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
package vazkii.botania.api.state;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.block.BlockRailBase;
|
||||
import net.minecraft.block.BlockRailPowered;
|
||||
@@ -16,8 +15,10 @@ import net.minecraft.block.BlockRotatedPillar;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
import vazkii.botania.api.state.enums.*;
|
||||
|
||||
/**
|
||||
@@ -28,10 +29,13 @@ public class BotaniaStateProps {
|
||||
/** Unlisted properties **/
|
||||
|
||||
// The property for specialFlower subtile id
|
||||
public static final PropertyString SUBTILE_ID = new PropertyString("subtile_id");
|
||||
public static final PropertyObject<String> SUBTILE_ID = new PropertyObject<>("subtile_id", String.class);
|
||||
|
||||
// The property for floating flower island type
|
||||
public static final PropertyObject<IFloatingFlower.IslandType> ISLAND_TYPE = new PropertyObject<>("islandtype", IFloatingFlower.IslandType.class);
|
||||
|
||||
// The property for platform held blockstate id
|
||||
public static final PropertyState HELD_STATE = new PropertyState("held_state");
|
||||
public static final PropertyObject<IBlockState> HELD_STATE = new PropertyObject<>("held_state", IBlockState.class);
|
||||
|
||||
/** Common properties to all blocks to use **/
|
||||
|
||||
@@ -65,12 +69,9 @@ public class BotaniaStateProps {
|
||||
public static final PropertyEnum<FutureStoneVariant> FUTURESTONE_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class);
|
||||
|
||||
// Block18StoneWall
|
||||
public static final PropertyEnum<FutureStoneVariant> FUTURESTONEWALL_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class, new Predicate<FutureStoneVariant>() {
|
||||
@Override
|
||||
public boolean apply(FutureStoneVariant variant) {
|
||||
// Just the four kinds (no polished, chiseled, etc.)
|
||||
return variant.ordinal() >= 0 && variant.ordinal() <= 3;
|
||||
}
|
||||
public static final PropertyEnum<FutureStoneVariant> FUTURESTONEWALL_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class, variant -> {
|
||||
// Just the four kinds (no polished, chiseled, etc.)
|
||||
return variant.ordinal() >= 0 && variant.ordinal() <= 3;
|
||||
});
|
||||
|
||||
// BlockAlfPortal
|
||||
@@ -89,12 +90,7 @@ public class BotaniaStateProps {
|
||||
public static final PropertyEnum<BiomeBrickVariant> BIOMEBRICK_VARIANT = PropertyEnum.create("variant", BiomeBrickVariant.class);
|
||||
|
||||
// BlockBiomeStoneWall
|
||||
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, new Predicate<BiomeStoneVariant>() {
|
||||
@Override
|
||||
public boolean apply(BiomeStoneVariant input) {
|
||||
return input.getName().contains("cobble");
|
||||
}
|
||||
});
|
||||
public static final PropertyEnum<BiomeStoneVariant> BIOMESTONEWALL_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class, input -> input.getName().contains("cobble"));
|
||||
|
||||
// BlockCustomBrick
|
||||
public static final PropertyEnum<CustomBrickVariant> CUSTOMBRICK_VARIANT = PropertyEnum.create("variant", CustomBrickVariant.class);
|
||||
@@ -120,36 +116,21 @@ public class BotaniaStateProps {
|
||||
// BlockLivingRock
|
||||
public static final PropertyEnum<LivingRockVariant> LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class);
|
||||
|
||||
// BlockModDoubleFlower
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
@Override
|
||||
public boolean apply(EnumDyeColor input) {
|
||||
// White to gray
|
||||
return input.ordinal() >= 0 && input.ordinal() <= 7;
|
||||
}
|
||||
});
|
||||
// BlockModDoubleFlower (white to gray)
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 0 && input.ordinal() <= 7);
|
||||
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
@Override
|
||||
public boolean apply(EnumDyeColor input) {
|
||||
// Silver to black
|
||||
return input.ordinal() >= 8 && input.ordinal() <= 15;
|
||||
}
|
||||
});
|
||||
// (silver to black)
|
||||
public static final PropertyEnum<EnumDyeColor> DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("variant", EnumDyeColor.class, input -> input.ordinal() >= 8 && input.ordinal() <= 15);
|
||||
|
||||
// BlockOpenCrate
|
||||
public static final PropertyEnum<CrateVariant> CRATE_VARIANT = PropertyEnum.create("variant", CrateVariant.class);
|
||||
public static final PropertyEnum<CratePattern> CRATE_PATTERN = PropertyEnum.create("pattern", CratePattern.class);
|
||||
|
||||
// BlockPavement
|
||||
public static final PropertyEnum<EnumDyeColor> PAVEMENT_COLOR = PropertyEnum.create("color", EnumDyeColor.class, new Predicate<EnumDyeColor>() {
|
||||
@Override
|
||||
public boolean apply(EnumDyeColor color) {
|
||||
return color == EnumDyeColor.WHITE || color == EnumDyeColor.BLACK
|
||||
|| color == EnumDyeColor.BLUE || color == EnumDyeColor.RED
|
||||
|| color == EnumDyeColor.YELLOW || color == EnumDyeColor.GREEN;
|
||||
}
|
||||
});
|
||||
public static final PropertyEnum<EnumDyeColor> PAVEMENT_COLOR = PropertyEnum.create("color", EnumDyeColor.class, color ->
|
||||
color == EnumDyeColor.WHITE || color == EnumDyeColor.BLACK
|
||||
|| color == EnumDyeColor.BLUE || color == EnumDyeColor.RED
|
||||
|| color == EnumDyeColor.YELLOW || color == EnumDyeColor.GREEN);
|
||||
|
||||
// BlockPlatform
|
||||
public static final PropertyEnum<PlatformVariant> PLATFORM_VARIANT = PropertyEnum.create("variant", PlatformVariant.class);
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package vazkii.botania.api.state;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
// Generic base class for unlisted properties
|
||||
public class PropertyObject<T> implements IUnlistedProperty<T> {
|
||||
|
||||
private final String name;
|
||||
private final Class<T> clazz;
|
||||
private final Predicate<T> validator;
|
||||
private final Function<T, String> stringFunction;
|
||||
|
||||
public PropertyObject(String name, Class<T> clazz, Predicate<T> validator, Function<T, String> stringFunction) {
|
||||
this.name = name;
|
||||
this.clazz = clazz;
|
||||
this.validator = validator;
|
||||
this.stringFunction = stringFunction;
|
||||
}
|
||||
|
||||
public PropertyObject(String name, Class<T> clazz) {
|
||||
this(name, clazz, Predicates.alwaysTrue(), Object::toString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(T value) {
|
||||
return validator.apply(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<T> getType() {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String valueToString(T value) {
|
||||
return stringFunction.apply(value);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/**
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.api.state;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
// An unlisted property that holds an IBlockState. Used for platform rendering
|
||||
public class PropertyState implements IUnlistedProperty<IBlockState> {
|
||||
|
||||
private final String name;
|
||||
|
||||
public PropertyState(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(IBlockState value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<IBlockState> getType() {
|
||||
return IBlockState.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String valueToString(IBlockState value) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.api.state;
|
||||
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
||||
// An unlisted property that holds a String, used for subtile rendering
|
||||
public class PropertyString implements IUnlistedProperty<String> {
|
||||
|
||||
private final String name;
|
||||
|
||||
public PropertyString(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<String> getType() {
|
||||
return String.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String valueToString(String value) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -10,13 +10,11 @@
|
||||
*/
|
||||
package vazkii.botania.api.subtile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
package vazkii.botania.api.subtile;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -101,7 +100,7 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
|
||||
if(passive && muhBalance > 0 && passiveDecayTicks > muhBalance) {
|
||||
supertile.getWorld().playAuxSFX(2001, supertile.getPos(), Block.getIdFromBlock(supertile.getBlockType()));
|
||||
if(supertile.getWorld().getBlockState(supertile.getPos().down()).getBlock().isSideSolid(supertile.getWorld(), supertile.getPos().down(), EnumFacing.DOWN))
|
||||
if(supertile.getWorld().getBlockState(supertile.getPos().down()).getBlock().isSideSolid(supertile.getWorld(), supertile.getPos().down(), EnumFacing.UP))
|
||||
supertile.getWorld().setBlockState(supertile.getPos(), Blocks.deadbush.getDefaultState());
|
||||
else supertile.getWorld().setBlockToAir(supertile.getPos());
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ package vazkii.botania.api.subtile.signature;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
@@ -10,23 +10,18 @@
|
||||
*/
|
||||
package vazkii.botania.client.core.handler;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.item.IBaubleRender;
|
||||
import vazkii.botania.api.item.IBaubleRender.Helper;
|
||||
import vazkii.botania.api.item.IBaubleRender.RenderType;
|
||||
@@ -39,38 +34,37 @@ import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public final class BaubleRenderHandler {
|
||||
public final class BaubleRenderHandler implements LayerRenderer<EntityPlayer> {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerRender(RenderPlayerEvent.Specials.Post event) {
|
||||
if(!ConfigHandler.renderBaubles || event.entityLiving.getActivePotionEffect(Potion.invisibility) != null)
|
||||
@Override
|
||||
public void doRenderLayer(EntityPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
|
||||
if(!ConfigHandler.renderBaubles || player.getActivePotionEffect(Potion.invisibility) != null)
|
||||
return;
|
||||
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
|
||||
|
||||
dispatchRenders(inv, event, RenderType.BODY);
|
||||
dispatchRenders(inv, player, RenderType.BODY, partialTicks);
|
||||
if(inv.getStackInSlot(3) != null)
|
||||
renderManaTablet(event);
|
||||
renderManaTablet(player);
|
||||
|
||||
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick;
|
||||
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick;
|
||||
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick;
|
||||
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks;
|
||||
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks;
|
||||
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.rotate(yawOffset, 0, -1, 0);
|
||||
GlStateManager.rotate(yaw - 270, 0, 1, 0);
|
||||
GlStateManager.rotate(pitch, 0, 0, 1);
|
||||
dispatchRenders(inv, event, RenderType.HEAD);
|
||||
dispatchRenders(inv, player, RenderType.HEAD, partialTicks);
|
||||
|
||||
ItemStack helm = player.inventory.armorItemInSlot(3);
|
||||
if(helm != null && helm.getItem() instanceof ItemTerrasteelHelm)
|
||||
ItemTerrasteelHelm.renderOnPlayer(helm, event);
|
||||
ItemTerrasteelHelm.renderOnPlayer(helm, player);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
private void dispatchRenders(InventoryBaubles inv, RenderPlayerEvent event, RenderType type) {
|
||||
private void dispatchRenders(InventoryBaubles inv, EntityPlayer player, RenderType type, float partialTicks) {
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
@@ -87,8 +81,9 @@ public final class BaubleRenderHandler {
|
||||
ItemStack cosmetic = attachable.getCosmeticItem(stack);
|
||||
if(cosmetic != null) {
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); // Some of the baubles use this so we must restore it manually as well
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
((IBaubleRender) cosmetic.getItem()).onPlayerBaubleRender(cosmetic, event, type);
|
||||
((IBaubleRender) cosmetic.getItem()).onPlayerBaubleRender(cosmetic, player, type, partialTicks);
|
||||
GlStateManager.popMatrix();
|
||||
continue;
|
||||
}
|
||||
@@ -96,29 +91,33 @@ public final class BaubleRenderHandler {
|
||||
|
||||
if(item instanceof IBaubleRender) {
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); // Some of the baubles use this so we must restore it manually as well
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
((IBaubleRender) stack.getItem()).onPlayerBaubleRender(stack, event, type);
|
||||
((IBaubleRender) stack.getItem()).onPlayerBaubleRender(stack, player, type, partialTicks);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderManaTablet(RenderPlayerEvent event) {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
private void renderManaTablet(EntityPlayer player) {
|
||||
boolean renderedOne = false;
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if(stack != null && stack.getItem() == ModItems.manaTablet) {
|
||||
Item item = stack.getItem();
|
||||
GlStateManager.pushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
Helper.rotateIfSneaking(event.entityPlayer);
|
||||
boolean armor = event.entityPlayer.getCurrentArmor(1) != null;
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.25F, -0.85F, renderedOne ? armor ? 0.2F : 0.28F : armor ? -0.3F : -0.25F);
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
Helper.rotateIfSneaking(player);
|
||||
boolean armor = player.getCurrentArmor(1) != null;
|
||||
GlStateManager.rotate(90, 0, 1, 0);
|
||||
GlStateManager.rotate(90, 1, 0, 0);
|
||||
|
||||
if (renderedOne)
|
||||
GlStateManager.translate(0F, armor ? 0.20F : 0.18F, -0.25F);
|
||||
else
|
||||
GlStateManager.translate(0F, armor ? -0.39F : -0.35F, -0.25F);
|
||||
|
||||
GlStateManager.scale(0.75F, 0.75F, 0.75F);
|
||||
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
int light = 15728880;
|
||||
@@ -135,5 +134,8 @@ public final class BaubleRenderHandler {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldCombineTextures() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,15 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
public void doRenderLayer(EntityPlayer player, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
|
||||
String name = player.getDisplayName().getUnformattedText();
|
||||
|
||||
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks;
|
||||
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks;
|
||||
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.rotate(yawOffset, 0, -1, 0);
|
||||
GlStateManager.rotate(yaw - 270, 0, 1, 0);
|
||||
GlStateManager.rotate(pitch, 0, 0, 1);
|
||||
|
||||
if(name.equals("Vazkii") || name.equals("_phi")) {
|
||||
if(phi)
|
||||
renderPhiFlower(player);
|
||||
@@ -60,6 +69,8 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
name = name.toLowerCase();
|
||||
if(player.isWearing(EnumPlayerModelParts.CAPE) && flowerMap != null && flowerMap.containsKey(name))
|
||||
renderFlower(player, flowerMap.get(name));
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,12 +113,12 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
Helper.translateToHeadLevel(player);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
//GlStateManager.rotate(90F, 0F, 1F, 0F); todo 1.8 refine
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0, 1.62, 0);
|
||||
float t = 0.13F;
|
||||
GlStateManager.translate(t, -0.5F, -0.1F);
|
||||
if(player.motionY < 0)
|
||||
GlStateManager.rotate((float) player.motionY * 20F, -1F, 0F, 0F);
|
||||
GlStateManager.rotate((float) player.motionY * 20F, 1F, 0F, 0F);
|
||||
|
||||
float r = -18F + (float) Math.sin((ClientTickHandler.ticksInGame + partialTicks) * 0.05F) * 2F;
|
||||
GlStateManager.rotate(r, 0F, 0F, 1F);
|
||||
@@ -135,11 +146,10 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(-0.4F, 0.1F, -0.25F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
// todo 1.8 refine
|
||||
// GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.scale(0.4F, 0.4F, 0.4F);
|
||||
GlStateManager.translate(0.70F, -3.5F, 0.125F);
|
||||
// GlStateManager.rotate(20F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(-1F, -3.5F, 0.125F);
|
||||
GlStateManager.rotate(20F, 1F, 0F, 0F);
|
||||
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
@@ -153,9 +163,9 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
float f3 = icon.getMaxV();
|
||||
Helper.rotateIfSneaking(player);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.75F, 0.5F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.scale(0.4F, 0.4F, 0.4F);
|
||||
GlStateManager.translate(1.2F, 0.5F, 0F);
|
||||
GlStateManager.translate(-0.5F, 1.6F, 0F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
GlStateManager.popMatrix();
|
||||
@@ -166,7 +176,8 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
Helper.translateToHeadLevel(player);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.rotate(-90, 1, 0, 0);
|
||||
GlStateManager.translate(0, 0, 1.22); // todo 1.8 refine
|
||||
GlStateManager.translate(0, 0, 1.22);
|
||||
GlStateManager.rotate(90, 0, 0, 1);
|
||||
ShaderHelper.useShader(ShaderHelper.gold);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItemModelForEntity(flower, player, ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
ShaderHelper.releaseShader();
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiChat;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
@@ -39,23 +38,17 @@ public class CorporeaAutoCompleteHandler {
|
||||
|
||||
boolean isAutoCompleted = false;
|
||||
String originalString = "";
|
||||
List<CompletionData> completions = new ArrayList<CompletionData>();
|
||||
List<CompletionData> completions = new ArrayList<>();
|
||||
int position;
|
||||
|
||||
static TreeSet<String> itemNames = new TreeSet<String>(
|
||||
new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String arg0, String arg1) {
|
||||
return arg0.compareToIgnoreCase(arg1);
|
||||
}
|
||||
});
|
||||
static TreeSet<String> itemNames = new TreeSet<>(String::compareToIgnoreCase);
|
||||
|
||||
private boolean tabLastTick = false;
|
||||
|
||||
public static void updateItemList() {
|
||||
itemNames.clear();
|
||||
Iterator<Item> iterator = Item.itemRegistry.iterator();
|
||||
ArrayList<ItemStack> curList = new ArrayList<ItemStack>();
|
||||
ArrayList<ItemStack> curList = new ArrayList<>();
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
Item item = iterator.next();
|
||||
@@ -146,7 +139,7 @@ public class CorporeaAutoCompleteHandler {
|
||||
if(s.isEmpty())
|
||||
return new ArrayList();
|
||||
|
||||
TreeSet<CompletionData> result = new TreeSet<CompletionData>();
|
||||
TreeSet<CompletionData> result = new TreeSet<>();
|
||||
String[] words = s.split(" ");
|
||||
int i = words.length - 1;
|
||||
String curPrefix = words[i];
|
||||
@@ -156,11 +149,11 @@ public class CorporeaAutoCompleteHandler {
|
||||
if(i >= 0)
|
||||
curPrefix = words[i] + " " + curPrefix;
|
||||
}
|
||||
return new ArrayList<CompletionData>(result);
|
||||
return new ArrayList<>(result);
|
||||
}
|
||||
|
||||
private List<CompletionData> getNamesStartingWith(String prefix) {
|
||||
ArrayList<CompletionData> result = new ArrayList<CompletionData>();
|
||||
ArrayList<CompletionData> result = new ArrayList<>();
|
||||
int length = prefix.length();
|
||||
SortedSet<String> after = itemNames.tailSet(prefix);
|
||||
for(String str : after) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.client.gui.GuiChat;
|
||||
import net.minecraft.client.gui.GuiIngame;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -36,7 +35,6 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.ILexicon;
|
||||
|
||||
@@ -16,13 +16,11 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -177,11 +177,11 @@ public class LightningHandler {
|
||||
|
||||
public static class LightningBolt {
|
||||
|
||||
public ArrayList<Segment> segments = new ArrayList<Segment>();
|
||||
public ArrayList<Segment> segments = new ArrayList<>();
|
||||
public Vector3 start;
|
||||
public Vector3 end;
|
||||
BlockPos target;
|
||||
HashMap<Integer, Integer> splitparents = new HashMap<Integer, Integer>();
|
||||
HashMap<Integer, Integer> splitparents = new HashMap<>();
|
||||
|
||||
public double length;
|
||||
public int numsegments0;
|
||||
@@ -198,7 +198,7 @@ public class LightningHandler {
|
||||
private World world;
|
||||
private Entity source;
|
||||
|
||||
public static ConcurrentLinkedQueue<LightningBolt> boltlist = new ConcurrentLinkedQueue<LightningBolt>();
|
||||
public static ConcurrentLinkedQueue<LightningBolt> boltlist = new ConcurrentLinkedQueue<>();
|
||||
|
||||
public float speed = 1.5F;
|
||||
public static final int fadetime = 20;
|
||||
@@ -350,7 +350,7 @@ public class LightningHandler {
|
||||
return;
|
||||
|
||||
ArrayList<Segment> oldsegments = segments;
|
||||
segments = new ArrayList<Segment>();
|
||||
segments = new ArrayList<>();
|
||||
|
||||
Segment prev = null;
|
||||
|
||||
@@ -431,7 +431,7 @@ public class LightningHandler {
|
||||
}
|
||||
|
||||
private void calculateCollisionAndDiffs() {
|
||||
HashMap<Integer, Integer> lastactivesegment = new HashMap<Integer, Integer>();
|
||||
HashMap<Integer, Integer> lastactivesegment = new HashMap<>();
|
||||
|
||||
Collections.sort(segments, new SegmentSorter());
|
||||
|
||||
|
||||
@@ -10,13 +10,21 @@ package vazkii.botania.client.core.handler;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.event.CommandEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.model.FloatingFlowerModel;
|
||||
import vazkii.botania.client.model.PlatformModel;
|
||||
@@ -27,6 +35,11 @@ import vazkii.botania.common.item.ItemSparkUpgrade;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
import vazkii.botania.common.item.relic.ItemKingKey;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.IntBuffer;
|
||||
import java.util.Map;
|
||||
|
||||
public class MiscellaneousIcons {
|
||||
@@ -47,7 +60,8 @@ public class MiscellaneousIcons {
|
||||
corporeaIconStar,
|
||||
sparkWorldIcon,
|
||||
manaDetectorIcon,
|
||||
runeAltarTriggerIcon;
|
||||
runeAltarTriggerIcon,
|
||||
terrasteelHelmWillIcon;
|
||||
|
||||
public TextureAtlasSprite[] sparkUpgradeIcons;
|
||||
public TextureAtlasSprite[] kingKeyWeaponIcons;
|
||||
@@ -61,6 +75,16 @@ public class MiscellaneousIcons {
|
||||
public TextureAtlasSprite nerfBatIcon = null;
|
||||
// end dank_memes
|
||||
|
||||
// Icons for baubles that don't render their own model on the player
|
||||
public TextureAtlasSprite
|
||||
bloodPendantChain,
|
||||
bloodPendantGem,
|
||||
snowflakePendantGem,
|
||||
itemFinderGem,
|
||||
pyroclastGem,
|
||||
crimsonGem;
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onModelBake(ModelBakeEvent evt) {
|
||||
// BlockSpecialFlower
|
||||
@@ -123,7 +147,59 @@ public class MiscellaneousIcons {
|
||||
|
||||
tiaraWingIcons = new TextureAtlasSprite[ItemFlightTiara.WING_TYPES];
|
||||
for (int i = 0; i < tiaraWingIcons.length; i++) {
|
||||
tiaraWingIcons[i] = IconHelper.forName(evt.map, "flightTiara" + i, "items");
|
||||
tiaraWingIcons[i] = IconHelper.forName(evt.map, "flightTiara" + (i + 1), "items");
|
||||
}
|
||||
|
||||
terrasteelHelmWillIcon = IconHelper.forName(evt.map, "willFlame", "items");
|
||||
|
||||
bloodPendantChain = IconHelper.forName(evt.map, "bloodPendant2", "items");
|
||||
bloodPendantGem = IconHelper.forName(evt.map, "bloodPendant3", "items");
|
||||
snowflakePendantGem = IconHelper.forName(evt.map, "icePendantGem", "items");
|
||||
itemFinderGem = IconHelper.forName(evt.map, "itemFinderGem", "items");
|
||||
pyroclastGem = IconHelper.forName(evt.map, "lavaPendantGem", "items");
|
||||
crimsonGem = IconHelper.forName(evt.map, "superLavaPendantGem", "items");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void dumpAtlas(ArrowLooseEvent evt) {
|
||||
if (!evt.entityPlayer.worldObj.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")))
|
||||
return;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
|
||||
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
|
||||
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
|
||||
|
||||
System.out.printf("Atlas is %d wide by %d tall%n", width, height);
|
||||
|
||||
int pixels = width * height;
|
||||
|
||||
IntBuffer buffer = BufferUtils.createIntBuffer(pixels);
|
||||
int[] pixelValues = new int[pixels];
|
||||
|
||||
GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
|
||||
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
|
||||
|
||||
buffer.get(pixelValues);
|
||||
|
||||
BufferedImage bufferedimage = new BufferedImage(width, height, 2);
|
||||
|
||||
for (int k = 0; k < height; ++k)
|
||||
{
|
||||
for (int l = 0; l < width; ++l)
|
||||
{
|
||||
bufferedimage.setRGB(l, k, pixelValues[k * width + l]);
|
||||
}
|
||||
}
|
||||
|
||||
File mcFolder = Minecraft.getMinecraft().mcDataDir;
|
||||
File result = new File(mcFolder, "atlas.png");
|
||||
|
||||
try {
|
||||
ImageIO.write(bufferedimage, "png", result);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,13 @@ import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.BlockSkull;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.BlockWall;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.ItemModelMesher;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
@@ -32,6 +34,7 @@ import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import vazkii.botania.api.BotaniaAPIClient;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
import vazkii.botania.api.state.enums.PlatformVariant;
|
||||
import vazkii.botania.api.state.enums.SpreaderVariant;
|
||||
import vazkii.botania.client.model.SpecialFlowerModel;
|
||||
@@ -165,172 +168,163 @@ public final class ModelHandler {
|
||||
registerBrews();
|
||||
|
||||
/** Special Item Meshers **/
|
||||
// Cannot use lambdas directly yet because FG/SS can't reobfuscate them, need a dummy wrapper
|
||||
// See https://github.com/MinecraftForge/ForgeGradle/issues/314.
|
||||
|
||||
ModelLoader.registerItemVariants(elementiumShears,
|
||||
new ModelResourceLocation("botania:elementiumShears", "inventory"),
|
||||
new ModelResourceLocation("botania:dammitReddit", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(elementiumShears, MesherWrapper.of(stack ->
|
||||
stack.getDisplayName().equalsIgnoreCase("dammit reddit")
|
||||
? new ModelResourceLocation("botania:dammitReddit", "inventory")
|
||||
: new ModelResourceLocation("botania:elementiumShears", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(grassHorn,
|
||||
new ModelResourceLocation("botania:grassHorn0", "inventory"),
|
||||
new ModelResourceLocation("botania:grassHorn1", "inventory"),
|
||||
new ModelResourceLocation("botania:grassHorn2", "inventory"),
|
||||
new ModelResourceLocation("botania:vuvuzela", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(grassHorn, MesherWrapper.of(stack ->
|
||||
stack.getDisplayName().toLowerCase().contains("vuvuzela")
|
||||
? new ModelResourceLocation("botania:vuvuzela", "inventory")
|
||||
: new ModelResourceLocation("botania:grassHorn" + stack.getMetadata(), "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(infiniteFruit,
|
||||
new ModelResourceLocation("botania:infiniteFruit", "inventory"),
|
||||
new ModelResourceLocation("botania:infiniteFruitBoot", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(infiniteFruit, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return ItemInfiniteFruit.isBoot(stack) ? new ModelResourceLocation("botania:infiniteFruitBoot", "inventory")
|
||||
: new ModelResourceLocation("botania:infiniteFruit", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(infiniteFruit, MesherWrapper.of(stack ->
|
||||
ItemInfiniteFruit.isBoot(stack)
|
||||
? new ModelResourceLocation("botania:infiniteFruitBoot", "inventory")
|
||||
: new ModelResourceLocation("botania:infiniteFruit", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(magnetRing,
|
||||
new ModelResourceLocation("botania:magnetRingOn", "inventory"),
|
||||
new ModelResourceLocation("botania:magnetRingOff", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(magnetRing, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return ItemMagnetRing.getCooldown(stack) <= 0 ? new ModelResourceLocation("botania:magnetRingOn", "inventory")
|
||||
: new ModelResourceLocation("botania:magnetRingOff", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(magnetRing, MesherWrapper.of(stack ->
|
||||
ItemMagnetRing.getCooldown(stack) <= 0
|
||||
? new ModelResourceLocation("botania:magnetRingOn", "inventory")
|
||||
: new ModelResourceLocation("botania:magnetRingOff", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(magnetRingGreater,
|
||||
new ModelResourceLocation("botania:magnetRingGreaterOn", "inventory"),
|
||||
new ModelResourceLocation("botania:magnetRingGreaterOff", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(magnetRingGreater, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return ItemMagnetRing.getCooldown(stack) <= 0 ? new ModelResourceLocation("botania:magnetRingGreaterOn", "inventory")
|
||||
: new ModelResourceLocation("botania:magnetRingGreaterOff", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(magnetRingGreater, MesherWrapper.of(stack ->
|
||||
ItemMagnetRing.getCooldown(stack) <= 0
|
||||
? new ModelResourceLocation("botania:magnetRingGreaterOn", "inventory")
|
||||
: new ModelResourceLocation("botania:magnetRingGreaterOff", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(manaGun,
|
||||
new ModelResourceLocation("botania:manaGun", "inventory"),
|
||||
new ModelResourceLocation("botania:manaGunClip", "inventory"),
|
||||
new ModelResourceLocation("botania:desuGun", "inventory"),
|
||||
new ModelResourceLocation("botania:desuGunClip", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(manaGun, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
String name;
|
||||
if (((ItemManaGun) manaGun).isSugoiKawaiiDesuNe(stack)) {
|
||||
name = ItemManaGun.hasClip(stack) ? "botania:desuGunClip" : "botania:desuGun";
|
||||
} else {
|
||||
name = ItemManaGun.hasClip(stack) ? "botania:manaGunClip": "botania:manaGun";
|
||||
}
|
||||
return new ModelResourceLocation(name, "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(manaGun, MesherWrapper.of(stack -> {
|
||||
String name = ((ItemManaGun) manaGun).isSugoiKawaiiDesuNe(stack) ? "botania:desuGun" : "botania:manaGun";
|
||||
return new ModelResourceLocation(name + (ItemManaGun.hasClip(stack) ? "Clip" : ""), "inventory");
|
||||
}));
|
||||
|
||||
ModelLoader.registerItemVariants(tornadoRod,
|
||||
new ModelResourceLocation("botania:tornadoRod", "inventory"),
|
||||
new ModelResourceLocation("botania:tornadoRod_flying", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(tornadoRod, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return ((ItemTornadoRod) ModItems.tornadoRod).isFlying(stack) ? new ModelResourceLocation("botania:tornadoRod_flying", "inventory") : new ModelResourceLocation("botania:tornadoRod", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(tornadoRod, MesherWrapper.of(stack ->
|
||||
((ItemTornadoRod) ModItems.tornadoRod).isFlying(stack)
|
||||
? new ModelResourceLocation("botania:tornadoRod_flying", "inventory")
|
||||
: new ModelResourceLocation("botania:tornadoRod", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(twigWand,
|
||||
new ModelResourceLocation("botania:twigWand", "inventory"),
|
||||
new ModelResourceLocation("botania:twigWand_bind", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(twigWand, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
String path = "botania:twigWand";
|
||||
return new ModelResourceLocation(path + (ItemTwigWand.getBindMode(stack) ? "_bind" : ""), "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(twigWand, MesherWrapper.of(stack -> {
|
||||
String path = "botania:twigWand";
|
||||
return new ModelResourceLocation(path + (ItemTwigWand.getBindMode(stack) ? "_bind" : ""), "inventory");
|
||||
}));
|
||||
|
||||
ModelLoader.registerItemVariants(manaCookie,
|
||||
new ModelResourceLocation("botania:manaCookie", "inventory"),
|
||||
new ModelResourceLocation("botania:totalBiscuit", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(manaCookie, MesherWrapper.of(stack ->
|
||||
stack.getDisplayName().toLowerCase().equals("totalbiscuit")
|
||||
? new ModelResourceLocation("botania:totalBiscuit", "inventory")
|
||||
: new ModelResourceLocation("botania:manaCookie", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(manaweaveBoots,
|
||||
new ModelResourceLocation("botania:manaweaveBoots", "inventory"),
|
||||
new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory"));
|
||||
|
||||
ModelLoader.setCustomMeshDefinition(manaweaveBoots, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return ClientProxy.jingleTheBells ? new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory")
|
||||
: new ModelResourceLocation("botania:manaweaveBoots", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(manaweaveBoots, MesherWrapper.of(stack ->
|
||||
ClientProxy.jingleTheBells
|
||||
? new ModelResourceLocation("botania:manaweaveBootsHoliday", "inventory")
|
||||
: new ModelResourceLocation("botania:manaweaveBoots", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(manaweaveChest,
|
||||
new ModelResourceLocation("botania:manaweaveChest", "inventory"),
|
||||
new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory"));
|
||||
|
||||
ModelLoader.setCustomMeshDefinition(manaweaveChest, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return ClientProxy.jingleTheBells ? new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory")
|
||||
: new ModelResourceLocation("botania:manaweaveChest", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(manaweaveChest, MesherWrapper.of(stack ->
|
||||
ClientProxy.jingleTheBells
|
||||
? new ModelResourceLocation("botania:manaweaveChestHoliday", "inventory")
|
||||
: new ModelResourceLocation("botania:manaweaveChest", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(manaweaveHelm,
|
||||
new ModelResourceLocation("botania:manaweaveHelm", "inventory"),
|
||||
new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory"));
|
||||
|
||||
ModelLoader.setCustomMeshDefinition(manaweaveHelm, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return ClientProxy.jingleTheBells ? new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory")
|
||||
: new ModelResourceLocation("botania:manaweaveHelm", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(manaweaveHelm, MesherWrapper.of(stack ->
|
||||
ClientProxy.jingleTheBells
|
||||
? new ModelResourceLocation("botania:manaweaveHelmHoliday", "inventory")
|
||||
: new ModelResourceLocation("botania:manaweaveHelm", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(manaweaveLegs,
|
||||
new ModelResourceLocation("botania:manaweaveLegs", "inventory"),
|
||||
new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory"));
|
||||
|
||||
ModelLoader.setCustomMeshDefinition(manaweaveLegs, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return ClientProxy.jingleTheBells ? new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory")
|
||||
: new ModelResourceLocation("botania:manaweaveLegs", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(manaweaveLegs, MesherWrapper.of(stack ->
|
||||
ClientProxy.jingleTheBells
|
||||
? new ModelResourceLocation("botania:manaweaveLegsHoliday", "inventory")
|
||||
: new ModelResourceLocation("botania:manaweaveLegs", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(manasteelSword,
|
||||
new ModelResourceLocation("botania:manasteelSword", "inventory"),
|
||||
new ModelResourceLocation("botania:elucidator", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(manasteelSword, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return "the elucidator".equals(stack.getDisplayName().toLowerCase().trim()) ? new ModelResourceLocation("botania:elucidator", "inventory")
|
||||
: new ModelResourceLocation("botania:manasteelSword", "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(manasteelSword, MesherWrapper.of(stack ->
|
||||
"the elucidator".equals(stack.getDisplayName().toLowerCase().trim())
|
||||
? new ModelResourceLocation("botania:elucidator", "inventory")
|
||||
: new ModelResourceLocation("botania:manasteelSword", "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(spawnerMover,
|
||||
new ModelResourceLocation("botania:spawnerMover", "inventory"),
|
||||
new ModelResourceLocation("botania:spawnerMoverFull", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(spawnerMover, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
if (ItemSpawnerMover.hasData(stack)) {
|
||||
return new ModelResourceLocation("botania:spawnerMoverFull", "inventory");
|
||||
} else {
|
||||
return new ModelResourceLocation("botania:spawnerMover", "inventory");
|
||||
}
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(spawnerMover, MesherWrapper.of(stack -> new ModelResourceLocation("botania:spawnerMover" + (ItemSpawnerMover.hasData(stack) ? "Full" : ""), "inventory")));
|
||||
|
||||
ModelLoader.registerItemVariants(terraPick,
|
||||
new ModelResourceLocation("botania:terraPick", "inventory"),
|
||||
new ModelResourceLocation("botania:terraPickEnabled", "inventory"),
|
||||
new ModelResourceLocation("botania:terraPickTipped", "inventory"),
|
||||
new ModelResourceLocation("botania:terraPickTippedEnabled", "inventory"));
|
||||
ModelLoader.setCustomMeshDefinition(terraPick, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
String name = "botania:terraPick";
|
||||
if (ItemTerraPick.isTipped(stack)) {
|
||||
name += "Tipped";
|
||||
}
|
||||
if (ItemTerraPick.isEnabled(stack)) {
|
||||
name += "Enabled";
|
||||
}
|
||||
return new ModelResourceLocation(name, "inventory");
|
||||
ModelLoader.setCustomMeshDefinition(terraPick, MesherWrapper.of(stack -> {
|
||||
String name = "botania:terraPick";
|
||||
if (ItemTerraPick.isTipped(stack)) {
|
||||
name += "Tipped";
|
||||
}
|
||||
});
|
||||
if (ItemTerraPick.isEnabled(stack)) {
|
||||
name += "Enabled";
|
||||
}
|
||||
return new ModelResourceLocation(name, "inventory");
|
||||
}));
|
||||
}
|
||||
|
||||
private static void registerSubtiles() {
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.GRASS, new ModelResourceLocation("botania:miniIsland", "variant=grass"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.PODZOL, new ModelResourceLocation("botania:miniIsland", "variant=podzol"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.MYCEL, new ModelResourceLocation("botania:miniIsland", "variant=mycel"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.SNOW, new ModelResourceLocation("botania:miniIsland", "variant=snow"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.DRY, new ModelResourceLocation("botania:miniIsland", "variant=dry"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.GOLDEN, new ModelResourceLocation("botania:miniIsland", "variant=golden"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.VIVID, new ModelResourceLocation("botania:miniIsland", "variant=vivid"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.SCORCHED, new ModelResourceLocation("botania:miniIsland", "variant=scorched"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.INFUSED, new ModelResourceLocation("botania:miniIsland", "variant=infused"));
|
||||
BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.MUTATED, new ModelResourceLocation("botania:miniIsland", "variant=mutated"));
|
||||
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileManastar.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MANASTAR));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTilePureDaisy.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_PUREDAISY));
|
||||
|
||||
@@ -397,6 +391,7 @@ public final class ModelHandler {
|
||||
registerItemModel(ModBlocks.cacophonium);
|
||||
registerItemModel(ModBlocks.cellBlock);
|
||||
registerItemModel(ModBlocks.conjurationCatalyst);
|
||||
registerItemModel(ModBlocks.cocoon);
|
||||
registerItemModel(ModBlocks.corporeaFunnel);
|
||||
registerItemModel(ModBlocks.corporeaInterceptor);
|
||||
registerItemModel(ModBlocks.corporeaRetainer);
|
||||
@@ -474,7 +469,6 @@ public final class ModelHandler {
|
||||
registerItemModel(blackLotus);
|
||||
registerItemModel(blackLotus, 1);
|
||||
registerItemModel(lexicon);
|
||||
registerItemModel(manaCookie);
|
||||
|
||||
registerItemModel(manasteelHelm);
|
||||
registerItemModel(manasteelHelmRevealing);
|
||||
@@ -496,7 +490,6 @@ public final class ModelHandler {
|
||||
registerItemModel(elementiumPick);
|
||||
registerItemModel(elementiumShovel);
|
||||
registerItemModel(elementiumAxe);
|
||||
registerItemModel(elementiumShears);
|
||||
registerItemModel(elementiumSword);
|
||||
|
||||
registerItemModel(terrasteelHelm);
|
||||
@@ -605,14 +598,14 @@ public final class ModelHandler {
|
||||
registerItemModelMetas(blackHoleTalisman, LibItemNames.BLACK_HOLE_TALISMAN, 2);
|
||||
registerItemModelMetas(slimeBottle, LibItemNames.SLIME_BOTTLE, 2);
|
||||
registerItemModelMetas(grassSeeds, LibItemNames.GRASS_SEEDS, 9);
|
||||
registerItemModelMetas(quartz, LibItemNames.QUARTZ, 8);
|
||||
registerItemModelMetas(quartz, LibItemNames.QUARTZ, 7);
|
||||
registerItemModelMetas(cosmetic, LibItemNames.COSMETIC, 32);
|
||||
registerItemModelMetas(craftPattern, LibItemNames.CRAFT_PATTERN, 9);
|
||||
registerItemModelMetas(virus, LibItemNames.VIRUS, 2);
|
||||
registerItemModelMetas(grassHorn, LibItemNames.GRASS_HORN, 3);
|
||||
}
|
||||
|
||||
// Only for models that absolutely can't be converted to JSON. Use VERY sparingly
|
||||
@SuppressWarnings("deprecation")
|
||||
private static void registerTESRItems() {
|
||||
registerItemModel(ModBlocks.avatar);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.avatar), 0, TileAvatar.class);
|
||||
@@ -692,25 +685,19 @@ public final class ModelHandler {
|
||||
ModelLoader.registerItemVariants(brewFlask, new ModelResourceLocation("botania:flask1_" + i, "inventory"));
|
||||
}
|
||||
|
||||
ModelLoader.setCustomMeshDefinition(brewFlask, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
int swigsTaken = 6 - ((ItemBrewBase) brewFlask).getSwigsLeft(stack);
|
||||
return new ModelResourceLocation("botania:flask1_" + swigsTaken, "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(brewFlask, MesherWrapper.of(stack -> {
|
||||
int swigsTaken = 6 - ((ItemBrewBase) brewFlask).getSwigsLeft(stack);
|
||||
return new ModelResourceLocation("botania:flask1_" + swigsTaken, "inventory");
|
||||
}));
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
ModelLoader.registerItemVariants(brewVial, new ModelResourceLocation("botania:vial1_" + i, "inventory"));
|
||||
}
|
||||
|
||||
ModelLoader.setCustomMeshDefinition(brewVial, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
int swigsTaken = 4 - ((ItemBrewBase) brewVial).getSwigsLeft(stack);
|
||||
return new ModelResourceLocation("botania:vial1_" + swigsTaken, "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomMeshDefinition(brewVial, MesherWrapper.of(stack -> {
|
||||
int swigsTaken = 4 - ((ItemBrewBase) brewVial).getSwigsLeft(stack);
|
||||
return new ModelResourceLocation("botania:vial1_" + swigsTaken, "inventory");
|
||||
}));
|
||||
}
|
||||
|
||||
private static void registerStateMappers() {
|
||||
@@ -811,6 +798,14 @@ public final class ModelHandler {
|
||||
for (Block b : otherFullSlabs) {
|
||||
ModelLoader.setCustomStateMapper(b, (new StateMap.Builder()).ignore(BlockModSlab.DUMMY, BlockSlab.HALF).build());
|
||||
}
|
||||
|
||||
// Ignore everything in TESR items to suppress missing model errors
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.avatar, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.bellows, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.brewery, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.gaiaHead, new StateMap.Builder().ignore(BlockSkull.FACING, BlockSkull.NODROP).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.hourglass, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.pump, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build());
|
||||
}
|
||||
|
||||
private static void registerMushrooms() {
|
||||
@@ -1105,4 +1100,19 @@ public final class ModelHandler {
|
||||
|
||||
private ModelHandler() {}
|
||||
|
||||
private interface MesherWrapper extends ItemMeshDefinition {
|
||||
|
||||
static MesherWrapper of(MesherWrapper w) {
|
||||
return w;
|
||||
}
|
||||
|
||||
ModelResourceLocation getLocation(ItemStack stack);
|
||||
|
||||
@Override
|
||||
default ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return getLocation(stack);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.client.core.handler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -10,17 +10,14 @@
|
||||
*/
|
||||
package vazkii.botania.client.core.handler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -37,7 +34,6 @@ import vazkii.botania.api.lexicon.multiblock.Multiblock;
|
||||
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
|
||||
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
@@ -90,7 +86,7 @@ public final class MultiblockRenderHandler {
|
||||
public static void setMultiblock(MultiblockSet set) {
|
||||
currentMultiblock = set;
|
||||
anchor = null;
|
||||
angle = EnumFacing.DOWN;
|
||||
angle = EnumFacing.SOUTH;
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(mc.theWorld != null)
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -191,7 +190,7 @@ public final class TooltipAdditionDisplayHandler {
|
||||
String rank = StatCollector.translateToLocal("botania.rank" + level).replaceAll("&", "\u00a7");
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING);
|
||||
GlStateManager.disableLighting();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
font.drawStringWithShadow(rank, mouseX + offx, mouseY - offy - 12, 0xFFFFFF);
|
||||
if(!ss) {
|
||||
rank = StatCollector.translateToLocal("botania.rank" + (level + 1)).replaceAll("&", "\u00a7");
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -14,7 +14,8 @@ import java.awt.Desktop;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.Calendar;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Month;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -28,7 +29,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -72,6 +72,7 @@ import vazkii.botania.client.render.entity.RenderManaStorm;
|
||||
import vazkii.botania.client.render.entity.RenderPinkWither;
|
||||
import vazkii.botania.client.render.entity.RenderPixie;
|
||||
import vazkii.botania.client.render.entity.RenderPoolMinecart;
|
||||
import vazkii.botania.client.render.entity.RenderSnowballStack;
|
||||
import vazkii.botania.client.render.entity.RenderSpark;
|
||||
import vazkii.botania.client.render.entity.RenderThornChakram;
|
||||
import vazkii.botania.client.render.tile.RenderTileAlfPortal;
|
||||
@@ -179,12 +180,15 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(MiscellaneousIcons.INSTANCE);
|
||||
ModelHandler.registerModels();
|
||||
initRenderers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
|
||||
initAuxiliaryRender();
|
||||
|
||||
ModChallenges.init();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new ClientTickHandler());
|
||||
@@ -193,7 +197,6 @@ public class ClientProxy extends CommonProxy {
|
||||
if(ConfigHandler.boundBlockWireframe)
|
||||
MinecraftForge.EVENT_BUS.register(new BoundTileRenderer());
|
||||
MinecraftForge.EVENT_BUS.register(new TooltipHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new BaubleRenderHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new DebugHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new SubTileRadiusRenderHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockRenderHandler());
|
||||
@@ -206,14 +209,13 @@ public class ClientProxy extends CommonProxy {
|
||||
new VersionChecker().init();
|
||||
|
||||
if(ConfigHandler.enableSeasonalFeatures) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
if((calendar.get(2) == 11 && calendar.get(5) >= 16) || (calendar.get(2) == 0 && calendar.get(5) <= 2))
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if ((now.getMonth() == Month.DECEMBER && now.getDayOfMonth() >= 16) || (now.getMonth() == Month.JANUARY && now.getDayOfMonth() <= 2))
|
||||
jingleTheBells = true;
|
||||
if(calendar.get(2) == 9)
|
||||
if(now.getMonth() == Month.OCTOBER)
|
||||
dootDoot = true;
|
||||
}
|
||||
|
||||
initRenderers();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -253,27 +255,33 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTeruTeruBozu.class, new RenderTileTeruTeruBozu());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAvatar.class, new RenderTileAvatar());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new RenderTileSkullOverride());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, RenderPixie::new);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.class, RenderDoppleganger::new);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySpark.class, RenderSpark::new);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityThornChakram.class, RenderThornChakram::new);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCorporeaSpark.class, RenderCorporeaSpark::new);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPoolMinecart.class, RenderPoolMinecart::new);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPinkWither.class, RenderPinkWither::new);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityManaStorm.class, RenderManaStorm::new);
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBabylonWeapon.class, RenderBabylonWeapon::new);
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, new RenderPixie());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, new RenderSnowball<EntityVineBall>(Minecraft.getMinecraft().getRenderManager(), ModItems.vineBall, Minecraft.getMinecraft().getRenderItem()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.class, new RenderDoppleganger(Minecraft.getMinecraft().getRenderManager()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySpark.class, new RenderSpark(Minecraft.getMinecraft().getRenderManager()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityThornChakram.class, new RenderThornChakram(Minecraft.getMinecraft().getRenderManager()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCorporeaSpark.class, new RenderCorporeaSpark(Minecraft.getMinecraft().getRenderManager()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEnderAirBottle.class, new RenderSnowball<EntityEnderAirBottle>(Minecraft.getMinecraft().getRenderManager(), ModItems.manaResource, Minecraft.getMinecraft().getRenderItem()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPoolMinecart.class, new RenderPoolMinecart(Minecraft.getMinecraft().getRenderManager()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPinkWither.class, new RenderPinkWither(Minecraft.getMinecraft().getRenderManager()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityManaStorm.class, new RenderManaStorm(Minecraft.getMinecraft().getRenderManager()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBabylonWeapon.class, new RenderBabylonWeapon(Minecraft.getMinecraft().getRenderManager()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, renderManager -> new RenderSnowball(renderManager, ModItems.vineBall, Minecraft.getMinecraft().getRenderItem()));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEnderAirBottle.class, renderManager -> new RenderSnowballStack(renderManager, new ItemStack(ModItems.manaResource, 1, 15), Minecraft.getMinecraft().getRenderItem()));
|
||||
|
||||
ShaderHelper.initShaders();
|
||||
}
|
||||
|
||||
private void initAuxiliaryRender() {
|
||||
Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
|
||||
RenderPlayer render = skinMap.get("default");
|
||||
RenderPlayer render;
|
||||
|
||||
render = skinMap.get("default");
|
||||
render.addLayer(new ContributorFancinessHandler());
|
||||
render.addLayer(new BaubleRenderHandler());
|
||||
|
||||
render = skinMap.get("slim");
|
||||
render.addLayer(new ContributorFancinessHandler());
|
||||
render.addLayer(new BaubleRenderHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -387,9 +395,6 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == (iradius - 1))
|
||||
mb.addComponent(new AnyComponent(new BlockPos(xp - x, 1, zp - z), block.getDefaultState()));
|
||||
|
||||
if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == iradius - 1)
|
||||
mb.addComponent(new AnyComponent(new BlockPos(xp - x, 1, zp - z), block.getDefaultState()));
|
||||
}
|
||||
|
||||
MultiblockRenderHandler.setMultiblock(mb.makeSet());
|
||||
|
||||
@@ -53,6 +53,7 @@ public class FXSparkle extends EntityFX {
|
||||
particleRed = red;
|
||||
particleGreen = green;
|
||||
particleBlue = blue;
|
||||
particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used
|
||||
particleGravity = 0;
|
||||
motionX = motionY = motionZ = 0;
|
||||
particleScale *= size;
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -51,6 +50,7 @@ public class FXWisp extends EntityFX {
|
||||
particleRed = red;
|
||||
particleGreen = green;
|
||||
particleBlue = blue;
|
||||
particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used
|
||||
particleGravity = 0;
|
||||
motionX = motionY = motionZ = 0;
|
||||
particleScale *= size;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.achievement.GuiAchievements;
|
||||
import net.minecraft.stats.StatFileWriter;
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.util.List;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
@@ -23,8 +22,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public class GuiBaubleBox extends InventoryEffectRenderer {
|
||||
|
||||
@@ -17,8 +17,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
// This is pretty much a copypasta of GuiCrafting >_>
|
||||
public class GuiCraftingHalo extends GuiContainer {
|
||||
|
||||
|
||||
@@ -13,14 +13,10 @@ package vazkii.botania.client.gui.lexicon;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.challenge.Challenge;
|
||||
import vazkii.botania.client.challenge.ModChallenges;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
|
||||
@@ -409,7 +409,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
|
||||
|
||||
@Override
|
||||
public GuiLexicon copy() {
|
||||
GuiLexiconEntry gui = new GuiLexiconEntry(entry, this.parent); // todo 1.8 recheck last param (was new GuiScreen())
|
||||
GuiLexiconEntry gui = new GuiLexiconEntry(entry, this.parent);
|
||||
gui.page = page;
|
||||
gui.setTitle();
|
||||
return gui;
|
||||
|
||||
@@ -19,7 +19,6 @@ import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -27,8 +26,6 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.ILexicon;
|
||||
@@ -110,7 +107,6 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
buttonList.add(leftButton = new GuiButtonPage(13, left, top + guiHeight - 10, false));
|
||||
buttonList.add(rightButton = new GuiButtonPage(14, left + guiWidth - 18, top + guiHeight - 10, true));
|
||||
|
||||
// todo 1.8 verify componentID
|
||||
searchField = new GuiTextField(15, fontRendererObj, left + guiWidth / 2 + 28, top + guiHeight + 6, 200, 10);
|
||||
searchField.setCanLoseFocus(false);
|
||||
searchField.setFocused(true);
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
|
||||
|
||||
@@ -16,13 +16,9 @@ import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.challenge.Challenge;
|
||||
|
||||
public class GuiButtonChallengeIcon extends GuiButtonLexicon {
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
|
||||
|
||||
@@ -15,14 +15,11 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
|
||||
@@ -13,13 +13,11 @@ package vazkii.botania.client.gui.lexicon.button;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.PersistentVariableHelper;
|
||||
@@ -88,7 +86,7 @@ public class GuiButtonInvisible extends GuiButtonLexicon {
|
||||
key = format.charAt(1);
|
||||
|
||||
for(EnumChatFormatting ecf : EnumChatFormatting.class.getEnumConstants())
|
||||
if(ecf.toString().indexOf(ecf.toString().length() - 1) == key) { // todo 1.8 recheck (want last char of code)
|
||||
if(ecf.toString().indexOf(ecf.toString().length() - 1) == key) {
|
||||
if(ecf.ordinal() > 15)
|
||||
ecf = EnumChatFormatting.BLACK;
|
||||
color = LibMisc.CONTROL_CODE_COLORS[ecf.ordinal()];
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.PersistentVariableHelper;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
-2
@@ -20,8 +20,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.*;
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ package vazkii.botania.client.integration.jei.puredaisy;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
@@ -8,11 +8,8 @@
|
||||
*/
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.HashBasedTable;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Table;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -36,18 +33,19 @@ import net.minecraftforge.client.model.pipeline.IVertexConsumer;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.client.model.pipeline.VertexTransformer;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import vazkii.botania.api.BotaniaAPIClient;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.BlockFloatingFlower;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
|
||||
import javax.vecmath.Vector3f;
|
||||
import javax.vecmath.Vector4f;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, IResourceManagerReloadListener {
|
||||
|
||||
@@ -81,12 +79,12 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
|
||||
|
||||
@Override
|
||||
public IBakedModel handleBlockState(IBlockState state) {
|
||||
IFloatingFlower.IslandType islandType = state.getValue(BlockFloatingFlower.ISLAND_TYPE);
|
||||
IExtendedBlockState realState = ((IExtendedBlockState) state);
|
||||
IFloatingFlower.IslandType islandType = realState.getValue(BotaniaStateProps.ISLAND_TYPE);
|
||||
String identifier;
|
||||
|
||||
if (state.getBlock() == ModBlocks.floatingSpecialFlower) {
|
||||
// Magic flower
|
||||
IExtendedBlockState realState = ((IExtendedBlockState) state);
|
||||
identifier = realState.getValue(BotaniaStateProps.SUBTILE_ID);
|
||||
} else {
|
||||
// Mundane flower
|
||||
@@ -103,7 +101,7 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
|
||||
if (CACHE.contains(islandType, identifier)) {
|
||||
return CACHE.get(islandType, identifier);
|
||||
} else {
|
||||
IBakedModel islandModel = modelManager.getModel(new ModelResourceLocation("botania:miniIsland", "variant=" + islandType.getName()));
|
||||
IBakedModel islandModel = modelManager.getModel(BotaniaAPIClient.getRegisteredIslandTypeModels().get(islandType));
|
||||
IBakedModel flowerModel;
|
||||
|
||||
if (identifier.startsWith(MUNDANE_PREFIX)) {
|
||||
@@ -115,6 +113,7 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
|
||||
|
||||
// Enhance!
|
||||
CompositeBakedModel model = new CompositeBakedModel(flowerModel, islandModel);
|
||||
FMLLog.info("[Botania]: Cached floating flower model for islandtpye %s and flowertype %s", islandType, identifier);
|
||||
CACHE.put(islandType, identifier, model);
|
||||
return model;
|
||||
}
|
||||
@@ -164,9 +163,7 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
|
||||
}
|
||||
|
||||
for (EnumFacing e : EnumFacing.VALUES) {
|
||||
genBuilder.addAll(Iterables.transform(flower.getFaceQuads(e), new Function<BakedQuad, BakedQuad>() {
|
||||
@Override public BakedQuad apply(BakedQuad input) { return transform(input, transform); }
|
||||
}));
|
||||
genBuilder.addAll(flower.getFaceQuads(e).stream().map(input -> transform(input, transform)).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
// Add island quads
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelBellows extends ModelBase {
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.render.tile.RenderTileBrewery;
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelPump extends ModelBase{
|
||||
|
||||
private ArrayList<ModelRenderer> parts = new ArrayList<ModelRenderer>();
|
||||
private ArrayList<ModelRenderer> parts = new ArrayList<>();
|
||||
|
||||
private ArrayList<ModelRenderer> innerRing = new ArrayList<ModelRenderer>();
|
||||
private ArrayList<ModelRenderer> outerRing = new ArrayList<ModelRenderer>();
|
||||
private ArrayList<ModelRenderer> innerRing = new ArrayList<>();
|
||||
private ArrayList<ModelRenderer> outerRing = new ArrayList<>();
|
||||
|
||||
public ModelPump() {
|
||||
textureWidth = 64;
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -22,7 +21,6 @@ import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ReportedException;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.Attributes;
|
||||
@@ -52,12 +50,7 @@ public class ModelPylon implements IPylonModel {
|
||||
private IFlexibleBakedModel gaiaRingsAndPanes;
|
||||
private IFlexibleBakedModel gaiaGems;
|
||||
|
||||
private static final Function<ResourceLocation, TextureAtlasSprite> TEXTUREGETTER = new Function<ResourceLocation, TextureAtlasSprite>() {
|
||||
@Override
|
||||
public TextureAtlasSprite apply(ResourceLocation input) {
|
||||
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
}
|
||||
};
|
||||
private static final Function<ResourceLocation, TextureAtlasSprite> TEXTUREGETTER = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
|
||||
private static final Set<String> GROUP_NAMES = ImmutableSet.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
|
||||
"Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04");
|
||||
|
||||
@@ -31,7 +31,6 @@ import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.http.annotation.Immutable;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import javax.vecmath.Matrix4f;
|
||||
@@ -83,12 +82,7 @@ public class PylonItemModel implements ISmartItemModel {
|
||||
// All groups are off by default
|
||||
// OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group
|
||||
|
||||
final Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() {
|
||||
@Override
|
||||
public TextureAtlasSprite apply(ResourceLocation input) {
|
||||
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
}
|
||||
};
|
||||
final Function<ResourceLocation, TextureAtlasSprite> textureGetter = input -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
|
||||
ImmutableList<String> standardGroups = ImmutableList.of("Crystal", "Crystal_Ring",
|
||||
"Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04",
|
||||
|
||||
@@ -42,7 +42,7 @@ import net.minecraftforge.fml.common.FMLLog;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import vazkii.botania.api.BotaniaAPIClient;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
|
||||
import javax.vecmath.Matrix4f;
|
||||
@@ -72,10 +72,8 @@ public class SpecialFlowerModel implements IModelCustomData {
|
||||
builder.addAll(blockModels.values());
|
||||
builder.addAll(itemModels.values());
|
||||
|
||||
// Force mini island model to be loaded and baked, for use elsewhere. See FloatingFlowerModel
|
||||
for (IFloatingFlower.IslandType i : IFloatingFlower.IslandType.values()) {
|
||||
builder.add(new ModelResourceLocation("botania:miniIsland", "variant=" + i.name().toLowerCase(Locale.ROOT)));
|
||||
}
|
||||
// Force island models to be loaded and baked. See FloatingFlowerModel.
|
||||
builder.addAll(BotaniaAPIClient.getRegisteredIslandTypeModels().values());
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@@ -10,13 +10,10 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.entity;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelPlayer;
|
||||
import net.minecraft.client.renderer.entity.RenderBiped;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.resources.DefaultPlayerSkin;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.ARBShaderObjects;
|
||||
@@ -63,7 +60,7 @@ public class RenderDoppleganger extends RenderBiped<EntityDoppleganger> {
|
||||
};
|
||||
|
||||
public RenderDoppleganger(RenderManager renderManager) {
|
||||
super(renderManager, new ModelPlayer(0.0F, false), 0F); // todo 1.8 was ModelBiped(0.5)
|
||||
super(renderManager, new ModelPlayer(0.0F, false), 0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,12 +13,8 @@ package vazkii.botania.client.render.entity;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.common.entity.EntityManaStorm;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.client.render.entity;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderWither;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.boss.BossStatus;
|
||||
import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -10,12 +10,10 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.entity;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.ARBShaderObjects;
|
||||
@@ -43,8 +41,8 @@ public class RenderPixie extends RenderLiving<EntityPixie> {
|
||||
}
|
||||
};
|
||||
|
||||
public RenderPixie() {
|
||||
super(Minecraft.getMinecraft().getRenderManager(), new ModelPixie(), 0.25F);
|
||||
public RenderPixie(RenderManager renderManager) {
|
||||
super(renderManager, new ModelPixie(), 0.25F);
|
||||
//setRenderPassModel(new ModelPixie());
|
||||
shadowSize = 0.0F;
|
||||
}
|
||||
|
||||
@@ -10,12 +10,16 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.entity;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderMinecart;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
import vazkii.botania.api.state.enums.PoolVariant;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.render.tile.RenderTilePool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.entity.EntityPoolMinecart;
|
||||
|
||||
public class RenderPoolMinecart extends RenderMinecart<EntityPoolMinecart> {
|
||||
@@ -26,8 +30,9 @@ public class RenderPoolMinecart extends RenderMinecart<EntityPoolMinecart> {
|
||||
|
||||
@Override
|
||||
protected void func_180560_a(EntityPoolMinecart poolCart, float p_147910_2_, IBlockState state) {
|
||||
RenderTilePool.forceVariant = PoolVariant.DEFAULT;
|
||||
RenderTilePool.forceManaNumber = poolCart.getMana();
|
||||
super.func_180560_a(poolCart, p_147910_2_, state);
|
||||
TileEntityRendererDispatcher.instance.getSpecialRendererByClass(TilePool.class).renderTileEntityAt(null, poolCart.posX, poolCart.posY, poolCart.posZ, ClientTickHandler.partialTicks, -1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* This class was created by <williewillus>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.client.render.entity;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
// Same as RenderSnowball, but ItemStack sensitive
|
||||
public class RenderSnowballStack<T extends Entity> extends RenderSnowball<T> {
|
||||
|
||||
private final ItemStack stack;
|
||||
|
||||
public RenderSnowballStack(RenderManager renderManagerIn, ItemStack stack, RenderItem render) {
|
||||
super(renderManagerIn, stack.getItem(), render);
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack func_177082_d(T entity) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,14 +17,11 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.common.entity.EntityThornChakram;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
// Basically a bit of an extension of RenderSnowball
|
||||
public class RenderThornChakram extends Render<EntityThornChakram> {
|
||||
|
||||
@@ -31,13 +31,12 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer<TileAlfPortal
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAlfPortal portal, double d0, double d1, double d2, float f, int digProgress) {
|
||||
AlfPortalState state;
|
||||
if (portal.getWorld().getBlockState(portal.getPos()).getBlock() != ModBlocks.alfPortal) {
|
||||
state = AlfPortalState.OFF;
|
||||
} else {
|
||||
state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
if (portal != null && portal.getWorld() != null && !portal.getWorld().isBlockLoaded(portal.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AlfPortalState state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
|
||||
if(state == AlfPortalState.OFF)
|
||||
return;
|
||||
|
||||
|
||||
@@ -10,28 +10,20 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
@@ -59,6 +51,10 @@ public class RenderTileAltar extends TileEntitySpecialRenderer<TileAltar> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (altar != null && altar.getWorld() != null && !altar.getWorld().isBlockLoaded(altar.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -10,24 +10,20 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.item.IAvatarWieldable;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelAvatar;
|
||||
@@ -44,17 +40,23 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer<TileAvatar> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileAvatar avatar, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (avatar != null && avatar.getWorld() != null && !avatar.getWorld().isBlockLoaded(avatar.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
int meta = avatar != null && avatar.getWorld() != null ? avatar.getBlockMetadata() : 0;
|
||||
EnumFacing facing = avatar != null && avatar.getWorld() != null
|
||||
? avatar.getWorld().getBlockState(avatar.getPos()).getValue(BotaniaStateProps.CARDINALS)
|
||||
: EnumFacing.SOUTH;
|
||||
|
||||
GlStateManager.translate(0.5F, 1.6F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
|
||||
model.render();
|
||||
|
||||
if (avatar == null) {
|
||||
|
||||
@@ -13,12 +13,8 @@ package vazkii.botania.client.render.tile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelBellows;
|
||||
import vazkii.botania.common.block.tile.mana.TileBellows;
|
||||
@@ -34,6 +30,10 @@ public class RenderTileBellows extends TileEntitySpecialRenderer<TileBellows> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileBellows bellows, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (bellows != null && bellows.getWorld() != null && !bellows.getWorld().isBlockLoaded(bellows.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -10,25 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
@@ -10,14 +10,15 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelCocoon;
|
||||
@@ -43,12 +44,14 @@ public class RenderTileCocoon extends TileEntitySpecialRenderer<TileCocoon> {
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
GlStateManager.rotate(90F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(0.5F, -0.5F - 3F / 16F, -0.5F + 1F / 16F);
|
||||
GlStateManager.rotate(rot, 0F, 1F, 0F);
|
||||
model.render();
|
||||
GlStateManager.translate(d0, d1, d2 + 1);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.translate(0.5F, 0, 0F);
|
||||
GlStateManager.rotate(rot, 1F, 0F, 0F); // todo 1.8 fixme looks a little weird compared to 1.7
|
||||
GlStateManager.translate(-0.5F, 0, 0F);
|
||||
IBlockState state = cocoon.getWorld().getBlockState(cocoon.getPos());
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, false);
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
@@ -13,18 +13,15 @@ package vazkii.botania.client.render.tile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
@@ -14,11 +14,8 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelEnderCrystal;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
|
||||
@@ -16,24 +16,15 @@ 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.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraftforge.client.model.ISmartBlockModel;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.model.FloatingFlowerModel;
|
||||
import vazkii.botania.client.model.ModelMiniIsland;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
import vazkii.botania.common.block.tile.TileFloatingFlower;
|
||||
import vazkii.botania.api.item.IFloatingFlower;
|
||||
|
||||
public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
|
||||
|
||||
@@ -41,6 +32,10 @@ public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double d0, double d1, double d2, float t, int digProgress) {
|
||||
if (tile != null && tile.getWorld() != null && !tile.getWorld().isBlockLoaded(tile.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
IFloatingFlower flower = (IFloatingFlower) tile;
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -10,22 +10,16 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
@@ -43,7 +37,11 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncens
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
EnumFacing facing = plate.getWorld() != null ? plate.getWorld().getBlockState(plate.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
|
||||
if (plate != null && plate.getWorld() != null && !plate.getWorld().isBlockLoaded(plate.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnumFacing facing = plate.getWorld().getBlockState(plate.getPos()).getValue(BotaniaStateProps.CARDINALS);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -29,6 +29,10 @@ public class RenderTileLightRelay extends TileEntitySpecialRenderer<TileLightRel
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileLightRelay tile, double x, double y, double z, float pticks, int digProgress) {
|
||||
if (tile != null && tile.getWorld() != null && !tile.getWorld().isBlockLoaded(tile.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
TextureAtlasSprite iicon = tile.getBlockMetadata() > 0 ? MiscellaneousIcons.INSTANCE.lightRelayWorldIconRed : MiscellaneousIcons.INSTANCE.lightRelayWorldIcon;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -30,28 +31,30 @@ import net.minecraftforge.client.model.pipeline.LightUtil;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.mana.IPoolOverlayProvider;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.PoolVariant;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.MultiblockRenderHandler;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelPool;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
|
||||
public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_POOL);
|
||||
private static final ResourceLocation textureInf = new ResourceLocation(LibResources.MODEL_INFINITE_POOL);
|
||||
private static final ResourceLocation textureDil = new ResourceLocation(LibResources.MODEL_DILUTED_POOL);
|
||||
|
||||
private static final ModelPool model = new ModelPool();
|
||||
|
||||
public static int forceMeta = 0;
|
||||
// Overrides for when we call this TESR without an actual pool
|
||||
public static PoolVariant forceVariant = PoolVariant.DEFAULT;
|
||||
public static boolean forceMana = false;
|
||||
public static int forceManaNumber = -1;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePool pool, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (pool != null && pool.getWorld() != null && !pool.getWorld().isBlockLoaded(pool.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -59,11 +62,13 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
float a = MultiblockRenderHandler.rendering ? 0.6F : 1F;
|
||||
|
||||
GlStateManager.color(1F, 1F, 1F, a);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
boolean inf = pool.getWorld() == null ? forceMeta == 1 : pool.getBlockMetadata() == 1;
|
||||
boolean dil = pool.getWorld() == null ? forceMeta == 2 : pool.getBlockMetadata() == 2;
|
||||
boolean fab = pool.getWorld() == null ? forceMeta == 3 : pool.getBlockMetadata() == 3;
|
||||
if (pool == null) { // A null pool means we are calling the TESR without a pool (on a minecart). Adjust accordingly
|
||||
GlStateManager.translate(0, 0, -1);
|
||||
} else {
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
}
|
||||
|
||||
boolean fab = pool == null ? forceVariant == PoolVariant.FABULOUS : pool.getWorld().getBlockState(pool.getPos()).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.FABULOUS;
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
int color;
|
||||
@@ -71,35 +76,21 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
|
||||
color = Color.getHSBColor(time * 0.005F, 0.6F, 1F).hashCode();
|
||||
} else {
|
||||
color = pool.getColor().getMapColor().colorValue | 0xFF000000; // Add alpha
|
||||
color = pool == null ? EnumDyeColor.WHITE.getMapColor().colorValue : pool.getColor().getMapColor().colorValue;
|
||||
}
|
||||
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(pool.getWorld().getBlockState(pool.getPos()));
|
||||
Tessellator tess = Tessellator.getInstance();
|
||||
|
||||
tess.getWorldRenderer().begin(GL11.GL_QUADS, Attributes.DEFAULT_BAKED_FORMAT);
|
||||
|
||||
GlStateManager.disableLighting();
|
||||
for (BakedQuad quad : model.getGeneralQuads()) {
|
||||
LightUtil.renderQuadColor(tess.getWorldRenderer(), quad, color);
|
||||
}
|
||||
|
||||
for (EnumFacing e : EnumFacing.VALUES) {
|
||||
for (BakedQuad quad: model.getFaceQuads(e)) {
|
||||
LightUtil.renderQuadColor(tess.getWorldRenderer(), quad, color);
|
||||
}
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(pool == null ? ModBlocks.pool.getDefaultState().withProperty(BotaniaStateProps.POOL_VARIANT, forceVariant) : pool.getWorld().getBlockState(pool.getPos()));
|
||||
int red = (color & 0xFF0000) >> 16;
|
||||
int green = (color & 0xFF00) >> 8;
|
||||
int blue = (color & 0xFF) >> 0;
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(model, 1.0F, red / 255F, green / 255F, blue / 255F);
|
||||
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.color(1, 1, 1, a);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
int mana = pool.getCurrentMana();
|
||||
if(forceManaNumber > -1)
|
||||
mana = forceManaNumber;
|
||||
int cap = pool.manaCap;
|
||||
int mana = pool == null ? forceManaNumber : pool.getCurrentMana();
|
||||
int cap = pool == null ? -1 : pool.manaCap;
|
||||
if(cap == -1)
|
||||
cap = TilePool.MAX_MANA;
|
||||
|
||||
@@ -111,7 +102,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
float v = 1F / 8F;
|
||||
float w = -v * 3.5F;
|
||||
|
||||
if(pool.getWorld() != null) {
|
||||
if(pool != null) {
|
||||
Block below = pool.getWorld().getBlockState(pool.getPos().down()).getBlock();
|
||||
if(below instanceof IPoolOverlayProvider) {
|
||||
TextureAtlasSprite overlay = ((IPoolOverlayProvider) below).getIcon(pool.getWorld(), pool.getPos());
|
||||
@@ -155,7 +146,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
forceMeta = 0;
|
||||
forceVariant = PoolVariant.DEFAULT;
|
||||
forceMana = false;
|
||||
forceManaNumber = -1;
|
||||
}
|
||||
|
||||
@@ -16,9 +16,6 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
|
||||
@@ -13,12 +13,10 @@ package vazkii.botania.client.render.tile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelPump;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
@@ -34,17 +32,21 @@ public class RenderTilePump extends TileEntitySpecialRenderer<TilePump> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePump pump, double d0, double d1, double d2, float f, int digProgress) {
|
||||
if (pump != null && pump.getWorld() != null && !pump.getWorld().isBlockLoaded(pump.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
int meta = pump != null && pump.getWorld() != null ? pump.getBlockMetadata() : 0;
|
||||
EnumFacing facing = pump != null && pump.getWorld() != null ? pump.getWorld().getBlockState(pump.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
|
||||
|
||||
GlStateManager.translate(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
|
||||
model.render(Math.max(0F, Math.min(8F, pump == null ? 8 : pump.innerRingPos + pump.moving * f)));
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
|
||||
@@ -17,13 +17,9 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.PylonVariant;
|
||||
@@ -55,6 +51,10 @@ public class RenderTilePylon extends TileEntitySpecialRenderer<TilePylon> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePylon pylon, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if (pylon != null && pylon.getWorld() != null && !pylon.getWorld().isBlockLoaded(pylon.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(model == null)
|
||||
model = ConfigHandler.oldPylonModel ? new ModelPylonOld() : new ModelPylon();
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import vazkii.botania.client.core.handler.RedStringRenderer;
|
||||
import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
|
||||
|
||||
@@ -10,23 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
|
||||
@@ -13,18 +13,13 @@ package vazkii.botania.client.render.tile;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
|
||||
import net.minecraft.client.resources.DefaultPlayerSkin;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.model.ModelSkullOverride;
|
||||
import vazkii.botania.client.render.entity.RenderDoppleganger;
|
||||
@@ -40,7 +35,7 @@ public class RenderTileSkullOverride extends TileEntitySkullRenderer {
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntitySkull p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_, int digProgress) {
|
||||
if (p_147500_1_ != null) {
|
||||
render(p_147500_1_, (float) p_147500_2_, (float) p_147500_4_, (float) p_147500_6_, EnumFacing.getFront(p_147500_1_.getBlockMetadata() & 7) /*todo 1.8*/, p_147500_1_.getSkullRotation() * 360 / 16.0F, p_147500_1_.getSkullType(), p_147500_1_.getPlayerProfile(), digProgress);
|
||||
render(p_147500_1_, (float) p_147500_2_, (float) p_147500_4_, (float) p_147500_6_, EnumFacing.getFront(p_147500_1_.getBlockMetadata() & 7), p_147500_1_.getSkullRotation() * 360 / 16.0F, p_147500_1_.getSkullType(), p_147500_1_.getPlayerProfile(), digProgress);
|
||||
} else {
|
||||
render(null, ((float) p_147500_2_), ((float) p_147500_4_), ((float) p_147500_6_), EnumFacing.NORTH, 0, 3, null, 0);
|
||||
}
|
||||
@@ -48,18 +43,9 @@ public class RenderTileSkullOverride extends TileEntitySkullRenderer {
|
||||
|
||||
public void render(TileEntitySkull skull, float par1, float par2, float par3, EnumFacing par4, float par5, int par6, GameProfile gameProfile, int digProgress) {
|
||||
boolean gaia = skull == null || skull instanceof TileGaiaHead;
|
||||
if(par6 == 3 || gaia) {
|
||||
ResourceLocation resourcelocation = DefaultPlayerSkin.getDefaultSkinLegacy();
|
||||
if(gaia) {
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
if(gaia)
|
||||
resourcelocation = minecraft.thePlayer.getLocationSkin();
|
||||
else if(gameProfile != null) {
|
||||
Map map = minecraft.getSkinManager().loadSkinFromCache(gameProfile);
|
||||
|
||||
if (map.containsKey(MinecraftProfileTexture.Type.SKIN)) {
|
||||
resourcelocation = minecraft.getSkinManager().loadSkin((MinecraftProfileTexture)map.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN);
|
||||
}
|
||||
}
|
||||
ResourceLocation resourcelocation = minecraft.thePlayer.getLocationSkin();
|
||||
bindTexture(resourcelocation);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.disableCull();
|
||||
@@ -86,13 +72,11 @@ public class RenderTileSkullOverride extends TileEntitySkullRenderer {
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
|
||||
GlStateManager.enableAlpha();
|
||||
if(gaia)
|
||||
ShaderHelper.useShader(ShaderHelper.doppleganger, RenderDoppleganger.defaultCallback);
|
||||
ShaderHelper.useShader(ShaderHelper.doppleganger, RenderDoppleganger.defaultCallback);
|
||||
|
||||
modelSkull.render(null, 0F, 0F, 0F, par5, 0F, 0.0625F);
|
||||
|
||||
if(gaia)
|
||||
ShaderHelper.releaseShader();
|
||||
ShaderHelper.releaseShader();
|
||||
GlStateManager.popMatrix();
|
||||
} else super.renderSkull(par1, par2, par3, par4, par5, par6, gameProfile, digProgress);
|
||||
}
|
||||
|
||||
@@ -10,19 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.common.block.tile.TileSparkChanger;
|
||||
|
||||
|
||||
@@ -16,9 +16,6 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelSpawnerClaw;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.client.render.tile;
|
||||
import java.awt.Color;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCarpet;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -24,12 +23,8 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.proxy.ClientProxy;
|
||||
@@ -51,6 +46,10 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer<TileSpreader>
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileSpreader spreader, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
if (spreader != null && spreader.getWorld() != null && !spreader.getWorld().isBlockLoaded(spreader.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -18,18 +18,11 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityEndPortal;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.common.block.tile.TileStarfield;
|
||||
|
||||
// THIS CODE WAS STOLEN FROM THE END PORTAL
|
||||
// OH GOD
|
||||
// I HAVE NO IDEA WHAT I'M DOING
|
||||
// SO MUCH STUFF I DON'T UNDERSTAND D:
|
||||
// HELP
|
||||
// This is copied from the vanilla end portal TESR, relevant edits are commented
|
||||
public class RenderTileStarfield extends TileEntitySpecialRenderer<TileStarfield> {
|
||||
|
||||
private static final ResourceLocation END_SKY_TEXTURE = new ResourceLocation("textures/environment/end_sky.png");
|
||||
|
||||
@@ -15,11 +15,9 @@ import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.core.proxy.ClientProxy;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
@@ -10,31 +10,30 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.item.TinyPotatoRenderEvent;
|
||||
import vazkii.botania.client.core.handler.ContributorFancinessHandler;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.core.proxy.ClientProxy;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelTinyPotato;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
@@ -42,286 +41,302 @@ import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
|
||||
public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPotato> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TINY_POTATO);
|
||||
private static final ResourceLocation textureGrayscale = new ResourceLocation(LibResources.MODEL_TINY_POTATO_GS);
|
||||
private static final ResourceLocation textureHalloween = new ResourceLocation(LibResources.MODEL_TINY_POTATO_HALLOWEEN);
|
||||
private static final ModelTinyPotato model = new ModelTinyPotato();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileTinyPotato potato, double d0, double d1, double d2, float var8, int digProgress) {
|
||||
public void renderTileEntityAt(TileTinyPotato potato, double x, double y, double z, float partialTicks, int destroyStage) {
|
||||
if (potato != null && potato.getWorld() != null && !potato.getWorld().isBlockLoaded(potato.getPos(), false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
GlStateManager.translate(x, y, z);
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
mc.renderEngine.bindTexture(ClientProxy.dootDoot ? textureHalloween : texture);
|
||||
String name = potato.name.toLowerCase();
|
||||
|
||||
boolean usedShader = false;
|
||||
if(name.startsWith("gaia ")) {
|
||||
if (name.startsWith("gaia ")) {
|
||||
ShaderHelper.useShader(ShaderHelper.doppleganger);
|
||||
name = name.substring(5);
|
||||
usedShader = true;
|
||||
} else if(name.startsWith("hot ")) {
|
||||
} else if (name.startsWith("hot ")) {
|
||||
ShaderHelper.useShader(ShaderHelper.halo);
|
||||
name = name.substring(4);
|
||||
usedShader = true;
|
||||
} else if(name.startsWith("magic ")) {
|
||||
} else if (name.startsWith("magic ")) {
|
||||
ShaderHelper.useShader(ShaderHelper.enchanterRune);
|
||||
name = name.substring(6);
|
||||
usedShader = true;
|
||||
} else if(name.startsWith("gold ")) {
|
||||
} else if (name.startsWith("gold ")) {
|
||||
ShaderHelper.useShader(ShaderHelper.gold);
|
||||
name = name.substring(5);
|
||||
usedShader = true;
|
||||
} else if(name.startsWith("snoop ")) {
|
||||
} else if (name.startsWith("snoop ")) {
|
||||
ShaderHelper.useShader(ShaderHelper.terraPlateRune);
|
||||
name = name.substring(6);
|
||||
usedShader = true;
|
||||
}
|
||||
|
||||
float jump = potato.jumpTicks;
|
||||
if(jump > 0)
|
||||
jump -= var8;
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
int meta = potato.getWorld() == null ? 3 : potato.getBlockMetadata();
|
||||
float rotY = meta * 90F - 180F;
|
||||
GlStateManager.rotate(rotY, 0F, 1F, 0F);
|
||||
|
||||
float up = (float) Math.abs(Math.sin(jump / 10 * Math.PI)) * 0.2F;
|
||||
float jump = potato.jumpTicks;
|
||||
if (jump > 0)
|
||||
jump -= partialTicks;
|
||||
|
||||
float up = (float) -Math.abs(Math.sin(jump / 10 * Math.PI)) * 0.2F;
|
||||
float rotZ = (float) Math.sin(jump / 10 * Math.PI) * 2;
|
||||
|
||||
GlStateManager.translate(0F, up, 0F);
|
||||
GlStateManager.rotate(rotZ, 0F, 0F, 1F);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
if(name.equals("pahimar")) {
|
||||
if (name.equals("pahimar")) {
|
||||
GlStateManager.scale(1F, 0.3F, 1F);
|
||||
//GlStateManager.translate(0F, 3.5F, 0F);
|
||||
} else if(name.equals("kyle hyde")) {
|
||||
// 1.8: handled using getActualState - mc.renderEngine.bindTexture(textureGrayscale);
|
||||
} else if(name.equals("dinnerbone") || name.equals("grumm")) {
|
||||
GlStateManager.translate(0F, 3.5F, 0F);
|
||||
} else if (name.equals("kyle hyde"))
|
||||
mc.renderEngine.bindTexture(textureGrayscale);
|
||||
else if (name.equals("dinnerbone") || name.equals("grumm")) {
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
//GlStateManager.translate(0F, -2.625F, 0F);
|
||||
} else if(name.equals("aureylian"))
|
||||
GlStateManager.translate(0F, -2.625F, 0F);
|
||||
} else if (name.equals("aureylian"))
|
||||
GlStateManager.color(1F, 0.5F, 1F);
|
||||
|
||||
IBlockState state = potato.getWorld().getBlockState(potato.getPos());
|
||||
state = state.getBlock().getActualState(state, potato.getWorld(), potato.getPos());
|
||||
IBakedModel bakedModel = mc.getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state);
|
||||
|
||||
boolean render = !(name.equals("mami") || name.equals("soaryn") || name.equals("eloraam") && jump != 0);
|
||||
if(render) {
|
||||
GlStateManager.rotate(-90, 0, 1, 0);
|
||||
mc.getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(bakedModel, potato.getWorld().getBlockState(potato.getPos()), 1.0F, false);
|
||||
GlStateManager.rotate(90, 0, 1, 0);
|
||||
//model.render();
|
||||
}
|
||||
if(name.equals("kingdaddydmac")) {
|
||||
GlStateManager.translate(-0.5F, 0F, 0F);
|
||||
mc.getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(bakedModel, potato.getWorld().getBlockState(potato.getPos()), 1.0F, false);
|
||||
//model.render();
|
||||
if (render)
|
||||
model.render();
|
||||
if (name.equals("kingdaddydmac")) {
|
||||
GlStateManager.translate(0.5F, 0F, 0F);
|
||||
model.render();
|
||||
}
|
||||
|
||||
if(usedShader)
|
||||
if (usedShader)
|
||||
ShaderHelper.releaseShader();
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
if(!name.isEmpty()) {
|
||||
if (!name.isEmpty()) {
|
||||
GlStateManager.pushMatrix();
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
|
||||
ContributorFancinessHandler.firstStart();
|
||||
// todo 1.8 refine all below
|
||||
|
||||
float scale = 1F / 4F;
|
||||
GlStateManager.translate(0F, 1F, 0F);
|
||||
GlStateManager.scale(scale, scale, scale);
|
||||
if(name.equals("phi") || name.equals("vazkii")) {
|
||||
if (name.equals("phi") || name.equals("vazkii")) {
|
||||
GlStateManager.translate(0.45F, 0F, 0.4F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(20F, 1F, 0F, 1F);
|
||||
renderIcon(MiscellaneousIcons.INSTANCE.phiFlowerIcon);
|
||||
|
||||
if(name.equals("vazkii")) {
|
||||
if (name.equals("vazkii")) {
|
||||
GlStateManager.rotate(-20F, 1F, 0F, 1F);
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-1.5F, -1.3F, -0.75F);
|
||||
renderIcon(MiscellaneousIcons.INSTANCE.nerfBatIcon);
|
||||
}
|
||||
} else if(name.equals("skull kid")) {
|
||||
} else if (name.equals("skull kid")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 23), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("kamina")) {
|
||||
GlStateManager.translate(0F, -0.7F, -0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 23));
|
||||
} else if (name.equals("kamina")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -1.1F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 26), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("haighyorkie")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.6F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 26));
|
||||
} else if (name.equals("haighyorkie")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
|
||||
renderIcon(MiscellaneousIcons.INSTANCE.goldfishIcon);
|
||||
} else if(name.equals("chitoge")) {
|
||||
} else if (name.equals("chitoge")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -0.7F, 0.1F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 7), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("direwolf20")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.2F, 0.1F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 7));
|
||||
} else if (name.equals("direwolf20")) {
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -2.2F, -0.5F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("doctor")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -1.7F, 0.5F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic));
|
||||
} else if (name.equals("doctor")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -1.15F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 25), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("snoo")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.65F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 25));
|
||||
} else if (name.equals("snoo")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -0.7F, 0.1F);
|
||||
GlStateManager.rotate(20F, 0F, 0F, 1F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 24), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("charlotte")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.2F, 0F, -0.05F);
|
||||
GlStateManager.rotate(-20F, 0F, 0F, 1F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 24));
|
||||
} else if (name.equals("charlotte")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 12), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("greg") || name.equals("gregorioust")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 12));
|
||||
} else if (name.equals("greg") || name.equals("gregorioust")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.5F, -1.5F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.book, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -1F, 0.4F);
|
||||
renderItem(new ItemStack(Items.book));
|
||||
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.translate(0.5F, 0.5F, 0F);
|
||||
GlStateManager.scale(0.3F, 0.3F, 0.3F);
|
||||
|
||||
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.iron_ore.getDefaultState(), 1F);
|
||||
} else if(name.equals("profmobius")) {
|
||||
renderItem(new ItemStack(Blocks.iron_ore));
|
||||
} else if (name.equals("profmobius")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.bread, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("martysgames") || name.equals("marty")) {
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
renderItem(new ItemStack(Items.bread));
|
||||
} else if (name.equals("martysgames") || name.equals("marty")) {
|
||||
GlStateManager.scale(0.7F, 0.7F, 0.7F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.75F, -2.4F, -0.7F);
|
||||
GlStateManager.rotate(10F, 0F, 0F, 1F);
|
||||
ItemStack renderStack = new ItemStack(ModItems.infiniteFruit, 1);
|
||||
renderStack.setStackDisplayName("das boot");
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(renderStack, ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("tromped")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.3F, -1.8F, 0.7F);
|
||||
GlStateManager.rotate(-15F, 0F, 0F, 1F);
|
||||
renderItem(new ItemStack(ModItems.infiniteFruit, 1).setStackDisplayName("das boot"));
|
||||
} else if (name.equals("tromped")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cacophonium));
|
||||
} else if (name.equals("kain vinosec")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cacophonium, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("kain vinosec")) {
|
||||
GlStateManager.translate(-0.3F, -1F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.recordGaia1));
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.translate(0F, 0F, -0.85F);
|
||||
renderItem(new ItemStack(ModItems.recordGaia2));
|
||||
} else if (name.equals("mankrik")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.3F, -1.5F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.recordGaia1, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
GlStateManager.translate(0F, 0F, 0.85F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.recordGaia2, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("mankrik")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -0.2F, -0.1F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 31), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("kurumi")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, 0.3F, 0.1F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 31));
|
||||
} else if (name.equals("kurumi")) {
|
||||
GlStateManager.scale(0.4F, 0.4F, 0.4F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.9F, -2.5F, -1.3F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 17), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("ichun")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.4F, -2F, 1.3F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 17));
|
||||
} else if (name.equals("ichun")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 15), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("wiiv") || name.equals("dylan4ever") || name.equals("dylankaiser")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 15));
|
||||
} else if (name.equals("wiiv") || name.equals("dylan4ever") || name.equals("dylankaiser")) {
|
||||
GlStateManager.scale(1.5F, 1.5F, 1.5F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.5F, -1.1F, -0.325F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.painting, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("jibril")) {
|
||||
GlStateManager.translate(-0.1F, -0.6F, -0.325F);
|
||||
renderItem(new ItemStack(Items.painting));
|
||||
} else if (name.equals("jibril")) {
|
||||
GlStateManager.scale(1.5F, 1.5F, 1.5F);
|
||||
GlStateManager.translate(0F, 0.7F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
ItemFlightTiara.renderHalo(null, var8);
|
||||
} else if(name.equals("nebris")) {
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
ItemFlightTiara.renderHalo(null, partialTicks);
|
||||
} else if (name.equals("nebris")) {
|
||||
GlStateManager.scale(2F, 2F, 2F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.glowstone.getDefaultState(), 1F);
|
||||
} else if(name.equals("ible")) {
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
renderItem(new ItemStack(Blocks.glowstone));
|
||||
} else if (name.equals("ible")) {
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.scale(1.2F, 1.2F, 1.2F);
|
||||
GlStateManager.translate(0F, 0.7F, 0F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(-0.5F, 0F, -0.5F);
|
||||
GlStateManager.rotate(180F, 1F, 1F, 0F);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.portal.getDefaultState(), 1F);
|
||||
} else if(name.equals("razz") || name.equals("razzleberryfox")) {
|
||||
renderBlock(Blocks.portal);
|
||||
} else if (name.equals("razz") || name.equals("razzleberryfox")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.5F, -1F, 0.45F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 8), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("etho") || name.equals("ethoslab")) {
|
||||
GlStateManager.translate(0, -0.5F, 0.45F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 8));
|
||||
} else if (name.equals("etho") || name.equals("ethoslab")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.5F, -1.2F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.cookie, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("sethbling")) {
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.translate(0F, -0.7F, 0.4F);
|
||||
renderItem(new ItemStack(Items.cookie));
|
||||
} else if (name.equals("sethbling")) {
|
||||
GlStateManager.scale(1.2F, 1.2F, 1.2F);
|
||||
GlStateManager.translate(0F, 0.9F, 0F);
|
||||
GlStateManager.translate(-0.5F, 1.4F, -0.5F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.command_block.getDefaultState(), 1F);
|
||||
} else if(name.equals("bdoubleo100") || name.equals("bdoubleo")) {
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
renderBlock(Blocks.command_block);
|
||||
} else if (name.equals("bdoubleo100") || name.equals("bdoubleo")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-1F, -1.1F, -0.1F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Items.stick, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("kingdaddydmac")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0.5F, -0.6F, 0.1F);
|
||||
renderItem(new ItemStack(Items.stick));
|
||||
} else if (name.equals("kingdaddydmac")) {
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.3F, -2.5F, 1.075F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.manaRing, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
GlStateManager.translate(0F, 0F, -4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.manaRing, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
GlStateManager.rotate(270F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(-0.3F, -2F, -1.075F);
|
||||
renderItem(new ItemStack(ModItems.manaRing, 1, 0));
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.translate(0F, 0F, 4F);
|
||||
renderItem(new ItemStack(ModItems.manaRing, 1, 0));
|
||||
|
||||
GlStateManager.scale(0.8F, 0.8F, 0.8F);
|
||||
GlStateManager.translate(-1.7F, -1.2F, -0.1F);
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.scale(1.5F, 1.5F, 1.5F);
|
||||
GlStateManager.translate(1.5F, -0.5F, 0.7F);
|
||||
mc.getBlockRendererDispatcher().renderBlockBrightness(Blocks.cake.getDefaultState(), 1.0F);
|
||||
} else if(name.equals("sjin")) {
|
||||
renderBlock(Blocks.cake);
|
||||
} else if (name.equals("sjin")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -1.27F, -0.4F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(ModItems.cosmetic, 1, 27), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
} else if(name.equals("martyn") || name.equals("inthelittlewood")) {
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, -0.77F, 0.4F);
|
||||
renderItem(new ItemStack(ModItems.cosmetic, 1, 27));
|
||||
} else if (name.equals("martyn") || name.equals("inthelittlewood")) {
|
||||
GlStateManager.scale(1.25F, 1.25F, 1.25F);
|
||||
GlStateManager.rotate(180F, 0F, 0F, 1F);
|
||||
GlStateManager.translate(-0.5F, -0.45F, -0.1F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, 0.05F, 0.1F);
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Blocks.sapling, 1, 0), ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
}else if(ContributorFancinessHandler.flowerMap != null && ContributorFancinessHandler.flowerMap.containsKey(name)) {
|
||||
renderItem(new ItemStack(Blocks.sapling, 0, 0));
|
||||
} else if (ContributorFancinessHandler.flowerMap != null && ContributorFancinessHandler.flowerMap.containsKey(name)) {
|
||||
ItemStack icon = ContributorFancinessHandler.flowerMap.get(name);
|
||||
if(icon != null) {
|
||||
if (icon != null) {
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(-0.5F, -0.5F, 0F);
|
||||
GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, 0F, 0F);
|
||||
ShaderHelper.useShader(ShaderHelper.gold);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(icon, ItemCameraTransforms.TransformType.THIRD_PERSON);
|
||||
renderItem(icon);
|
||||
ShaderHelper.releaseShader();
|
||||
}
|
||||
}
|
||||
@@ -329,15 +344,17 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new TinyPotatoRenderEvent(potato, potato.name, d0, d1, d2, var8));
|
||||
MinecraftForge.EVENT_BUS.post(new TinyPotatoRenderEvent(potato, potato.name, x, y, z, partialTicks, destroyStage));
|
||||
|
||||
GlStateManager.rotate(-rotZ, 0F, 0F, 1F);
|
||||
GlStateManager.rotate(-rotY, 0F, 1F, 0F);
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
|
||||
MovingObjectPosition pos = mc.objectMouseOver;
|
||||
if(!name.isEmpty() && pos != null && potato.getPos().equals(pos.getBlockPos())) {
|
||||
if (!name.isEmpty() && pos != null && pos.getBlockPos() != null && potato.getPos().equals(pos.getBlockPos())) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(0.5F, 0.75F, 0.5F);
|
||||
GlStateManager.translate(0F, -0.6F, 0F);
|
||||
GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(mc.getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
float f = 1.6F;
|
||||
@@ -349,30 +366,31 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
GlStateManager.enableBlend();
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
GlStateManager.disableTexture2D();
|
||||
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
int i = mc.fontRendererObj.getStringWidth(potato.name) / 2;
|
||||
tessellator.getWorldRenderer().pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.getWorldRenderer().pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.getWorldRenderer().pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.getWorldRenderer().pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.draw();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.depthMask(true);
|
||||
mc.fontRendererObj.drawString(potato.name, -mc.fontRendererObj.getStringWidth(potato.name) / 2, 0, 0xFFFFFF);
|
||||
if(name.equals("pahimar") || name.equals("soaryn")) {
|
||||
if (name.equals("pahimar") || name.equals("soaryn")) {
|
||||
GlStateManager.translate(0F, 14F, 0F);
|
||||
String s = name.equals("pahimar") ? "[WIP]" : "(soon)";
|
||||
GlStateManager.depthMask(false);
|
||||
GlStateManager.enableBlend();
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GlStateManager.disableTexture2D();
|
||||
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
i = mc.fontRendererObj.getStringWidth(s) / 2;
|
||||
tessellator.getWorldRenderer().pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.getWorldRenderer().pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.getWorldRenderer().pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.getWorldRenderer().pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
worldrenderer.pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
|
||||
tessellator.draw();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.depthMask(true);
|
||||
@@ -396,4 +414,12 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPota
|
||||
float f3 = icon.getMaxV();
|
||||
IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
}
|
||||
|
||||
public void renderItem(ItemStack stack) {
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.HEAD);
|
||||
}
|
||||
|
||||
public void renderBlock(Block block) {
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(block.getDefaultState(), 1.0F);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,17 @@
|
||||
*/
|
||||
package vazkii.botania.common;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.event.ClickEvent;
|
||||
import net.minecraft.event.HoverEvent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import vazkii.botania.common.core.handler.IMCHandler;
|
||||
import vazkii.botania.common.core.handler.ManaNetworkHandler;
|
||||
import vazkii.botania.common.core.proxy.CommonProxy;
|
||||
@@ -63,7 +74,28 @@ public class Botania {
|
||||
lightHelper = coloredLightsLoaded ? new LightHelperColored() : new LightHelperVanilla();
|
||||
|
||||
proxy.preInit(event);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent // todo temporary nag, remove when merging back into master
|
||||
public void nagUnofficial(PlayerEvent.PlayerLoggedInEvent evt) {
|
||||
EntityPlayer player = evt.player;
|
||||
|
||||
IChatComponent message = new ChatComponentTranslation("botaniamisc.unofficial.nag");
|
||||
message.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED).setUnderlined(true));
|
||||
|
||||
IChatComponent message2 = new ChatComponentTranslation("botaniamisc.unofficial.report");
|
||||
message2.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW));
|
||||
|
||||
IChatComponent url = new ChatComponentText("https://github.com/williewillus/Botania/issues");
|
||||
url.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/williewillus/Botania/issues"));
|
||||
url.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("CLICK")));
|
||||
|
||||
player.addChatComponentMessage(message);
|
||||
|
||||
player.addChatComponentMessage(message2.appendSibling(url));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
proxy.init(event);
|
||||
|
||||
Loaded 100 of 473 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user