mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 22:34:08 +00:00
Compare commits
140
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
404d99445e | ||
|
|
f3f055a58e | ||
|
|
e142561799 | ||
|
|
14a7f6b14b | ||
|
|
a6899a9f40 | ||
|
|
57398723a4 | ||
|
|
4345bd9728 | ||
|
|
1c14dcf8ff | ||
|
|
7615d0b893 | ||
|
|
b7975401b3 | ||
|
|
f641e165b0 | ||
|
|
568ed80ede | ||
|
|
c3dce97e0d | ||
|
|
61b8616008 | ||
|
|
f61d47f2dc | ||
|
|
9e16c4490b | ||
|
|
b4df8ce418 | ||
|
|
7e5974cd7c | ||
|
|
84d0c75605 | ||
|
|
9c3a042089 | ||
|
|
a1aa50b532 | ||
|
|
972943a9ac | ||
|
|
6374b01762 | ||
|
|
a4a77fb20f | ||
|
|
3a54166954 | ||
|
|
753a03b291 | ||
|
|
bf55ee4a60 | ||
|
|
68ea0b213e | ||
|
|
6b66163958 | ||
|
|
c8517f565b | ||
|
|
8268c79353 | ||
|
|
c00bb80529 | ||
|
|
cd77b41d31 | ||
|
|
20b5743221 | ||
|
|
e58eb1b345 | ||
|
|
064fd20edb | ||
|
|
85102dea89 | ||
|
|
baf14c361b | ||
|
|
3b7d7628cf | ||
|
|
8155dc3059 | ||
|
|
0494c0eba2 | ||
|
|
12dfecb8ac | ||
|
|
92aaa9f70a | ||
|
|
929860f8fa | ||
|
|
383cd059cc | ||
|
|
b108af404f | ||
|
|
2ddf71d76f | ||
|
|
34fae04641 | ||
|
|
dc6af948d9 | ||
|
|
3fe2a0006c | ||
|
|
89dac440c8 | ||
|
|
5797d18d9b | ||
|
|
52cf3df27e | ||
|
|
b976ed5df1 | ||
|
|
e727cb7f2b | ||
|
|
8e6dc7c637 | ||
|
|
28249d1e33 | ||
|
|
b24585b13d | ||
|
|
d7f94bfc00 | ||
|
|
86880bfd49 | ||
|
|
c8c50f9af0 | ||
|
|
0e301a4e33 | ||
|
|
10d095d656 | ||
|
|
9bf2e0c555 | ||
|
|
95118696ce | ||
|
|
ab4f6f6433 | ||
|
|
69eac1f12e | ||
|
|
46c13be698 | ||
|
|
ad58fb1855 | ||
|
|
12ae7ed3d1 | ||
|
|
0cd4722c1c | ||
|
|
e89322083d | ||
|
|
6cf82eb98d | ||
|
|
b10a642297 | ||
|
|
75ab210227 | ||
|
|
0b27d9d0b5 | ||
|
|
3c102bbc75 | ||
|
|
4e1065855e | ||
|
|
f9ce3676e1 | ||
|
|
17ddae20af | ||
|
|
124f8bb173 | ||
|
|
3eb67e3fea | ||
|
|
5d80b7d9ce | ||
|
|
820c042f40 | ||
|
|
f7e5054bf4 | ||
|
|
906fb74ec0 | ||
|
|
0f9bc9fc53 | ||
|
|
9036e24365 |
No files matched your search
+2
-10
@@ -10,7 +10,7 @@ Anyways, vanilla removed it from their method so we follow suit.
|
||||
* Multiblock system reworked to use states and blockposes
|
||||
* Magnet blacklist still uses metas instead of states because they need to support the short maxvalue wildcard.
|
||||
* Now includes a way for addons to pass the Botania loader the models they want to use to render their subtile with
|
||||
* IRelic changed to use UUIDs
|
||||
* Removed icon methods from SubTileSignature
|
||||
|
||||
-- Other --
|
||||
* Most things left untouched to make patches from upstream easier
|
||||
@@ -25,12 +25,4 @@ sorry :/ The systems needed to dynamically switch out the textures like that is
|
||||
* Quartz stair textures may be assigned incorrectly - resource pack authors check me
|
||||
* Glass pane inner faces are not getting culled (vanilla bug?)
|
||||
* Some item forms of technical/non-user blocks are removed
|
||||
* Full list: [all double slab items, all solid vine items]
|
||||
|
||||
-- Todo --
|
||||
* JSON models for everything (tedious/med-hard)
|
||||
* Migrate the PlayerRender events (baubles, etc.) to LayerRenderers (med)
|
||||
* For rendering arbitrary icons (that DO NOT HAVE AN ITEM) in a 3D style (manaResource icons, etc.)
|
||||
- Sub to texture stitch and bake our own model there to use?
|
||||
- This remains the largest portion of what is left
|
||||
- Where is the method to render an arbitrary baked model?
|
||||
* Full list: [all double slab items, all solid vine items]
|
||||
@@ -1,14 +0,0 @@
|
||||
altar
|
||||
up-down
|
||||
west-south-east-north
|
||||
|
||||
base textures pillar tex
|
||||
|
||||
|
||||
|
||||
northsouth face cup (1 always faces south)
|
||||
eastwest face cup (blue always faces east)
|
||||
cupbase 2
|
||||
cubbase
|
||||
|
||||
water-lava texture simply one level below top of cup
|
||||
@@ -21,6 +21,9 @@ repositories {
|
||||
name = "chickenbones"
|
||||
url = "http://chickenbones.net/maven/"
|
||||
}
|
||||
maven {
|
||||
url "http://dvs1.progwml6.com/files/maven"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
@@ -46,6 +49,7 @@ minecraft {
|
||||
replace 'GRADLE:VERSION', config.version
|
||||
|
||||
replaceIn 'LibMisc.java' //I may have missed another file, though I can only find it in here.
|
||||
useDepAts = true
|
||||
}
|
||||
|
||||
//This here is for SCP
|
||||
@@ -67,10 +71,17 @@ dependencies {
|
||||
//compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev"
|
||||
//compile "codechicken:ForgeMultipart:1.7.10-1.1.1.320:dev"
|
||||
|
||||
deobfCompile "mezz.jei:jei_1.8.9:2.13.7.64"
|
||||
|
||||
//and a bit more for SCP
|
||||
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) {
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
#
|
||||
#Wed Dec 30 00:21:06 GMT 2015
|
||||
#Fri Jan 08 18:17:27 GMT 2016
|
||||
version=r1.8
|
||||
dir_output=../Build Output/Botania/
|
||||
dir_repo=./
|
||||
forge_version=11.15.0.1656
|
||||
forge_version=11.15.0.1688
|
||||
mc_version=1.8.9
|
||||
build_number=248
|
||||
dir_repo=./
|
||||
build_number=249
|
||||
mod_name=Botania
|
||||
@@ -11,7 +11,6 @@ Hey there. Looks like you want to contribute with an issue. Great. Here's what y
|
||||
|
||||
The following "bugs" are not accepted:
|
||||
* Intended Behaviour
|
||||
* The e in Excaliber
|
||||
* Double tall flowers need be harvested with shears to not clutter the inventory
|
||||
* Already fixed but people keep reporting it for some reason
|
||||
* Wearing a Ring of Loki or Ring of the Aesir shows a wireframe below bedrock
|
||||
@@ -23,7 +22,6 @@ The following "bugs" are not accepted:
|
||||
* Mana Bursts get destroyed on Cauldron by the ClearLagg plugin (add botania:manaBurst to the ClearLagg blacklist)
|
||||
* Force Relays destroy blocks when used very fast (Can't fix due to the nature of the block)
|
||||
* Terrasteel crafting won't start (make sure your checkerboard is correct, there's Livingrock under the plate)
|
||||
* The speed tooltip on Excaliber scales with the Sharpness enchant (Vanilla bug)
|
||||
* The Horn of the Canopy doesn't break Thaumcraft leaves (Thaumcraft doesn't use the typical class or material)
|
||||
* Some Baubles don't work properly on LAN (Baubles bug)
|
||||
|
||||
|
||||
@@ -51,3 +51,5 @@ _bloop=0
|
||||
kgevans=15
|
||||
l0nekitsune=14
|
||||
swiftlileagle=14
|
||||
gryphonn=11
|
||||
loraanicus=10
|
||||
@@ -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);
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package vazkii.botania.api;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Class for API calls that must be made clientside
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final class BotaniaAPIClient {
|
||||
|
||||
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.
|
||||
* Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work.
|
||||
* 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
|
||||
*
|
||||
* @param subTileName The String ID of the subtile
|
||||
* @param model A path to a blockstate json and variant to be used for this subtile
|
||||
* @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) {
|
||||
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.
|
||||
* 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
|
||||
*
|
||||
* @param subTileName The String ID of the subtile
|
||||
* @param model A path to a blockstate json and variant to be used the block. The item model will be drawn from the same blockstate json, from variant "inventory"
|
||||
*/
|
||||
public static void registerSubtileModel(String subTileName, ModelResourceLocation model) {
|
||||
registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory"));
|
||||
}
|
||||
|
||||
// Convenience overloads for the above two calls
|
||||
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model) {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model);
|
||||
}
|
||||
|
||||
public static void registerSubtileModel(Class<? extends SubTileEntity> clazz, ModelResourceLocation model, ModelResourceLocation itemModel) {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable and live view of the registered subtile block model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
|
||||
return Collections.unmodifiableMap(subtileBlockModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable and live view of the registered subtile item model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
|
||||
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,7 @@ 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;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -134,13 +133,13 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSubTileIconForName(String name) {
|
||||
return null; //todo 1.8 return Blocks.red_flower.getIcon(0, 0);
|
||||
public ModelResourceLocation getSubTileBlockModelForName(String name) {
|
||||
return new ModelResourceLocation("builtin/missing", "missing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBasicSignatureIcons(String name, TextureMap map) {
|
||||
// NO-OP
|
||||
public ModelResourceLocation getSubTileItemModelForName(String name) {
|
||||
return new ModelResourceLocation("builtin/missing", "missing");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,8 +13,7 @@ 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;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -85,10 +84,11 @@ public interface IInternalMethodHandler {
|
||||
|
||||
public String getStackSubTileKey(ItemStack stack);
|
||||
|
||||
// todo 1.8 evaluate need for these two
|
||||
public TextureAtlasSprite getSubTileIconForName(String name);
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getSubTileBlockModelForName(String name);
|
||||
|
||||
public void registerBasicSignatureIcons(String name, TextureMap map);
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getSubTileItemModelForName(String name);
|
||||
|
||||
public boolean shouldForceCheck();
|
||||
|
||||
|
||||
@@ -10,14 +10,11 @@
|
||||
*/
|
||||
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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,8 +13,6 @@ package vazkii.botania.api.item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* An item that implements this counts as a Relic item. This is purely for interaction
|
||||
* and other mod items should not implement this interface.
|
||||
@@ -22,14 +20,14 @@ import java.util.UUID;
|
||||
public interface IRelic {
|
||||
|
||||
/**
|
||||
* Binds to the player UUID passed in.
|
||||
* Binds to the player name passed in.
|
||||
*/
|
||||
public void bindToUuid(UUID playerName, ItemStack stack);
|
||||
public void bindToUsername(String playerName, ItemStack stack);
|
||||
|
||||
/**
|
||||
* Gets the UUID of the person this relic is bound to.
|
||||
* Gets the username of the person this relic is bound to.
|
||||
*/
|
||||
public UUID getSoulbindUuid(ItemStack stack);
|
||||
public String getSoulbindUsername(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Sets the achievement that this relic binds to.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -185,4 +184,5 @@ public class Multiblock {
|
||||
public MultiblockComponent getComponentForLocation(BlockPos pos) {
|
||||
return locationCache.get(pos);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
@@ -35,4 +34,5 @@ public class MultiblockSet {
|
||||
public Multiblock getForFacing(EnumFacing facing) {
|
||||
return mbs.get(facing);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-5
@@ -24,13 +24,10 @@ import vazkii.botania.api.BotaniaAPI;
|
||||
*/
|
||||
public class ColorSwitchingComponent extends MultiblockComponent {
|
||||
|
||||
private final PropertyEnum colorProp;
|
||||
private final PropertyEnum<EnumDyeColor> colorProp;
|
||||
|
||||
public ColorSwitchingComponent(BlockPos relPos, Block block, PropertyEnum colorProp) {
|
||||
public ColorSwitchingComponent(BlockPos relPos, Block block, PropertyEnum<EnumDyeColor> colorProp) {
|
||||
super(relPos, block.getDefaultState());
|
||||
if (colorProp.getValueClass() != EnumDyeColor.class) {
|
||||
throw new IllegalArgumentException("Must be EnumDyeColor");
|
||||
}
|
||||
this.colorProp = colorProp;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
@@ -58,7 +57,7 @@ public class MultiblockComponent {
|
||||
}
|
||||
|
||||
public boolean matches(World world, BlockPos pos) {
|
||||
return world.getBlockState(pos) == state; // todo 1.8?
|
||||
return world.getBlockState(pos) == state;
|
||||
}
|
||||
|
||||
public ItemStack[] getMaterials() {
|
||||
@@ -88,4 +87,5 @@ public class MultiblockComponent {
|
||||
public boolean shouldDoFancyRender() {
|
||||
return doFancyRender;
|
||||
}
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package vazkii.botania.api.lexicon.multiblock.component;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
// Multiblock component that only compares blocks, not blockstates
|
||||
public class StateInsensitiveComponent extends MultiblockComponent {
|
||||
|
||||
public StateInsensitiveComponent(BlockPos relPos, Block block) {
|
||||
super(relPos, block.getDefaultState(), false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(World world, BlockPos pos) {
|
||||
return world.getBlockState(pos).getBlock() == this.getBlockState().getBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiblockComponent copy() {
|
||||
return new StateInsensitiveComponent(getRelativePosition(), getBlockState().getBlock());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class RecipePureDaisy {
|
||||
if(input instanceof Block)
|
||||
return state.getBlock() == input;
|
||||
|
||||
ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state));
|
||||
ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().damageDropped(state));
|
||||
String oredict = (String) input;
|
||||
return isOreDict(stack, oredict);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
/**
|
||||
* 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 com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.block.BlockRailBase;
|
||||
import net.minecraft.block.BlockRailPowered;
|
||||
@@ -8,21 +15,27 @@ 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.*;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Holds all Botania block state properties. Use these to set botania blockstates
|
||||
*/
|
||||
public class BotaniaStateProps {
|
||||
|
||||
/** The property for specialFlower **/
|
||||
/** Unlisted properties **/
|
||||
|
||||
public static final PropertyString SUBTILE_ID = new PropertyString("subtile_id");
|
||||
// The property for specialFlower 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 PropertyObject<IBlockState> HELD_STATE = new PropertyObject<>("held_state", IBlockState.class);
|
||||
|
||||
/** Common properties to all blocks to use **/
|
||||
|
||||
@@ -56,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
|
||||
@@ -80,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);
|
||||
@@ -111,35 +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);
|
||||
@@ -162,5 +153,9 @@ public class BotaniaStateProps {
|
||||
// BlockStorage
|
||||
public static final PropertyEnum<StorageVariant> STORAGE_VARIANT = PropertyEnum.create("variant", StorageVariant.class);
|
||||
|
||||
// BlockTinyPotato
|
||||
public static final PropertyEnum<PotatoVariant> POTATO_VARIANT = PropertyEnum.create("variant", PotatoVariant.class);
|
||||
|
||||
private BotaniaStateProps() {}
|
||||
|
||||
}
|
||||
@@ -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,33 +0,0 @@
|
||||
package vazkii.botania.api.state;
|
||||
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -13,4 +21,5 @@ public enum AlfPortalState implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -16,4 +24,5 @@ public enum AltGrassVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return this.name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -20,4 +28,5 @@ public enum AltarVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -26,4 +34,5 @@ public enum BiomeBrickVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -26,4 +34,5 @@ public enum BiomeStoneVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum CratePattern implements IStringSerializable {
|
||||
NONE,
|
||||
CRAFTY_1_1,
|
||||
CRAFTY_2_2,
|
||||
CRAFTY_1_2,
|
||||
CRAFTY_2_1,
|
||||
CRAFTY_1_3,
|
||||
CRAFTY_3_1,
|
||||
CRAFTY_2_3,
|
||||
CRAFTY_3_2,
|
||||
CRAFTY_DONUT;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -12,4 +20,5 @@ public enum CrateVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -26,4 +34,5 @@ public enum CustomBrickVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -13,4 +21,5 @@ public enum DrumVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -14,4 +22,5 @@ public enum EndBrickVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -26,4 +34,5 @@ public enum FutureStoneVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -15,4 +23,5 @@ public enum LivingRockVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -16,4 +24,5 @@ public enum LivingWoodVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -12,4 +20,5 @@ public enum LuminizerVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -13,4 +21,5 @@ public enum PlatformVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -14,4 +22,5 @@ public enum PoolVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum PotatoVariant implements IStringSerializable {
|
||||
DEFAULT,
|
||||
HALLOWEEN,
|
||||
GRAYSCALE;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -13,4 +21,5 @@ public enum PrismarineVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -13,4 +21,5 @@ public enum PylonVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -15,4 +23,5 @@ public enum QuartzVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -14,4 +22,5 @@ public enum SpreaderVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
/**
|
||||
* 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.enums;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
@@ -15,4 +23,5 @@ public enum StorageVariant implements IStringSerializable {
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,13 +10,12 @@
|
||||
*/
|
||||
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;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -94,11 +93,19 @@ public class SubTileEntity {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the icon for this SubTileEntity, this is a block icon.
|
||||
* Gets the block model path for this subtile
|
||||
*/
|
||||
@SideOnly(Side.CLIENT) // todo 1.8 reevaluate need
|
||||
public TextureAtlasSprite getIcon() {
|
||||
return BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName());
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getBlockModel() {
|
||||
return BotaniaAPI.internalHandler.getSubTileBlockModelForName(getUnlocalizedName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item model path for this subtile
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getItemModel() {
|
||||
return BotaniaAPI.internalHandler.getSubTileItemModelForName(getUnlocalizedName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -10,15 +10,11 @@
|
||||
*/
|
||||
package vazkii.botania.api.subtile.signature;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
@@ -38,16 +34,6 @@ public class BasicSignature extends SubTileSignature {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(TextureMap register) {
|
||||
BotaniaAPI.internalHandler.registerBasicSignatureIcons(name, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getIconForStack(ItemStack stack) {
|
||||
return BotaniaAPI.internalHandler.getSubTileIconForName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForStack(ItemStack stack) {
|
||||
return unlocalizedName("");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -24,16 +22,6 @@ public abstract class SubTileSignature {
|
||||
|
||||
public static final String SPECIAL_FLOWER_PREFIX = "flower.";
|
||||
|
||||
/**
|
||||
* Equivalent to Block.registerBlockIcons.
|
||||
*/
|
||||
public abstract void registerIcons(TextureMap map);
|
||||
// todo 1.8 evaluate need for these two
|
||||
/**
|
||||
* Gets the icon to display for the flower item.
|
||||
*/
|
||||
public abstract TextureAtlasSprite getIconForStack(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Gets the display name for the flower item.
|
||||
*/
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SimpleWikiProvider implements IWikiProvider {
|
||||
ItemStack stack = block.getPickBlock(pos, world, bPos, null);
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
stack = new ItemStack(block, 1, block.getMetaFromState(world.getBlockState(bPos)));
|
||||
stack = new ItemStack(block, 1, block.getDamageValue(world, bPos));
|
||||
|
||||
if(stack.getItem() == null)
|
||||
return null;
|
||||
|
||||
@@ -10,13 +10,9 @@
|
||||
*/
|
||||
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.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -25,8 +21,6 @@ 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;
|
||||
|
||||
@@ -18,19 +18,14 @@ import java.util.Properties;
|
||||
|
||||
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.layers.LayerRenderer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.settings.GameSettings.Options;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EnumPlayerModelParts;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.item.IBaubleRender.Helper;
|
||||
@@ -39,9 +34,7 @@ import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.version.VersionChecker;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.item.material.ItemManaResource;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
|
||||
public final class ContributorFancinessHandler implements LayerRenderer<EntityPlayer> {
|
||||
@@ -101,7 +94,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
|
||||
private static void renderTwintails(EntityPlayer player, float partialTicks) {
|
||||
GlStateManager.pushMatrix();
|
||||
TextureAtlasSprite icon = RenderEventHandler.INSTANCE.tailIcon;
|
||||
TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.tailIcon;
|
||||
float f = icon.getMinU();
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
@@ -132,7 +125,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
|
||||
private static void renderPhiFlower(EntityPlayer player) {
|
||||
GlStateManager.pushMatrix();
|
||||
TextureAtlasSprite icon = RenderEventHandler.INSTANCE.phiFlowerIcon;
|
||||
TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.phiFlowerIcon;
|
||||
float f = icon.getMinU();
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
@@ -153,7 +146,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
|
||||
|
||||
private static void renderGoldfish(EntityPlayer player) {
|
||||
GlStateManager.pushMatrix();
|
||||
TextureAtlasSprite icon = RenderEventHandler.INSTANCE.goldfishIcon;
|
||||
TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.goldfishIcon;
|
||||
float f = icon.getMinU();
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
|
||||
@@ -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;
|
||||
@@ -102,9 +100,9 @@ public final class HUDHandler {
|
||||
profiler.startSection("botania-hud");
|
||||
MovingObjectPosition pos = mc.objectMouseOver;
|
||||
|
||||
if(pos != null && pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
Block block = mc.theWorld.getBlockState(pos.getBlockPos()).getBlock();
|
||||
TileEntity tile = mc.theWorld.getTileEntity(pos.getBlockPos());
|
||||
if(pos != null) {
|
||||
Block block = pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ? mc.theWorld.getBlockState(pos.getBlockPos()).getBlock() : null;
|
||||
TileEntity tile = pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ? mc.theWorld.getTileEntity(pos.getBlockPos()) : null;
|
||||
|
||||
if(equippedStack != null) {
|
||||
if(pos != null && equippedStack.getItem() == ModItems.twigWand) {
|
||||
@@ -115,7 +113,7 @@ public final class HUDHandler {
|
||||
((IWandHUD) block).renderHUD(mc, event.resolution, mc.theWorld, pos.getBlockPos());
|
||||
profiler.endSection();
|
||||
}
|
||||
} else if(pos != null && equippedStack.getItem() instanceof ILexicon)
|
||||
} else if(block != null && equippedStack.getItem() instanceof ILexicon)
|
||||
drawLexiconHUD(mc.thePlayer.getCurrentEquippedItem(), block, pos, event.resolution);
|
||||
if(tile != null && tile instanceof TilePool)
|
||||
renderPoolRecipeHUD(event.resolution, (TilePool) tile, equippedStack);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -150,38 +150,38 @@ public class LightningHandler {
|
||||
int b = (color & 0xFF);
|
||||
int a = (int) (mainalpha * rendersegment.light * new Color(color).getAlpha());
|
||||
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
|
||||
if(rendersegment.next == null) {
|
||||
Vector3 roundend = rendersegment.endpoint.point.copy().add(rendersegment.diff.copy().normalize().multiply(width));
|
||||
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z).lightmap(0xF0, 0xF0).tex(0, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z).lightmap(0xF0, 0xF0).tex(0, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z).tex(0, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z).tex(0, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
}
|
||||
|
||||
if(rendersegment.prev == null) {
|
||||
Vector3 roundend = rendersegment.startpoint.point.copy().subtract(rendersegment.diff.copy().normalize().multiply(width));
|
||||
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z).lightmap(0xF0, 0xF0).tex(0, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z).lightmap(0xF0, 0xF0).tex(0, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z).tex(0, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z).tex(0, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
|
||||
+83
-5
@@ -1,26 +1,50 @@
|
||||
/**
|
||||
* 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.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;
|
||||
import vazkii.botania.client.model.PylonItemModel;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.integration.buildcraft.TriggerManaLevel;
|
||||
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 RenderEventHandler {
|
||||
public class MiscellaneousIcons {
|
||||
|
||||
public static final RenderEventHandler INSTANCE = new RenderEventHandler();
|
||||
public static final MiscellaneousIcons INSTANCE = new MiscellaneousIcons();
|
||||
|
||||
public TextureAtlasSprite
|
||||
alfPortalTex,
|
||||
@@ -41,8 +65,9 @@ public class RenderEventHandler {
|
||||
public TextureAtlasSprite[] sparkUpgradeIcons;
|
||||
public TextureAtlasSprite[] kingKeyWeaponIcons;
|
||||
public Map<TriggerManaLevel.State, TextureAtlasSprite> manaLevelTriggerIcons = Maps.newEnumMap(TriggerManaLevel.State.class);
|
||||
public TextureAtlasSprite[] tiaraWingIcons;
|
||||
|
||||
// begin dank_memes todo 1.8 if I can figure out how to render arbitrary baked models then these will no longer be needed
|
||||
// begin dank_memes
|
||||
public TextureAtlasSprite tailIcon = null;
|
||||
public TextureAtlasSprite phiFlowerIcon = null;
|
||||
public TextureAtlasSprite goldfishIcon = null;
|
||||
@@ -65,11 +90,16 @@ public class RenderEventHandler {
|
||||
evt.modelRegistry.putObject(new ModelResourceLocation("botania:miniIsland", "inventory"), FloatingFlowerModel.INSTANCE);
|
||||
evt.modelRegistry.putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "normal"), FloatingFlowerModel.INSTANCE);
|
||||
evt.modelRegistry.putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory"), FloatingFlowerModel.INSTANCE);
|
||||
|
||||
// Pylon item model
|
||||
evt.modelRegistry.putObject(new ModelResourceLocation("botania:pylon", "inventory"), new PylonItemModel());
|
||||
|
||||
// Platforms
|
||||
evt.modelRegistry.putObject(new ModelResourceLocation("botania:platform", "normal"), new PlatformModel());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTextureStitch(TextureStitchEvent.Pre evt) {
|
||||
System.out.println("CALLING TEXTURE STITCH");
|
||||
alfPortalTex = IconHelper.forName(evt.map, "alfheimPortalInside", "blocks");
|
||||
lightRelayWorldIcon = IconHelper.forName(evt.map, "lightRelay1", "blocks");
|
||||
lightRelayWorldIconRed = IconHelper.forName(evt.map, "lightRelay3", "blocks");
|
||||
@@ -103,7 +133,55 @@ public class RenderEventHandler {
|
||||
for (TriggerManaLevel.State s : TriggerManaLevel.State.values()) {
|
||||
manaLevelTriggerIcons.put(s, IconHelper.forName(evt.map, "triggers/mana" + WordUtils.capitalizeFully(s.name()), "items"));
|
||||
}
|
||||
|
||||
tiaraWingIcons = new TextureAtlasSprite[ItemFlightTiara.WING_TYPES];
|
||||
for (int i = 0; i < tiaraWingIcons.length; i++) {
|
||||
tiaraWingIcons[i] = IconHelper.forName(evt.map, "flightTiara" + i, "items");
|
||||
}
|
||||
}
|
||||
|
||||
private RenderEventHandler() {}
|
||||
@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();
|
||||
}
|
||||
}
|
||||
|
||||
private MiscellaneousIcons() {}
|
||||
}
|
||||
@@ -1,16 +1,24 @@
|
||||
/**
|
||||
* 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.core.handler;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.BlockRailPowered;
|
||||
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;
|
||||
@@ -20,11 +28,16 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import vazkii.botania.api.render.SpecialFlowerModel;
|
||||
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;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.AltGrassVariant;
|
||||
import vazkii.botania.api.state.enums.AltarVariant;
|
||||
@@ -38,9 +51,11 @@ import vazkii.botania.api.state.enums.FutureStoneVariant;
|
||||
import vazkii.botania.api.state.enums.LivingRockVariant;
|
||||
import vazkii.botania.api.state.enums.LivingWoodVariant;
|
||||
import vazkii.botania.api.state.enums.LuminizerVariant;
|
||||
import vazkii.botania.api.state.enums.PoolVariant;
|
||||
import vazkii.botania.api.state.enums.PrismarineVariant;
|
||||
import vazkii.botania.api.state.enums.PylonVariant;
|
||||
import vazkii.botania.api.state.enums.StorageVariant;
|
||||
import vazkii.botania.client.core.proxy.ClientProxy;
|
||||
import vazkii.botania.client.model.FloatingFlowerModel;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
@@ -87,28 +102,37 @@ import vazkii.botania.common.block.subtile.generating.SubTileNightshade;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileRafflowsia;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileSpectrolus;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileThermalily;
|
||||
import vazkii.botania.common.block.tile.TileAvatar;
|
||||
import vazkii.botania.common.block.tile.TileBrewery;
|
||||
import vazkii.botania.common.block.tile.TileGaiaHead;
|
||||
import vazkii.botania.common.block.tile.TileHourglass;
|
||||
import vazkii.botania.common.block.tile.TileTeruTeruBozu;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
import vazkii.botania.common.block.tile.mana.TileBellows;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
import vazkii.botania.common.item.ItemManaGun;
|
||||
import vazkii.botania.common.item.ItemSpawnerMover;
|
||||
import vazkii.botania.common.item.ItemTwigWand;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.brew.ItemBrewBase;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing;
|
||||
import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick;
|
||||
import vazkii.botania.common.item.relic.ItemInfiniteFruit;
|
||||
import vazkii.botania.common.item.rod.ItemTornadoRod;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import static vazkii.botania.common.item.ModItems.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public final class ModelHandler {
|
||||
|
||||
// Very hardocode-y right now. Will be refactored after things work.
|
||||
// In addition, many of the jsons currently use the vanilla format (simple and verified bug-free).
|
||||
// Once things settle down, we'll move to forge jsons, which will drastically cut down on the number of json files
|
||||
// todo reorganize, alphabetize
|
||||
public static void registerModels() {
|
||||
ModelLoaderRegistry.registerLoader(SpecialFlowerModel.Loader.INSTANCE);
|
||||
OBJLoader.instance.addDomain(LibMisc.MOD_ID.toLowerCase(Locale.ROOT));
|
||||
@@ -132,9 +156,11 @@ public final class ModelHandler {
|
||||
registerAltars();
|
||||
registerQuartzBlocks();
|
||||
registerLuminizers();
|
||||
registerPools();
|
||||
|
||||
/** Normal Items **/
|
||||
registerStandardItems();
|
||||
registerTESRItems();
|
||||
registerManaResources();
|
||||
registerRunes();
|
||||
registerBows();
|
||||
@@ -142,232 +168,300 @@ 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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:spawnerMover", "inventory");
|
||||
} else {
|
||||
return new ModelResourceLocation("botania:spawnerMoverFull", "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";
|
||||
}
|
||||
});
|
||||
|
||||
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");
|
||||
if (ItemTerraPick.isEnabled(stack)) {
|
||||
name += "Enabled";
|
||||
}
|
||||
});
|
||||
|
||||
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.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.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");
|
||||
}
|
||||
});
|
||||
return new ModelResourceLocation(name, "inventory");
|
||||
}));
|
||||
}
|
||||
|
||||
private static void registerSubtiles() {
|
||||
SpecialFlowerModel.register(SubTileManastar.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MANASTAR));
|
||||
SpecialFlowerModel.register(SubTilePureDaisy.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_PUREDAISY));
|
||||
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"));
|
||||
|
||||
SpecialFlowerModel.register(SubTileDaybloom.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM));
|
||||
SpecialFlowerModel.register(SubTileDecor.Daybloom.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM + "Decor"));
|
||||
SpecialFlowerModel.register(SubTileDaybloom.Prime.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM_PRIME));
|
||||
SpecialFlowerModel.register(SubTileEndoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENDOFLAME));
|
||||
SpecialFlowerModel.register(SubTileHydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS));
|
||||
SpecialFlowerModel.register(SubTileDecor.Hydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS + "Decor"));
|
||||
SpecialFlowerModel.register(SubTileThermalily.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_THERMALILY));
|
||||
SpecialFlowerModel.register(SubTileNightshade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE));
|
||||
SpecialFlowerModel.register(SubTileDecor.Nightshade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE + "Decor"));
|
||||
SpecialFlowerModel.register(SubTileNightshade.Prime.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE_PRIME));
|
||||
SpecialFlowerModel.register(SubTileArcaneRose.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ARCANE_ROSE));
|
||||
SpecialFlowerModel.register(SubTileMunchdew.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MUNCHDEW));
|
||||
SpecialFlowerModel.register(SubTileEntropinnyum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENTROPINNYUM));
|
||||
SpecialFlowerModel.register(SubTileKekimurus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_KEKIMURUS));
|
||||
SpecialFlowerModel.register(SubTileGourmaryllis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_GOURMARYLLIS));
|
||||
SpecialFlowerModel.register(SubTileNarslimmus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NARSLIMMUS));
|
||||
SpecialFlowerModel.register(SubTileSpectrolus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTROLUS));
|
||||
SpecialFlowerModel.register(SubTileDandelifeon.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DANDELIFEON));
|
||||
SpecialFlowerModel.register(SubTileRafflowsia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RAFFLOWSIA));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileManastar.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MANASTAR));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTilePureDaisy.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_PUREDAISY));
|
||||
|
||||
SpecialFlowerModel.register(SubTileBellethorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN));
|
||||
SpecialFlowerModel.register(SubTileBellethorn.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN + "Chibi"));
|
||||
SpecialFlowerModel.register(SubTileDreadthorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DREADTHORN));
|
||||
SpecialFlowerModel.register(SubTileHeiseiDream.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HEISEI_DREAM));
|
||||
SpecialFlowerModel.register(SubTileTigerseye.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TIGERSEYE));
|
||||
SpecialFlowerModel.register(SubTileJadedAmaranthus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JADED_AMARANTHUS));
|
||||
SpecialFlowerModel.register(SubTileOrechid.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID));
|
||||
SpecialFlowerModel.register(SubTileOrechidIgnem.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID_IGNEM));
|
||||
SpecialFlowerModel.register(SubTileFallenKanade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_FALLEN_KANADE));
|
||||
SpecialFlowerModel.register(SubTileExoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_EXOFLAME));
|
||||
SpecialFlowerModel.register(SubTileAgricarnation.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION));
|
||||
SpecialFlowerModel.register(SubTileAgricarnation.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION + "Chibi"));
|
||||
SpecialFlowerModel.register(SubTileHopperhock.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK));
|
||||
SpecialFlowerModel.register(SubTileHopperhock.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK + "Chibi"));
|
||||
SpecialFlowerModel.register(SubTileTangleberrie.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TANGLEBERRIE));
|
||||
SpecialFlowerModel.register(SubTileJiyuulia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JIYUULIA));
|
||||
SpecialFlowerModel.register(SubTileRannuncarpus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS));
|
||||
SpecialFlowerModel.register(SubTileRannuncarpus.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS + "Chibi"));
|
||||
SpecialFlowerModel.register(SubTileHyacidus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYACIDUS));
|
||||
SpecialFlowerModel.register(SubTilePollidisiac.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_POLLIDISIAC));
|
||||
SpecialFlowerModel.register(SubTileClayconia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_CLAYCONIA));
|
||||
SpecialFlowerModel.register(SubTileLoonuim.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_LOONIUM));
|
||||
SpecialFlowerModel.register(SubTileDaffomill.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAFFOMILL));
|
||||
SpecialFlowerModel.register(SubTileVinculotus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_VINCULOTUS));
|
||||
SpecialFlowerModel.register(SubTileSpectranthemum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTRANTHEMUM));
|
||||
SpecialFlowerModel.register(SubTileMedumone.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MEDUMONE));
|
||||
SpecialFlowerModel.register(SubTileMarimorphosis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS));
|
||||
SpecialFlowerModel.register(SubTileMarimorphosis.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS + "Chibi"));
|
||||
SpecialFlowerModel.register(SubTileBubbell.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL));
|
||||
SpecialFlowerModel.register(SubTileBubbell.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL + "Chibi"));
|
||||
SpecialFlowerModel.register(SubTileSolegnolia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA));
|
||||
SpecialFlowerModel.register(SubTileSolegnolia.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA + "Chibi"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileDaybloom.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileDecor.Daybloom.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM + "Decor"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileDaybloom.Prime.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAYBLOOM_PRIME));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileEndoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENDOFLAME));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileHydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileDecor.Hydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS + "Decor"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileThermalily.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_THERMALILY));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileNightshade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileDecor.Nightshade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE + "Decor"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileNightshade.Prime.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NIGHTSHADE_PRIME));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileArcaneRose.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ARCANE_ROSE));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileMunchdew.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MUNCHDEW));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileEntropinnyum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENTROPINNYUM));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileKekimurus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_KEKIMURUS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileGourmaryllis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_GOURMARYLLIS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileNarslimmus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NARSLIMMUS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileSpectrolus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTROLUS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileDandelifeon.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DANDELIFEON));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileRafflowsia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RAFFLOWSIA));
|
||||
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileBellethorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileBellethorn.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN + "Chibi"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileDreadthorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DREADTHORN));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileHeiseiDream.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HEISEI_DREAM));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileTigerseye.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TIGERSEYE));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileJadedAmaranthus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JADED_AMARANTHUS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileOrechid.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileOrechidIgnem.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID_IGNEM));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileFallenKanade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_FALLEN_KANADE));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileExoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_EXOFLAME));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileAgricarnation.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileAgricarnation.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION + "Chibi"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileHopperhock.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileHopperhock.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK + "Chibi"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileTangleberrie.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TANGLEBERRIE));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileJiyuulia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JIYUULIA));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileRannuncarpus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileRannuncarpus.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS + "Chibi"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileHyacidus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYACIDUS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTilePollidisiac.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_POLLIDISIAC));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileClayconia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_CLAYCONIA));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileLoonuim.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_LOONIUM));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileDaffomill.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAFFOMILL));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileVinculotus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_VINCULOTUS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileSpectranthemum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTRANTHEMUM));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileMedumone.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MEDUMONE));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileMarimorphosis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileMarimorphosis.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS + "Chibi"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileBubbell.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileBubbell.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL + "Chibi"));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileSolegnolia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA));
|
||||
BotaniaAPIClient.registerSubtileModel(SubTileSolegnolia.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA + "Chibi"));
|
||||
}
|
||||
|
||||
private static void registerStandardBlocks() {
|
||||
registerItemModel(ModBlocks.manaGlass);
|
||||
registerItemModel(ModBlocks.elfGlass);
|
||||
registerItemModel(ModBlocks.runeAltar);
|
||||
registerItemModel(ModBlocks.pistonRelay);
|
||||
registerItemModel(ModBlocks.distributor);
|
||||
registerItemModel(ModBlocks.starfield);
|
||||
registerItemModel(ModBlocks.specialFlower);
|
||||
registerItemModel(ModBlocks.dirtPath);
|
||||
registerItemModel(ModBlocks.felPumpkin);
|
||||
registerItemModel(ModBlocks.ghostRail);
|
||||
registerItemModel(ModBlocks.shimmerrock);
|
||||
registerItemModel(ModBlocks.shimmerwoodPlanks);
|
||||
registerItemModel(ModBlocks.manaVoid);
|
||||
registerItemModel(ModBlocks.alchemyCatalyst);
|
||||
registerItemModel(ModBlocks.conjurationCatalyst);
|
||||
registerItemModel(ModBlocks.reedBlock);
|
||||
registerItemModel(ModBlocks.alfPortal);
|
||||
registerItemModel(ModBlocks.bifrost);
|
||||
registerItemModel(ModBlocks.bifrostPerm);
|
||||
registerItemModel(ModBlocks.enderEye);
|
||||
registerItemModel(ModBlocks.tinyPlanet);
|
||||
registerItemModel(ModBlocks.thatch);
|
||||
registerItemModel(ModBlocks.blazeBlock);
|
||||
registerItemModel(ModBlocks.forestEye);
|
||||
registerItemModel(ModBlocks.seaLamp);
|
||||
registerItemModel(ModBlocks.cacophonium);
|
||||
registerItemModel(ModBlocks.cellBlock);
|
||||
registerItemModel(ModBlocks.conjurationCatalyst);
|
||||
registerItemModel(ModBlocks.cocoon);
|
||||
registerItemModel(ModBlocks.corporeaFunnel);
|
||||
registerItemModel(ModBlocks.corporeaInterceptor);
|
||||
registerItemModel(ModBlocks.corporeaRetainer);
|
||||
registerItemModel(ModBlocks.dirtPath);
|
||||
registerItemModel(ModBlocks.distributor);
|
||||
registerItemModel(ModBlocks.elfGlass);
|
||||
registerItemModel(ModBlocks.enchantedSoil);
|
||||
registerItemModel(ModBlocks.enchanter);
|
||||
registerItemModel(ModBlocks.enderEye);
|
||||
registerItemModel(ModBlocks.felPumpkin);
|
||||
registerItemModel(ModBlocks.floatingSpecialFlower);
|
||||
registerItemModel(ModBlocks.forestEye);
|
||||
registerItemModel(ModBlocks.ghostRail);
|
||||
registerItemModel(ModBlocks.incensePlate);
|
||||
registerItemModel(ModBlocks.lightLauncher);
|
||||
registerItemModel(ModBlocks.manaBomb);
|
||||
registerItemModel(ModBlocks.manaDetector);
|
||||
registerItemModel(ModBlocks.manaFlame);
|
||||
registerItemModel(ModBlocks.manaGlass);
|
||||
registerItemModel(ModBlocks.manaVoid);
|
||||
registerItemModel(ModBlocks.prism);
|
||||
registerItemModel(ModBlocks.pistonRelay);
|
||||
registerItemModel(ModBlocks.redStringComparator);
|
||||
registerItemModel(ModBlocks.redStringContainer);
|
||||
registerItemModel(ModBlocks.redStringDispenser);
|
||||
registerItemModel(ModBlocks.redStringComparator);
|
||||
registerItemModel(ModBlocks.redStringFertilizer);
|
||||
registerItemModel(ModBlocks.redStringInterceptor);
|
||||
registerItemModel(ModBlocks.redStringRelay);
|
||||
registerItemModel(ModBlocks.floatingSpecialFlower);
|
||||
registerItemModel(ModBlocks.sparkChanger);
|
||||
registerItemModel(ModBlocks.terraPlate);
|
||||
registerItemModel(ModBlocks.corporeaRetainer);
|
||||
registerItemModel(ModBlocks.corporeaInterceptor);
|
||||
registerItemModel(ModBlocks.corporeaFunnel);
|
||||
registerItemModel(ModBlocks.lightLauncher);
|
||||
registerItemModel(ModBlocks.manaDetector);
|
||||
registerItemModel(ModBlocks.manaBomb);
|
||||
registerItemModel(ModBlocks.reedBlock);
|
||||
registerItemModel(ModBlocks.rfGenerator);
|
||||
registerItemModel(ModBlocks.alfPortal);
|
||||
registerItemModel(ModBlocks.root);
|
||||
registerItemModel(ModBlocks.cacophonium);
|
||||
registerItemModel(ModBlocks.runeAltar);
|
||||
registerItemModel(ModBlocks.seaLamp);
|
||||
registerItemModel(ModBlocks.shimmerrock);
|
||||
registerItemModel(ModBlocks.shimmerwoodPlanks);
|
||||
registerItemModel(ModBlocks.sparkChanger);
|
||||
registerItemModel(ModBlocks.spawnerClaw);
|
||||
registerItemModel(ModBlocks.specialFlower);
|
||||
registerItemModel(ModBlocks.starfield);
|
||||
registerItemModel(ModBlocks.thatch);
|
||||
registerItemModel(ModBlocks.terraPlate);
|
||||
registerItemModel(ModBlocks.tinyPlanet);
|
||||
registerItemModel(ModBlocks.tinyPotato);
|
||||
registerItemModel(ModBlocks.turntable);
|
||||
|
||||
// Register all metas to variant inventory, so the smartmodel can take over from there. See MiscellaneousIcons
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.floatingFlower), EnumDyeColor.values().length);
|
||||
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.pylon), PylonVariant.values().length);
|
||||
|
||||
// Item models which all use the same base model and recolored by render layer
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.unstableBlock), EnumDyeColor.values().length);
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.petalBlock), EnumDyeColor.values().length);
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.manaBeacon), EnumDyeColor.values().length);
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.petalBlock), EnumDyeColor.values().length);
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.unstableBlock), EnumDyeColor.values().length);
|
||||
|
||||
// Blocks which share models with their item, and have only one variant to switch over
|
||||
registerVariantsDefaulted(ModBlocks.altGrass, AltGrassVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.storage, StorageVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.pylon, PylonVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.biomeStoneA, BiomeStoneVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.biomeStoneB, BiomeBrickVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.customBrick, CustomBrickVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.endStoneBrick, EndBrickVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.dreamwood, LivingWoodVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.forestDrum, DrumVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.livingrock, LivingRockVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.livingwood, LivingWoodVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.dreamwood, LivingWoodVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.stone, FutureStoneVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.biomeStoneA, BiomeStoneVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.biomeStoneB, BiomeBrickVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.endStoneBrick, EndBrickVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.openCrate, CrateVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.customBrick, CustomBrickVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.openCrate, CrateVariant.class, "pattern=none,variant");
|
||||
registerVariantsDefaulted(ModBlocks.platform, PlatformVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.prismarine, PrismarineVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.spreader, SpreaderVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.stone, FutureStoneVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.storage, StorageVariant.class, "variant");
|
||||
}
|
||||
|
||||
private static void registerStandardItems() {
|
||||
@@ -375,9 +469,9 @@ public final class ModelHandler {
|
||||
registerItemModel(blackLotus);
|
||||
registerItemModel(blackLotus, 1);
|
||||
registerItemModel(lexicon);
|
||||
registerItemModel(manaCookie);
|
||||
|
||||
registerItemModel(manasteelHelm);
|
||||
registerItemModel(manasteelHelmRevealing);
|
||||
registerItemModel(manasteelChest);
|
||||
registerItemModel(manasteelLegs);
|
||||
registerItemModel(manasteelBoots);
|
||||
@@ -388,6 +482,7 @@ public final class ModelHandler {
|
||||
registerItemModel(manasteelShears);
|
||||
|
||||
registerItemModel(elementiumHelm);
|
||||
registerItemModel(elementiumHelmRevealing);
|
||||
registerItemModel(elementiumChest);
|
||||
registerItemModel(elementiumLegs);
|
||||
registerItemModel(elementiumBoots);
|
||||
@@ -395,14 +490,8 @@ public final class ModelHandler {
|
||||
registerItemModel(elementiumPick);
|
||||
registerItemModel(elementiumShovel);
|
||||
registerItemModel(elementiumAxe);
|
||||
registerItemModel(elementiumShears);
|
||||
registerItemModel(elementiumSword);
|
||||
|
||||
registerItemModel(manaweaveHelm);
|
||||
registerItemModel(manaweaveChest);
|
||||
registerItemModel(manaweaveLegs);
|
||||
registerItemModel(manaweaveBoots);
|
||||
|
||||
registerItemModel(terrasteelHelm);
|
||||
registerItemModel(terrasteelHelmRevealing);
|
||||
registerItemModel(terrasteelChest);
|
||||
@@ -414,7 +503,6 @@ public final class ModelHandler {
|
||||
registerItemModel(starSword);
|
||||
registerItemModel(thunderSword);
|
||||
registerItemModel(glassPick);
|
||||
registerItemModel(twigWand);
|
||||
|
||||
registerItemModel(flowerBag);
|
||||
registerItemModel(fertilizer);
|
||||
@@ -434,9 +522,6 @@ public final class ModelHandler {
|
||||
registerItemModel(smeltRod);
|
||||
registerItemModel(exchangeRod);
|
||||
|
||||
registerItemModel(tornadoRod);
|
||||
ModelLoader.registerItemVariants(tornadoRod, new ModelResourceLocation("botania:tornadoRod_flying", "inventory"));
|
||||
|
||||
registerItemModel(openBucket);
|
||||
registerItemModel(bloodPendant);
|
||||
registerItemModel(manaTablet);
|
||||
@@ -495,7 +580,8 @@ public final class ModelHandler {
|
||||
registerItemModel(flightTiara);
|
||||
registerItemModel(divaCharm);
|
||||
registerItemModel(manaMirror);
|
||||
// magnet ring and greater version - custom mesher
|
||||
registerItemModel(manaInkwell);
|
||||
registerItemModel(waterBowl);
|
||||
|
||||
registerItemModelAllMeta(flightTiara, ItemFlightTiara.WING_TYPES);
|
||||
registerItemModelAllMeta(laputaShard, 20);
|
||||
@@ -512,11 +598,41 @@ 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);
|
||||
|
||||
registerItemModel(ModBlocks.bellows); // todo await animation api
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.bellows), 0, TileBellows.class);
|
||||
|
||||
registerItemModel(ModBlocks.brewery);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.brewery), 0, TileBrewery.class);
|
||||
|
||||
registerItemModel(ModBlocks.corporeaCrystalCube);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.corporeaCrystalCube), 0, TileCorporeaCrystalCube.class);
|
||||
|
||||
registerItemModel(ModBlocks.corporeaIndex); // todo json maybe? await animation api
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.corporeaIndex), 0, TileCorporeaIndex.class);
|
||||
|
||||
registerItemModel(ModItems.gaiaHead);
|
||||
ForgeHooksClient.registerTESRItemStack(ModItems.gaiaHead, 0, TileGaiaHead.class);
|
||||
|
||||
registerItemModel(ModBlocks.hourglass); // todo json maybe?
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.hourglass), 0, TileHourglass.class);
|
||||
|
||||
registerItemModel(ModBlocks.pump); // todo await animation api
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.pump), 0, TilePump.class);
|
||||
|
||||
registerItemModel(ModBlocks.teruTeruBozu);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.teruTeruBozu), 0, TileTeruTeruBozu.class);
|
||||
}
|
||||
|
||||
private static void registerManaResources() {
|
||||
@@ -569,29 +685,23 @@ 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() {
|
||||
// Override for floating flowers
|
||||
// Override to let smartmodels work, see RenderEventHandler
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.floatingSpecialFlower, new StateMapperBase() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
@@ -606,23 +716,28 @@ public final class ModelHandler {
|
||||
}
|
||||
});
|
||||
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.platform, new StateMapperBase() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return new ModelResourceLocation("botania:platform", "normal");
|
||||
}
|
||||
});
|
||||
|
||||
// Ignore vanilla facing, variant in double flower
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower1, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower2, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build());
|
||||
|
||||
// Ignore color in unstable cube, mana beacon, and petals (handled by color multiplier)
|
||||
// Ignore color in unstable cube, mana beacon, special flower, and petals (handled by color multiplier)
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.unstableBlock, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.manaBeacon, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.petalBlock, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.specialFlower, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR, ((BlockFlower) ModBlocks.specialFlower).getTypeProperty()).build());
|
||||
|
||||
// Ignore vanilla variant in flowers
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.flower, (new StateMap.Builder()).ignore(((BlockFlower) ModBlocks.flower).getTypeProperty()).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.shinyFlower, (new StateMap.Builder()).ignore(((BlockFlower) ModBlocks.shinyFlower).getTypeProperty()).build());
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.buriedPetals, (new StateMap.Builder()).ignore(((BlockFlower) ModBlocks.buriedPetals).getTypeProperty()).build());
|
||||
|
||||
// Ignore in special flower to suppress errors (handled in custom statemapper in BlockSpecialFlower
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.specialFlower, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR, ((BlockFlower) ModBlocks.specialFlower).getTypeProperty()).build());
|
||||
|
||||
// Ignore vanilla variant in walls
|
||||
ModelLoader.setCustomStateMapper(ModFluffBlocks.biomeStoneWall, (new StateMap.Builder()).ignore(BlockWall.VARIANT).build());
|
||||
ModelLoader.setCustomStateMapper(ModFluffBlocks.dreamwoodWall, (new StateMap.Builder()).ignore(BlockWall.VARIANT).build());
|
||||
@@ -683,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() {
|
||||
@@ -914,6 +1037,21 @@ public final class ModelHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerPools() {
|
||||
Item item = Item.getItemFromBlock(ModBlocks.pool);
|
||||
String name = GameData.getBlockRegistry().getNameForObject(ModBlocks.pool).toString();
|
||||
for (PoolVariant v : PoolVariant.values()) {
|
||||
if (v == PoolVariant.CREATIVE) {
|
||||
// Special case to have mana water layer
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, "inventory_creative"));
|
||||
ModelLoader.setCustomModelResourceLocation(item, v.ordinal(), new ModelResourceLocation(name, "inventory_creative"));
|
||||
} else {
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, "variant=" + v.getName()));
|
||||
ModelLoader.setCustomModelResourceLocation(item, v.ordinal(), new ModelResourceLocation(name, "variant=" + v.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static <T extends Enum<T> & IStringSerializable> void registerVariantsDefaulted(Block b, Class<T> enumclazz, String variantHeader) {
|
||||
Item item = Item.getItemFromBlock(b);
|
||||
for (T e : enumclazz.getEnumConstants()) {
|
||||
@@ -961,4 +1099,20 @@ 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,15 @@
|
||||
*/
|
||||
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;
|
||||
import net.minecraft.world.World;
|
||||
@@ -51,11 +49,15 @@ public final class MultiblockRenderHandler {
|
||||
public static int dimension;
|
||||
|
||||
static {
|
||||
//todo 1.8 remove when fixed by forge
|
||||
// todo 1.8.8 temporary shim, because cannot renderBlockBrightness directly, see MinecraftForge issue 2353
|
||||
IMultiblockRenderHook.renderHooks.put(ModBlocks.pylon, new IMultiblockRenderHook() {
|
||||
@Override
|
||||
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp, float alpha) {
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state);
|
||||
// Steal itemstack model since it has the proper group visibilities configured
|
||||
ItemStack stack = new ItemStack(ModBlocks.pylon, 1, state.getBlock().getMetaFromState(state));
|
||||
IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(stack);
|
||||
GlStateManager.scale(0.65F, 0.65, 0.65F);
|
||||
GlStateManager.translate(0.5F, -0.75F, 0.5F);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, false);
|
||||
}
|
||||
|
||||
@@ -64,6 +66,21 @@ public final class MultiblockRenderHandler {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// TODO also a temporary shim for same reason as above
|
||||
IMultiblockRenderHook.renderHooks.put(ModBlocks.pool, new IMultiblockRenderHook() {
|
||||
@Override
|
||||
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp, float alpha) {
|
||||
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
|
||||
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(ModBlocks.pool.getDefaultState());
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, ModBlocks.pool.getDefaultState(), 1.0F, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsTranslate(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void setMultiblock(MultiblockSet set) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -34,16 +34,12 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSettings.GameType;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.item.IExtendedPlayerController;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook;
|
||||
import vazkii.botania.api.lexicon.multiblock.Multiblock;
|
||||
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
|
||||
import vazkii.botania.api.lexicon.multiblock.component.AnyComponent;
|
||||
import vazkii.botania.api.render.SpecialFlowerModel;
|
||||
import vazkii.botania.api.wiki.IWikiProvider;
|
||||
import vazkii.botania.api.wiki.WikiHooks;
|
||||
import vazkii.botania.client.challenge.ModChallenges;
|
||||
@@ -59,7 +55,7 @@ import vazkii.botania.client.core.handler.LightningHandler;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.client.core.handler.MultiblockRenderHandler;
|
||||
import vazkii.botania.client.core.handler.PersistentVariableHelper;
|
||||
import vazkii.botania.client.core.handler.RenderEventHandler;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.handler.SubTileRadiusRenderHandler;
|
||||
import vazkii.botania.client.core.handler.TooltipHandler;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
@@ -76,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;
|
||||
@@ -99,15 +96,12 @@ import vazkii.botania.client.render.tile.RenderTileRedString;
|
||||
import vazkii.botania.client.render.tile.RenderTileRuneAltar;
|
||||
import vazkii.botania.client.render.tile.RenderTileSkullOverride;
|
||||
import vazkii.botania.client.render.tile.RenderTileSparkChanger;
|
||||
import vazkii.botania.client.render.tile.RenderTileSpawnerClaw;
|
||||
import vazkii.botania.client.render.tile.RenderTileSpreader;
|
||||
import vazkii.botania.client.render.tile.RenderTileStarfield;
|
||||
import vazkii.botania.client.render.tile.RenderTileTerraPlate;
|
||||
import vazkii.botania.client.render.tile.RenderTileTeruTeruBozu;
|
||||
import vazkii.botania.client.render.tile.RenderTileTinyPotato;
|
||||
import vazkii.botania.client.render.world.SkyblockRenderEvents;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileAlfPortal;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
import vazkii.botania.common.block.tile.TileAvatar;
|
||||
@@ -123,7 +117,6 @@ import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
import vazkii.botania.common.block.tile.TilePylon;
|
||||
import vazkii.botania.common.block.tile.TileRuneAltar;
|
||||
import vazkii.botania.common.block.tile.TileSparkChanger;
|
||||
import vazkii.botania.common.block.tile.TileSpawnerClaw;
|
||||
import vazkii.botania.common.block.tile.TileStarfield;
|
||||
import vazkii.botania.common.block.tile.TileTerraPlate;
|
||||
import vazkii.botania.common.block.tile.TileTeruTeruBozu;
|
||||
@@ -160,7 +153,6 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
@@ -186,14 +178,17 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
super.preInit(event);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(RenderEventHandler.INSTANCE);
|
||||
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());
|
||||
@@ -222,7 +217,6 @@ public class ClientProxy extends CommonProxy {
|
||||
dootDoot = true;
|
||||
}
|
||||
|
||||
initRenderers();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -232,65 +226,6 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
private void initRenderers() {
|
||||
// LibRenderIDs.idAltar = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idSpecialFlower = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idSpreader = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idPool = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idPylon = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idMiniIsland = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idTinyPotato = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idSpawnerClaw = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idBrewery = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idCorporeaIndex = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idPump = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idDoubleFlower = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idCorporeaCrystalCybe = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idIncensePlate = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idHourglass = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idCocoon = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idLightRelay = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idBellows = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idTeruTeruBozu = RenderingRegistry.getNextAvailableRenderId();
|
||||
// LibRenderIDs.idAvatar = RenderingRegistry.getNextAvailableRenderId();
|
||||
//
|
||||
// RenderSpecialFlower specialFlowerRender = new RenderSpecialFlower(LibRenderIDs.idSpecialFlower);
|
||||
// RenderingRegistry.registerBlockHandler(new RenderAltar());
|
||||
// RenderingRegistry.registerBlockHandler(specialFlowerRender);
|
||||
// RenderingRegistry.registerBlockHandler(new RenderSpreader());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderPool());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderPylon());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderFloatingFlower());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderTinyPotato());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderSpawnerClaw());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderBrewery());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderCorporeaIndex());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderPump());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderDoubleFlower());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderCorporeaCrystalCube());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderIncensePlate());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderHourglass());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderCocoon());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderBellows());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderTeruTeruBozu());
|
||||
// RenderingRegistry.registerBlockHandler(new RenderAvatar());
|
||||
|
||||
// IMultiblockRenderHook.renderHooks.put(ModBlocks.flower, specialFlowerRender);
|
||||
// IMultiblockRenderHook.renderHooks.put(ModBlocks.shinyFlower, specialFlowerRender);
|
||||
|
||||
// RenderTransparentItem renderTransparentItem = new RenderTransparentItem();
|
||||
// RenderFloatingFlowerItem renderFloatingFlower = new RenderFloatingFlowerItem();
|
||||
// RenderBow renderBow = new RenderBow();
|
||||
//
|
||||
// MinecraftForgeClient.registerItemRenderer(ModItems.lens, new RenderLens());
|
||||
// if(ConfigHandler.lexicon3dModel)
|
||||
// MinecraftForgeClient.registerItemRenderer(ModItems.lexicon, new RenderLexicon());
|
||||
// MinecraftForgeClient.registerItemRenderer(ModItems.glassPick, renderTransparentItem);
|
||||
// MinecraftForgeClient.registerItemRenderer(ModItems.spark, renderTransparentItem);
|
||||
// MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.floatingFlower), renderFloatingFlower);
|
||||
// MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), renderFloatingFlower);
|
||||
// MinecraftForgeClient.registerItemRenderer(ModItems.livingwoodBow, renderBow);
|
||||
// MinecraftForgeClient.registerItemRenderer(ModItems.crystalBow, renderBow);
|
||||
|
||||
RenderTileFloatingFlower renderTileFloatingFlower = new RenderTileFloatingFlower();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, new RenderTileAltar());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSpreader.class, new RenderTileSpreader());
|
||||
@@ -302,7 +237,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileFloatingFlower.class, renderTileFloatingFlower);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileFloatingSpecialFlower.class, renderTileFloatingFlower);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTinyPotato.class, new RenderTileTinyPotato());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSpawnerClaw.class, new RenderTileSpawnerClaw());
|
||||
// ClientRegistry.bindTileEntitySpecialRenderer(TileSpawnerClaw.class, new RenderTileSpawnerClaw());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileStarfield.class, new RenderTileStarfield());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileBrewery.class, new RenderTileBrewery());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTerraPlate.class, new RenderTileTerraPlate());
|
||||
@@ -317,26 +252,27 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCocoon.class, new RenderTileCocoon());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileLightRelay.class, new RenderTileLightRelay());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileBellows.class, new RenderTileBellows());
|
||||
// todo 1.8.8 awaiting forge issue ClientRegistry.bindTileEntitySpecialRenderer(TileGaiaHead.class, new RenderTileSkullOverride());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileGaiaHead.class, new RenderTileSkullOverride());
|
||||
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");
|
||||
render.addLayer(new ContributorFancinessHandler());
|
||||
@@ -474,7 +410,7 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean noclipEnabled = true;
|
||||
private static boolean noclipEnabled = false;
|
||||
private static boolean corruptSparkle = false;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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;
|
||||
@@ -93,7 +93,7 @@ public class FXWisp extends EntityFX {
|
||||
|
||||
if(!queuedDepthIgnoringRenders.isEmpty()) {
|
||||
GlStateManager.disableDepth();
|
||||
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);
|
||||
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
for(FXWisp wisp : queuedDepthIgnoringRenders)
|
||||
wisp.renderQueued(tessellator, false);
|
||||
tessellator.draw();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* 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.integration.jei;
|
||||
|
||||
import mezz.jei.api.IItemRegistry;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.IRecipeRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.client.integration.jei.brewery.BreweryRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.brewery.BreweryRecipeHandler;
|
||||
import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeHandler;
|
||||
import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeHandler;
|
||||
import vazkii.botania.client.integration.jei.petalapothecary.PetalApothecaryRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.petalapothecary.PetalApothecaryRecipeHandler;
|
||||
import vazkii.botania.client.integration.jei.puredaisy.PureDaisyRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.puredaisy.PureDaisyRecipeHandler;
|
||||
import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeCategory;
|
||||
import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeHandler;
|
||||
|
||||
@JEIPlugin
|
||||
public class JEIBotaniaPlugin implements IModPlugin {
|
||||
|
||||
private IJeiHelpers jeiHelpers;
|
||||
|
||||
@Override
|
||||
public boolean isModLoaded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry) {}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry) {
|
||||
registry.addRecipeCategories(
|
||||
new BreweryRecipeCategory(jeiHelpers.getGuiHelper()),
|
||||
new PureDaisyRecipeCategory(jeiHelpers.getGuiHelper()),
|
||||
new PetalApothecaryRecipeCategory(jeiHelpers.getGuiHelper()),
|
||||
new ElvenTradeRecipeCategory(jeiHelpers.getGuiHelper()),
|
||||
new RunicAltarRecipeCategory(jeiHelpers.getGuiHelper()),
|
||||
new ManaPoolRecipeCategory(jeiHelpers.getGuiHelper())
|
||||
);
|
||||
|
||||
registry.addRecipeHandlers(
|
||||
new BreweryRecipeHandler(),
|
||||
new PureDaisyRecipeHandler(),
|
||||
new PetalApothecaryRecipeHandler(),
|
||||
new ElvenTradeRecipeHandler(),
|
||||
new RunicAltarRecipeHandler(),
|
||||
new ManaPoolRecipeHandler()
|
||||
);
|
||||
|
||||
registry.addRecipes(BotaniaAPI.brewRecipes);
|
||||
registry.addRecipes(BotaniaAPI.pureDaisyRecipes);
|
||||
registry.addRecipes(BotaniaAPI.petalRecipes);
|
||||
registry.addRecipes(BotaniaAPI.elvenTradeRecipes);
|
||||
registry.addRecipes(BotaniaAPI.runeAltarRecipes);
|
||||
registry.addRecipes(BotaniaAPI.manaInfusionRecipes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {}
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* 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.integration.jei.brewery;
|
||||
|
||||
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;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class BreweryRecipeCategory implements IRecipeCategory {
|
||||
|
||||
private final IDrawableStatic background;
|
||||
private final String localizedName;
|
||||
|
||||
public BreweryRecipeCategory(IGuiHelper guiHelper) {
|
||||
ResourceLocation location = new ResourceLocation("botania", "textures/gui/neiBrewery.png");
|
||||
background = guiHelper.createDrawable(location, 0, 0, 166, 65, 0, 0, 0, 0);
|
||||
localizedName = StatCollector.translateToLocal("botania.nei.brewery");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return "botania.brewery";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
if (!(recipeWrapper instanceof BreweryRecipeWrapper))
|
||||
return;
|
||||
BreweryRecipeWrapper wrapper = ((BreweryRecipeWrapper) recipeWrapper);
|
||||
|
||||
List inputs = wrapper.getInputs();
|
||||
|
||||
recipeLayout.getItemStacks().init(0, true, 39, 41);
|
||||
if (inputs.get(0) instanceof ItemStack) {
|
||||
recipeLayout.getItemStacks().set(0, ((ItemStack) inputs.get(0)));
|
||||
} else {
|
||||
recipeLayout.getItemStacks().set(0, ((Collection<ItemStack>) inputs.get(0)));
|
||||
}
|
||||
|
||||
int index = 1, posX = 60;
|
||||
for (Object o : wrapper.getInputs()) {
|
||||
recipeLayout.getItemStacks().init(index, true, posX, 6);
|
||||
if (o instanceof ItemStack) {
|
||||
recipeLayout.getItemStacks().set(index, ((ItemStack) o));
|
||||
} else if (o instanceof Collection) {
|
||||
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) o));
|
||||
}
|
||||
index++;
|
||||
posX += 18;
|
||||
}
|
||||
|
||||
recipeLayout.getItemStacks().init(7, false, 87, 41);
|
||||
recipeLayout.getItemStacks().set(7, wrapper.getOutputs().get(0));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* 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.integration.jei.brewery;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BreweryRecipeHandler implements IRecipeHandler<RecipeBrew> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeBrew> getRecipeClass() {
|
||||
return RecipeBrew.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return "botania.brewery";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeBrew recipe) {
|
||||
return new BreweryRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull RecipeBrew recipe) {
|
||||
return recipe.getInputs().size() <= 6;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* 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.integration.jei.brewery;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
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.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class BreweryRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
private final List input;
|
||||
private final ItemStack output;
|
||||
|
||||
public BreweryRecipeWrapper(RecipeBrew recipeBrew) {
|
||||
ImmutableList.Builder builder = ImmutableList.builder();
|
||||
builder.add(new ItemStack(ModItems.vial));
|
||||
for (Object o : recipeBrew.getInputs()) {
|
||||
if (o instanceof ItemStack) {
|
||||
builder.add(o);
|
||||
}
|
||||
if (o instanceof String) {
|
||||
builder.add(OreDictionary.getOres(((String) o)));
|
||||
}
|
||||
}
|
||||
|
||||
input = builder.build();
|
||||
output = recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() { return ImmutableList.of(); }
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() { return ImmutableList.of(); }
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
|
||||
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* 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.integration.jei.elventrade;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
|
||||
public class ElvenTradeRecipeCategory implements IRecipeCategory {
|
||||
|
||||
private final String localizedName;
|
||||
private final IDrawable background;
|
||||
private final IDrawable overlay;
|
||||
|
||||
public ElvenTradeRecipeCategory(IGuiHelper guiHelper) {
|
||||
localizedName = StatCollector.translateToLocal("botania.nei.elvenTrade");
|
||||
background = guiHelper.createBlankDrawable(145, 95);
|
||||
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/elvenTradeOverlay.png"), 0, 15, 140, 90);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return "botania.elvenTrade";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableBlend();
|
||||
overlay.draw(minecraft, 0, 4);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
minecraft.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
TextureAtlasSprite sprite = MiscellaneousIcons.INSTANCE.alfPortalTex;
|
||||
Tessellator tess = Tessellator.getInstance();
|
||||
WorldRenderer wr = tess.getWorldRenderer();
|
||||
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
int startX = 22;
|
||||
int startY = 25;
|
||||
int stopX = 70;
|
||||
int stopY = 73;
|
||||
wr.pos(startX, startY, 0).tex(sprite.getMinU(), sprite.getMinV()).endVertex();
|
||||
wr.pos(startX, stopY, 0).tex(sprite.getMinU(), sprite.getMaxV()).endVertex();
|
||||
wr.pos(stopX, stopY, 0).tex(sprite.getMaxU(), sprite.getMaxV()).endVertex();
|
||||
wr.pos(stopX, startY, 0).tex(sprite.getMaxU(), sprite.getMinV()).endVertex();
|
||||
tess.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
if (!(recipeWrapper instanceof ElvenTradeRecipeWrapper))
|
||||
return;
|
||||
ElvenTradeRecipeWrapper wrapper = ((ElvenTradeRecipeWrapper) recipeWrapper);
|
||||
|
||||
int index = 0, posX = 42;
|
||||
for (Object o : wrapper.getInputs()) {
|
||||
recipeLayout.getItemStacks().init(index, true, posX, 0);
|
||||
if (o instanceof Collection) {
|
||||
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) o));
|
||||
} else {
|
||||
recipeLayout.getItemStacks().set(index, ((ItemStack) o));
|
||||
}
|
||||
index++;
|
||||
posX += 18;
|
||||
}
|
||||
|
||||
recipeLayout.getItemStacks().init(index, false, 93, 41);
|
||||
recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0));
|
||||
}
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* 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.integration.jei.elventrade;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ElvenTradeRecipeHandler implements IRecipeHandler<RecipeElvenTrade> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeElvenTrade> getRecipeClass() {
|
||||
return RecipeElvenTrade.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return "botania.elvenTrade";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeElvenTrade recipe) {
|
||||
return new ElvenTradeRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull RecipeElvenTrade recipe) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* 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.integration.jei.elventrade;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class ElvenTradeRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
private final List input;
|
||||
private final ItemStack output;
|
||||
|
||||
public ElvenTradeRecipeWrapper(RecipeElvenTrade recipe) {
|
||||
ImmutableList.Builder builder = ImmutableList.builder();
|
||||
for (Object o : recipe.getInputs()) {
|
||||
if (o instanceof ItemStack) {
|
||||
builder.add(o);
|
||||
}
|
||||
if (o instanceof String) {
|
||||
builder.add(OreDictionary.getOres(((String) o)));
|
||||
}
|
||||
}
|
||||
input = builder.build();
|
||||
output = recipe.getOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
|
||||
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 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.integration.jei.manapool;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
|
||||
public class ManaPoolRecipeCategory implements IRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
private final String localizedName;
|
||||
private final IDrawable overlay;
|
||||
|
||||
public ManaPoolRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createBlankDrawable(168, 64);
|
||||
localizedName = StatCollector.translateToLocal("botania.nei.manaPool");
|
||||
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"),
|
||||
0, 0, 64, 46);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return "botania.manaPool";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableBlend();
|
||||
overlay.draw(minecraft, 48, 0);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
if (!(recipeWrapper instanceof ManaPoolRecipeWrapper))
|
||||
return;
|
||||
|
||||
ManaPoolRecipeWrapper wrapper = ((ManaPoolRecipeWrapper) recipeWrapper);
|
||||
int index = 0;
|
||||
|
||||
recipeLayout.getItemStacks().init(index, true, 40, 12);
|
||||
if (wrapper.getInputs().get(0) instanceof Collection) {
|
||||
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) wrapper.getInputs().get(0)));
|
||||
} else {
|
||||
recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(0)));
|
||||
}
|
||||
|
||||
index++;
|
||||
|
||||
if (wrapper.getInputs().size() > 1) {
|
||||
// Has catalyst
|
||||
recipeLayout.getItemStacks().init(index, true, 20, 12);
|
||||
recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(1)));
|
||||
index++;
|
||||
}
|
||||
|
||||
recipeLayout.getItemStacks().init(index, true, 70, 12);
|
||||
recipeLayout.getItemStacks().set(index, new ItemStack(ModBlocks.pool, 1, 0));
|
||||
index++;
|
||||
|
||||
recipeLayout.getItemStacks().init(index, false, 99, 12);
|
||||
if (wrapper.getOutputs().get(0) instanceof Collection) {
|
||||
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) wrapper.getOutputs().get(0)));
|
||||
} else {
|
||||
recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getOutputs().get(0)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* 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.integration.jei.manapool;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ManaPoolRecipeHandler implements IRecipeHandler<RecipeManaInfusion> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipeManaInfusion> getRecipeClass() {
|
||||
return RecipeManaInfusion.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return "botania.manaPool";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeManaInfusion recipe) {
|
||||
return new ManaPoolRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull RecipeManaInfusion recipe) {
|
||||
return recipe.getManaToConsume() <= 100000;
|
||||
}
|
||||
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 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.integration.jei.manapool;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class ManaPoolRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
private final List input;
|
||||
private final ItemStack output;
|
||||
private final int mana;
|
||||
|
||||
public ManaPoolRecipeWrapper(RecipeManaInfusion recipe) {
|
||||
ImmutableList.Builder builder = ImmutableList.builder();
|
||||
|
||||
if (recipe.getInput() instanceof ItemStack) {
|
||||
builder.add(recipe.getInput());
|
||||
} else if (recipe.getInput() instanceof String) {
|
||||
builder.add(OreDictionary.getOres(((String) recipe.getInput())));
|
||||
}
|
||||
|
||||
if (recipe.isAlchemy()) {
|
||||
builder.add(new ItemStack(ModBlocks.alchemyCatalyst));
|
||||
} else if (recipe.isConjuration()) {
|
||||
builder.add(new ItemStack(ModBlocks.conjurationCatalyst));
|
||||
}
|
||||
|
||||
input = builder.build();
|
||||
output = recipe.getOutput();
|
||||
mana = recipe.getManaToConsume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
GlStateManager.enableAlpha();
|
||||
HUDHandler.renderManaBar(28, 50, 0x0000FF, 0.75F, mana, TilePool.MAX_MANA / 10);
|
||||
GlStateManager.disableAlpha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
|
||||
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* 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.integration.jei.petalapothecary;
|
||||
|
||||
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;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.*;
|
||||
import java.util.Collection;
|
||||
|
||||
public class PetalApothecaryRecipeCategory implements IRecipeCategory {
|
||||
|
||||
private final IDrawableStatic background;
|
||||
private final String localizedName;
|
||||
private final IDrawableStatic overlay;
|
||||
|
||||
public PetalApothecaryRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createBlankDrawable(150, 110);
|
||||
localizedName = StatCollector.translateToLocal("botania.nei.petalApothecary");
|
||||
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"),
|
||||
0, 0, 150, 110);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return "botania.petals";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableBlend();
|
||||
overlay.draw(minecraft);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
if (!(recipeWrapper instanceof PetalApothecaryRecipeWrapper))
|
||||
return;
|
||||
PetalApothecaryRecipeWrapper wrapper = ((PetalApothecaryRecipeWrapper) recipeWrapper);
|
||||
|
||||
recipeLayout.getItemStacks().init(0, true, 64, 52);
|
||||
recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.altar));
|
||||
|
||||
int index = 1;
|
||||
double angleBetweenEach = 360.0 / wrapper.getInputs().size();
|
||||
Point point = new Point(64, 20), center = new Point(64, 52);
|
||||
|
||||
for (Object o : wrapper.getInputs()) {
|
||||
recipeLayout.getItemStacks().init(index, true, point.x, point.y);
|
||||
if (o instanceof Collection) {
|
||||
recipeLayout.getItemStacks().set(index, ((Collection<ItemStack>) o));
|
||||
}
|
||||
if (o instanceof ItemStack) {
|
||||
recipeLayout.getItemStacks().set(index, ((ItemStack) o));
|
||||
}
|
||||
index += 1;
|
||||
point = rotatePointAbout(point, center, angleBetweenEach);
|
||||
}
|
||||
|
||||
recipeLayout.getItemStacks().init(index, false, 103, 17);
|
||||
recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0));
|
||||
}
|
||||
|
||||
private Point rotatePointAbout(Point in, Point about, double degrees) {
|
||||
double rad = degrees * Math.PI / 180.0;
|
||||
double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x;
|
||||
double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y;
|
||||
return new Point(((int) newX), ((int) newY));
|
||||
}
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* 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.integration.jei.petalapothecary;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class PetalApothecaryRecipeHandler implements IRecipeHandler<RecipePetals> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<RecipePetals> getRecipeClass() {
|
||||
return RecipePetals.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return "botania.petals";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePetals recipe) {
|
||||
return new PetalApothecaryRecipeWrapper(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull RecipePetals recipe) {
|
||||
return recipe.getInputs().size() <= 16;
|
||||
}
|
||||
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* 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.integration.jei.petalapothecary;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class PetalApothecaryRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
private final List input;
|
||||
private final ItemStack output;
|
||||
|
||||
public PetalApothecaryRecipeWrapper(RecipePetals recipe) {
|
||||
ImmutableList.Builder builder = ImmutableList.builder();
|
||||
for (Object o : recipe.getInputs()) {
|
||||
if (o instanceof ItemStack) {
|
||||
builder.add(o);
|
||||
}
|
||||
if (o instanceof String) {
|
||||
builder.add(OreDictionary.getOres(((String) o)));
|
||||
}
|
||||
}
|
||||
input = builder.build();
|
||||
output = recipe.getOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return ImmutableList.of(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {}
|
||||
|
||||
}
|
||||
Loaded 100 of 558 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user