mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 22:34:08 +00:00
Compare commits
35
Commits
v0.2-alpha
...
v0.3-alpha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1aa50b532 | ||
|
|
972943a9ac | ||
|
|
6374b01762 | ||
|
|
a4a77fb20f | ||
|
|
3a54166954 | ||
|
|
bf55ee4a60 | ||
|
|
68ea0b213e | ||
|
|
6b66163958 | ||
|
|
c8517f565b | ||
|
|
8268c79353 | ||
|
|
c00bb80529 | ||
|
|
cd77b41d31 | ||
|
|
20b5743221 | ||
|
|
e58eb1b345 | ||
|
|
064fd20edb | ||
|
|
85102dea89 | ||
|
|
baf14c361b | ||
|
|
3b7d7628cf | ||
|
|
8155dc3059 | ||
|
|
0494c0eba2 | ||
|
|
12dfecb8ac | ||
|
|
92aaa9f70a | ||
|
|
929860f8fa | ||
|
|
383cd059cc | ||
|
|
b108af404f | ||
|
|
d7f94bfc00 | ||
|
|
69eac1f12e | ||
|
|
0cd4722c1c | ||
|
|
e89322083d | ||
|
|
f9ce3676e1 | ||
|
|
17ddae20af | ||
|
|
124f8bb173 | ||
|
|
820c042f40 | ||
|
|
0f9bc9fc53 | ||
|
|
9036e24365 |
No files matched your search
@@ -10,7 +10,6 @@ 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 --
|
||||
|
||||
+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
|
||||
@@ -1,11 +1,13 @@
|
||||
package vazkii.botania.api;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -14,15 +16,14 @@ import java.util.Map;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final class BotaniaAPIClient {
|
||||
|
||||
public static final Map<String, ModelResourceLocation> queuedBlockModels = Maps.newHashMap();
|
||||
public static final Map<String, ModelResourceLocation> queuedItemModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> queuedBlockModels = Maps.newHashMap();
|
||||
private static final Map<String, ModelResourceLocation> queuedItemModels = 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
|
||||
* todo 1.8.8 move this elsewhere or otherwise make it fit better with the rest of the subtile registration process
|
||||
*
|
||||
* @param subTileName The String ID of the subtile
|
||||
* @param model A path to a blockstate json and variant to be used for this subtile
|
||||
@@ -38,7 +39,6 @@ public final class BotaniaAPIClient {
|
||||
* 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
|
||||
* todo 1.8.8 move this elsewhere or otherwise make it fit better with the rest of the subtile registration process
|
||||
*
|
||||
* @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"
|
||||
@@ -56,6 +56,20 @@ public final class BotaniaAPIClient {
|
||||
registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable view of the registered subtile block model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileBlockModels() {
|
||||
return Collections.unmodifiableMap(queuedBlockModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An immutable view of the registered subtile item model map
|
||||
*/
|
||||
public static Map<String, ModelResourceLocation> getRegisteredSubtileItemModels() {
|
||||
return Collections.unmodifiableMap(queuedItemModels);
|
||||
}
|
||||
|
||||
private BotaniaAPIClient() {}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ 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;
|
||||
@@ -27,6 +28,8 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
|
||||
@@ -134,13 +137,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
|
||||
|
||||
@@ -15,6 +15,7 @@ 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 +86,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();
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ 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 +95,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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -17,16 +17,22 @@ 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.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.model.ISmartItemModel;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||
@@ -97,10 +103,18 @@ 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.ModItems;
|
||||
import vazkii.botania.common.item.brew.ItemBrewBase;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing;
|
||||
@@ -117,9 +131,7 @@ 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));
|
||||
@@ -179,9 +191,9 @@ public final class ModelHandler {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
if (ItemSpawnerMover.hasData(stack)) {
|
||||
return new ModelResourceLocation("botania:spawnerMover", "inventory");
|
||||
} else {
|
||||
return new ModelResourceLocation("botania:spawnerMoverFull", "inventory");
|
||||
} else {
|
||||
return new ModelResourceLocation("botania:spawnerMover", "inventory");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -405,10 +417,15 @@ public final class ModelHandler {
|
||||
registerItemModel(ModBlocks.root);
|
||||
registerItemModel(ModBlocks.cacophonium);
|
||||
registerItemModel(ModBlocks.tinyPotato);
|
||||
registerItemModel(ModBlocks.spawnerClaw);
|
||||
registerItemModel(ModBlocks.turntable);
|
||||
registerItemModel(ModBlocks.manaFlame);
|
||||
registerItemModel(ModBlocks.incensePlate);
|
||||
|
||||
// Register all metas to variant inventory, so the smartmodel can take over from there. See RenderEventHandler
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.pylon), PylonVariant.values().length);
|
||||
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.floatingFlower), EnumDyeColor.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);
|
||||
@@ -417,7 +434,6 @@ public final class ModelHandler {
|
||||
// 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(ModBlocks.forestDrum, DrumVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.livingrock, LivingRockVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.livingwood, LivingWoodVariant.class, "variant");
|
||||
@@ -554,7 +570,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);
|
||||
@@ -581,9 +598,31 @@ public final class ModelHandler {
|
||||
// Only for models that absolutely can't be converted to JSON. Use VERY sparingly
|
||||
private static void registerTESRItems() {
|
||||
registerItemModel(ModBlocks.corporeaCrystalCube);
|
||||
registerItemModel(ModBlocks.corporeaIndex);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.corporeaCrystalCube), 0, TileCorporeaCrystalCube.class);
|
||||
|
||||
registerItemModel(ModBlocks.corporeaIndex);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.corporeaIndex), 0, TileCorporeaIndex.class);
|
||||
|
||||
registerItemModel(ModBlocks.avatar);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.avatar), 0, TileAvatar.class);
|
||||
|
||||
registerItemModel(ModBlocks.teruTeruBozu);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.teruTeruBozu), 0, TileTeruTeruBozu.class);
|
||||
|
||||
registerItemModel(ModBlocks.brewery);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.brewery), 0, TileBrewery.class);
|
||||
|
||||
registerItemModel(ModItems.gaiaHead);
|
||||
ForgeHooksClient.registerTESRItemStack(ModItems.gaiaHead, 0, TileGaiaHead.class);
|
||||
|
||||
registerItemModel(ModBlocks.bellows);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.bellows), 0, TileBellows.class);
|
||||
|
||||
registerItemModel(ModBlocks.pump);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.pump), 0, TilePump.class);
|
||||
|
||||
registerItemModel(ModBlocks.hourglass);
|
||||
ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(ModBlocks.hourglass), 0, TileHourglass.class);
|
||||
}
|
||||
|
||||
private static void registerManaResources() {
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.model.FloatingFlowerModel;
|
||||
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;
|
||||
@@ -65,11 +66,13 @@ 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());
|
||||
}
|
||||
|
||||
@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");
|
||||
|
||||
@@ -110,6 +110,7 @@ import vazkii.botania.common.block.tile.TileCocoon;
|
||||
import vazkii.botania.common.block.tile.TileEnchanter;
|
||||
import vazkii.botania.common.block.tile.TileFloatingFlower;
|
||||
import vazkii.botania.common.block.tile.TileFloatingSpecialFlower;
|
||||
import vazkii.botania.common.block.tile.TileGaiaHead;
|
||||
import vazkii.botania.common.block.tile.TileHourglass;
|
||||
import vazkii.botania.common.block.tile.TileIncensePlate;
|
||||
import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
@@ -224,65 +225,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());
|
||||
@@ -294,7 +236,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());
|
||||
@@ -309,7 +251,7 @@ 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());
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
|
||||
return getModel(islandType, identifier);
|
||||
}
|
||||
|
||||
// Get the model for this islandtype + flower type combination. If it's not cached already, generate it.
|
||||
private CompositeBakedModel getModel(IFloatingFlower.IslandType islandType, String identifier) {
|
||||
ModelManager modelManager = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager();
|
||||
|
||||
@@ -177,59 +178,35 @@ public class FloatingFlowerModel implements ISmartItemModel, ISmartBlockModel, I
|
||||
genQuads = genBuilder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getGeneralQuads() {
|
||||
// Forward all to flower model
|
||||
@Override public List<BakedQuad> getGeneralQuads() {
|
||||
return genQuads;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
|
||||
@Override public boolean isAmbientOcclusion() {
|
||||
return base.isAmbientOcclusion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGui3d() {
|
||||
@Override public boolean isGui3d() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
@Override public boolean isBuiltInRenderer() {
|
||||
return base.isBuiltInRenderer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture() {
|
||||
@Override public TextureAtlasSprite getParticleTexture() {
|
||||
return base.getParticleTexture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemCameraTransforms getItemCameraTransforms() {
|
||||
@Override public ItemCameraTransforms getItemCameraTransforms() {
|
||||
return base.getItemCameraTransforms();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getGeneralQuads() { return ImmutableList.of(); }
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isGui3d() { return true; }
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() { return false; }
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture() { return null; }
|
||||
|
||||
@Override
|
||||
public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
|
||||
// Dummy results
|
||||
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
|
||||
@Override public List<BakedQuad> getGeneralQuads() { return ImmutableList.of(); }
|
||||
@Override public boolean isAmbientOcclusion() { return false; }
|
||||
@Override public boolean isGui3d() { return true; }
|
||||
@Override public boolean isBuiltInRenderer() { return false; }
|
||||
@Override public TextureAtlasSprite getParticleTexture() { return null; }
|
||||
@Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
|
||||
|
||||
}
|
||||
@@ -51,13 +51,14 @@ public class ModelBrewery extends ModelBase {
|
||||
float f = 1F / 16F;
|
||||
|
||||
float offset = (float) Math.sin(time / 40) * 0.1F + 0.05F;
|
||||
int plates = render.brewery.getSizeInventory() - 1;
|
||||
boolean hasTile = render.brewery != null;
|
||||
int plates = hasTile ? render.brewery.getSizeInventory() - 1 : 7;
|
||||
float deg = (float) time / 16F;
|
||||
float polerot = -deg * 25F;
|
||||
|
||||
GlStateManager.translate(0F, offset, 0F);
|
||||
GlStateManager.rotate(polerot, 0F, 1F, 0F);
|
||||
if(render.brewery.getStackInSlot(0) != null) {
|
||||
if(hasTile && render.brewery.getStackInSlot(0) != null) {
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(0, -0.45, 0);
|
||||
//GlStateManager.translate(-1F / 8F, -0.5F, 1F / 128F);
|
||||
@@ -80,7 +81,7 @@ public class ModelBrewery extends ModelBase {
|
||||
offset1 = 0F;
|
||||
|
||||
GlStateManager.translate(0F, offset1, 0F);
|
||||
if(render.brewery.getStackInSlot(i + 1) != null) {
|
||||
if(hasTile && render.brewery.getStackInSlot(i + 1) != null) {
|
||||
float rot = Plate.rotateAngleY * 180F / (float) Math.PI;
|
||||
float transX = 0.3125F;
|
||||
float transY = 1.06F;
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
@@ -63,32 +64,31 @@ public class ModelPylon implements IPylonModel {
|
||||
|
||||
public ModelPylon() {
|
||||
try {
|
||||
// Load the OBJ
|
||||
OBJModel model = ((OBJModel) OBJLoader.instance.loadModel(new ResourceLocation("botania:models/block/pylon.obj")));
|
||||
|
||||
// Apply the texture and flip the v's of the model
|
||||
IModel manaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon"))).process(ImmutableMap.of("flip-v", "true"));
|
||||
IModel naturaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon1"))).process(ImmutableMap.of("flip-v", "true"));
|
||||
IModel gaiaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon2"))).process(ImmutableMap.of("flip-v", "true"));
|
||||
|
||||
// Turn off all except "Crystal"
|
||||
manaCrystal = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
|
||||
"Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
naturaCrystal = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
|
||||
"Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
gaiaCrystal = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
|
||||
"Ring_Panel03", "Ring_Panel04", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
// All groups are off by default
|
||||
// (OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group)
|
||||
|
||||
// Turn off all except "Crystal_Ring", and "Ring_Panel0x"
|
||||
manaRingsAndPanes = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
naturaRingsAndPanes = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
gaiaRingsAndPanes = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
// Turn on "Crystal"
|
||||
manaCrystal = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
naturaCrystal = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
gaiaCrystal = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
|
||||
// Turn off all except "Ring_Gem0x"
|
||||
manaGems = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
|
||||
"Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
naturaGems = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
|
||||
"Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
gaiaGems = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02",
|
||||
"Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
// Turn on "Crystal_Ring", and "Ring_Panel0x"
|
||||
manaRingsAndPanes = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
naturaRingsAndPanes = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
gaiaRingsAndPanes = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
|
||||
// Turn on "Ring_Gem0x"
|
||||
manaGems = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
naturaGems = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
gaiaGems = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
|
||||
} catch (IOException e) {
|
||||
throw new ReportedException(new CrashReport("Error making pylon submodels for TESR!", e));
|
||||
}
|
||||
@@ -105,20 +105,24 @@ public class ModelPylon implements IPylonModel {
|
||||
|
||||
@Override
|
||||
public void renderRing(PylonVariant variant) {
|
||||
GlStateManager.disableLighting();
|
||||
switch (variant) {
|
||||
case MANA: renderModel(manaRingsAndPanes); break;
|
||||
case NATURA: renderModel(naturaRingsAndPanes); break;
|
||||
case GAIA: renderModel(gaiaRingsAndPanes); break;
|
||||
}
|
||||
GlStateManager.enableLighting();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderGems(PylonVariant variant) {
|
||||
GlStateManager.disableLighting();
|
||||
switch (variant) {
|
||||
case MANA: renderModel(manaGems); break;
|
||||
case NATURA: renderModel(naturaGems); break;
|
||||
case GAIA: renderModel(gaiaGems); break;
|
||||
}
|
||||
GlStateManager.enableLighting();
|
||||
}
|
||||
|
||||
private void renderModel(IFlexibleBakedModel model)
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.Attributes;
|
||||
import net.minecraftforge.client.model.IFlexibleBakedModel;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.client.model.ISmartItemModel;
|
||||
import net.minecraftforge.client.model.TRSRTransformation;
|
||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.http.annotation.Immutable;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class PylonItemModel implements ISmartItemModel {
|
||||
|
||||
private IBakedModel mana;
|
||||
private IBakedModel natura;
|
||||
private IBakedModel gaia;
|
||||
private boolean cached = false;
|
||||
|
||||
@Override
|
||||
public IBakedModel handleItemState(ItemStack stack) {
|
||||
if (!cached) {
|
||||
cacheModels();
|
||||
}
|
||||
|
||||
switch (stack.getItemDamage()) {
|
||||
case 2: return gaia;
|
||||
case 1: return natura;
|
||||
case 0: return mana;
|
||||
default:
|
||||
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
|
||||
}
|
||||
}
|
||||
|
||||
private void cacheModels() {
|
||||
// Load the OBJ
|
||||
OBJModel model = null;
|
||||
try {
|
||||
model = ((OBJModel) OBJLoader.instance.loadModel(new ResourceLocation("botania:models/block/pylon.obj")));
|
||||
} catch (IOException e) {
|
||||
FMLLog.log(Level.ERROR, "[Botania]: Error loading pylon item model, substituting missing model");
|
||||
mana = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
|
||||
natura = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
|
||||
gaia = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
|
||||
cached = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Apply the texture and flip the v's of the model
|
||||
IModel manaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon"))).process(ImmutableMap.of("flip-v", "true"));
|
||||
IModel naturaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon1"))).process(ImmutableMap.of("flip-v", "true"));
|
||||
IModel gaiaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon2"))).process(ImmutableMap.of("flip-v", "true"));
|
||||
|
||||
// All groups are off by default
|
||||
// OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group
|
||||
|
||||
final Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() {
|
||||
@Override
|
||||
public TextureAtlasSprite apply(ResourceLocation input) {
|
||||
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(input.toString());
|
||||
}
|
||||
};
|
||||
|
||||
ImmutableList<String> standardGroups = ImmutableList.of("Crystal", "Crystal_Ring",
|
||||
"Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04",
|
||||
"Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04");
|
||||
|
||||
mana = new PerspectiveWrapper(manaModel.bake(new OBJModel.OBJState(standardGroups, false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter));
|
||||
// Natura model is just the crystal
|
||||
natura = new PerspectiveWrapper(naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter));
|
||||
gaia = new PerspectiveWrapper(gaiaModel.bake(new OBJModel.OBJState(standardGroups, false), Attributes.DEFAULT_BAKED_FORMAT, textureGetter));
|
||||
cached = true;
|
||||
}
|
||||
|
||||
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return ImmutableList.of(); }
|
||||
@Override public List<BakedQuad> getGeneralQuads() { return ImmutableList.of(); }
|
||||
@Override public boolean isAmbientOcclusion() { return false; }
|
||||
@Override public boolean isGui3d() { return true; }
|
||||
@Override public boolean isBuiltInRenderer() { return false; }
|
||||
@Override public TextureAtlasSprite getParticleTexture() { return null; }
|
||||
@Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
|
||||
|
||||
// Wrapper to transform the model before rendering it, so it looks right in the inventory
|
||||
private class PerspectiveWrapper implements IPerspectiveAwareModel {
|
||||
|
||||
private final IFlexibleBakedModel parent;
|
||||
|
||||
public PerspectiveWrapper(IBakedModel pylonModel) {
|
||||
this.parent = new IFlexibleBakedModel.Wrapper(pylonModel, Attributes.DEFAULT_BAKED_FORMAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<? extends IFlexibleBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
|
||||
switch(cameraTransformType) {
|
||||
case FIRST_PERSON: return ImmutablePair.of(parent, new TRSRTransformation(new Vector3f(0, 0, 0.4F), null, new Vector3f(0.75F, 0.75F, 0.75F), null).getMatrix());
|
||||
case GUI: return ImmutablePair.of(parent, TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0.5F, 0.1F, 0), null, null, null)).getMatrix());
|
||||
case THIRD_PERSON: return ImmutablePair.of(parent, new TRSRTransformation(new Vector3f(0, -0.2F, 0.5F), null, null, null).getMatrix());
|
||||
default: return ImmutablePair.of(parent, TRSRTransformation.identity().getMatrix());
|
||||
}
|
||||
}
|
||||
|
||||
@Override public VertexFormat getFormat() { return Attributes.DEFAULT_BAKED_FORMAT; }
|
||||
@Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { return parent.getFaceQuads(p_177551_1_); }
|
||||
@Override public List<BakedQuad> getGeneralQuads() { return parent.getGeneralQuads(); }
|
||||
@Override public boolean isAmbientOcclusion() { return parent.isAmbientOcclusion(); }
|
||||
@Override public boolean isGui3d() { return parent.isGui3d(); }
|
||||
@Override public boolean isBuiltInRenderer() { return parent.isBuiltInRenderer(); }
|
||||
@Override public TextureAtlasSprite getParticleTexture() { return parent.getParticleTexture(); }
|
||||
@Override public ItemCameraTransforms getItemCameraTransforms() { return parent.getItemCameraTransforms(); }
|
||||
}
|
||||
}
|
||||
@@ -108,10 +108,10 @@ public class SpecialFlowerModel implements IModelCustomData {
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.queuedBlockModels.entrySet()) {
|
||||
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileBlockModels().entrySet()) {
|
||||
blockBuilder.put(Optional.of(e.getKey()), e.getValue());
|
||||
}
|
||||
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.queuedItemModels.entrySet()) {
|
||||
for (Map.Entry<String, ModelResourceLocation> e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) {
|
||||
itemBuilder.put(Optional.of(e.getKey()), e.getValue());
|
||||
}
|
||||
|
||||
|
||||
@@ -99,12 +99,14 @@ public class RenderLexicon implements IItemRenderer {
|
||||
font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover0"), 0, 0, 0x79ff92);
|
||||
|
||||
GlStateManager.translate(0F, 10F, 0F);
|
||||
font.drawString(EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("botaniamisc.lexiconcover1"), 0, 0, 0x79ff92);
|
||||
font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover1"), 0, 0, 0x79ff92);
|
||||
|
||||
GlStateManager.translate(0F, 50F, 0F);
|
||||
font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover2"), 0, 0, 0x79ff92);
|
||||
|
||||
GlStateManager.translate(0F, 10F, 0F);
|
||||
font.drawString(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("botaniamisc.lexiconcover3"), 0, 0, 0x79ff92);
|
||||
font.drawString(EnumChatFormatting.UNDERLINE + "" + EnumChatFormatting.ITALIC + StatCollector.translateToLocal("botaniamisc.lexiconcover3"), 0, 0, 0x79ff92);
|
||||
|
||||
if(bevo || saice) {
|
||||
GlStateManager.translate(0F, 10F, 0F);
|
||||
font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover" + (bevo ? 4 : 5)), 0, 0, 0x79ff92);
|
||||
|
||||
@@ -21,18 +21,26 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.AlfPortalState;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.RenderEventHandler;
|
||||
import vazkii.botania.common.block.BlockAlfPortal;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileAlfPortal;
|
||||
|
||||
public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
|
||||
public class RenderTileAlfPortal extends TileEntitySpecialRenderer<TileAlfPortal> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
TileAlfPortal portal = (TileAlfPortal) tileentity;
|
||||
int meta = portal.getBlockMetadata();
|
||||
if(meta == 0)
|
||||
public void renderTileEntityAt(TileAlfPortal portal, double d0, double d1, double d2, float f, int digProgress) {
|
||||
AlfPortalState state;
|
||||
if (portal.getWorld().getBlockState(portal.getPos()).getBlock() != ModBlocks.alfPortal) {
|
||||
state = AlfPortalState.OFF;
|
||||
} else {
|
||||
state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
}
|
||||
|
||||
if(state == AlfPortalState.OFF)
|
||||
return;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -49,7 +57,7 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
|
||||
if(meta == 2) {
|
||||
if(state == AlfPortalState.ON_X) {
|
||||
GlStateManager.translate(1.25F, 0F, 1.75F);
|
||||
GlStateManager.rotate(90F, 0F, 1F, 0F);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelAltar;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
|
||||
public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
public class RenderTileAltar extends TileEntitySpecialRenderer<TileAltar> {
|
||||
|
||||
private static final ResourceLocation[] textures = new ResourceLocation[] {
|
||||
new ResourceLocation(LibResources.MODEL_ALTAR),
|
||||
@@ -58,9 +58,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
public static int forceMeta = -1;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
TileAltar altar = (TileAltar) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -33,7 +33,7 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelAvatar;
|
||||
import vazkii.botania.common.block.tile.TileAvatar;
|
||||
|
||||
public class RenderTileAvatar extends TileEntitySpecialRenderer {
|
||||
public class RenderTileAvatar extends TileEntitySpecialRenderer<TileAvatar> {
|
||||
|
||||
private static final float[] ROTATIONS = new float[] {
|
||||
180F, 0F, 90F, 270F
|
||||
@@ -43,22 +43,28 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer {
|
||||
private static final ModelAvatar model = new ModelAvatar();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
TileAvatar avatar = (TileAvatar) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileAvatar avatar, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
int meta = avatar.getWorld() != null ? avatar.getBlockMetadata() : 0;
|
||||
int meta = avatar != null && avatar.getWorld() != null ? avatar.getBlockMetadata() : 0;
|
||||
|
||||
GlStateManager.translate(0.5F, 1.6F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F);
|
||||
model.render();
|
||||
|
||||
if (avatar == null) {
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.popMatrix();
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack stack = avatar.getStackInSlot(0);
|
||||
if(stack != null) {
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelBellows;
|
||||
import vazkii.botania.common.block.tile.mana.TileBellows;
|
||||
|
||||
public class RenderTileBellows extends TileEntitySpecialRenderer {
|
||||
public class RenderTileBellows extends TileEntitySpecialRenderer<TileBellows> {
|
||||
|
||||
private static final float[] ROTATIONS = new float[] {
|
||||
180F, 0F, 90F, 270F
|
||||
@@ -33,21 +33,19 @@ public class RenderTileBellows extends TileEntitySpecialRenderer {
|
||||
private static final ModelBellows model = new ModelBellows();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
TileBellows bellows = (TileBellows) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileBellows bellows, double d0, double d1, double d2, float f, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
int meta = bellows.getWorld() != null ? bellows.getBlockMetadata() : 0;
|
||||
int meta = bellows != null && bellows.getWorld() != null ? bellows.getBlockMetadata() : 0;
|
||||
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F);
|
||||
model.render(Math.max(0.1F, 1F - (bellows.movePos + bellows.moving * f + 0.1F)));
|
||||
model.render(Math.max(0.1F, 1F - (bellows == null ? 0 : (bellows.movePos + bellows.moving * f + 0.1F))));
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -35,7 +35,7 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelBrewery;
|
||||
import vazkii.botania.common.block.tile.TileBrewery;
|
||||
|
||||
public class RenderTileBrewery extends TileEntitySpecialRenderer {
|
||||
public class RenderTileBrewery extends TileEntitySpecialRenderer<TileBrewery> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_BREWERY);
|
||||
ModelBrewery model = new ModelBrewery();
|
||||
@@ -43,8 +43,8 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer {
|
||||
public static boolean rotate = true;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
brewery = (TileBrewery) tileentity;
|
||||
public void renderTileEntityAt(TileBrewery brewery, double d0, double d1, double d2, float f, int digProgress) {
|
||||
this.brewery = brewery;
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -23,15 +23,13 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelCocoon;
|
||||
import vazkii.botania.common.block.tile.TileCocoon;
|
||||
|
||||
public class RenderTileCocoon extends TileEntitySpecialRenderer {
|
||||
public class RenderTileCocoon extends TileEntitySpecialRenderer<TileCocoon> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_COCOON);
|
||||
ModelCocoon model = new ModelCocoon();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
TileCocoon cocoon = (TileCocoon) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileCocoon cocoon, double d0, double d1, double d2, float f, int digProgress) {
|
||||
float rot = 0F;
|
||||
float modval = 60F - (float) cocoon.timePassed / (float) TileCocoon.TOTAL_TIME * 30F;
|
||||
if(cocoon.timePassed % modval < 10) {
|
||||
|
||||
@@ -32,16 +32,14 @@ import vazkii.botania.client.model.ModelCrystalCube;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer {
|
||||
public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer<TileCorporeaCrystalCube> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_CRYSTAL_CUBE);
|
||||
ModelCrystalCube model = new ModelCrystalCube();
|
||||
EntityItem entity = null;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
TileCorporeaCrystalCube cube = (TileCorporeaCrystalCube) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileCorporeaCrystalCube cube, double d0, double d1, double d2, float f, int digProgress) {
|
||||
ItemStack stack = null;
|
||||
if (cube != null) {
|
||||
if(entity == null)
|
||||
@@ -53,7 +51,7 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
double time = ClientTickHandler.ticksInGame + f;
|
||||
double worldTicks = tileentity == null || tileentity.getWorld() == null ? 0 : time;
|
||||
double worldTicks = cube == null || cube.getWorld() == null ? 0 : time;
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -23,15 +23,14 @@ import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
|
||||
public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer {
|
||||
public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer<TileCorporeaIndex> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_CORPOREA_INDEX);
|
||||
ModelEnderCrystal crystal = new ModelEnderCrystal(0F, false);
|
||||
public static boolean move = true;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partticks, int digProgress) {
|
||||
TileCorporeaIndex index = (TileCorporeaIndex) tile;
|
||||
public void renderTileEntityAt(TileCorporeaIndex index, double x, double y, double z, float partticks, int digProgress) {
|
||||
move = index != null;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -34,13 +34,12 @@ import vazkii.botania.common.block.mana.BlockEnchanter;
|
||||
import vazkii.botania.common.block.tile.TileEnchanter;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class RenderTileEnchanter extends TileEntitySpecialRenderer {
|
||||
public class RenderTileEnchanter extends TileEntitySpecialRenderer<TileEnchanter> {
|
||||
|
||||
EntityItem item;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
TileEnchanter enchanter = (TileEnchanter) tileentity;
|
||||
public void renderTileEntityAt(TileEnchanter enchanter, double d0, double d1, double d2, float f, int digProgress) {
|
||||
float alphaMod = 0F;
|
||||
|
||||
if(enchanter.stage == 2)
|
||||
|
||||
@@ -33,6 +33,7 @@ import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.model.FloatingFlowerModel;
|
||||
import vazkii.botania.client.model.ModelMiniIsland;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
import vazkii.botania.common.block.tile.TileFloatingFlower;
|
||||
|
||||
public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
|
||||
|
||||
|
||||
@@ -26,43 +26,41 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelHourglass;
|
||||
import vazkii.botania.common.block.tile.TileHourglass;
|
||||
|
||||
public class RenderTileHourglass extends TileEntitySpecialRenderer {
|
||||
public class RenderTileHourglass extends TileEntitySpecialRenderer<TileHourglass> {
|
||||
|
||||
ResourceLocation texture = new ResourceLocation(LibResources.MODEL_HOURGLASS);
|
||||
ModelHourglass model = new ModelHourglass();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
TileHourglass hourglass = (TileHourglass) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileHourglass hourglass, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
|
||||
int wtime = tileentity.getWorld() == null ? 0 : ClientTickHandler.ticksInGame;
|
||||
boolean hasWorld = hourglass != null && hourglass.getWorld() != null;
|
||||
int wtime = !hasWorld ? 0 : ClientTickHandler.ticksInGame;
|
||||
if(wtime != 0)
|
||||
wtime += new Random(tileentity.getPos().hashCode()).nextInt(360);
|
||||
wtime += new Random(hourglass.getPos().hashCode()).nextInt(360);
|
||||
|
||||
float time = wtime == 0 ? 0 : wtime + ticks;
|
||||
float x = 0.5F + (float) Math.cos(time * 0.05F) * 0.025F;
|
||||
float y = 0.55F + (float) (Math.sin(time * 0.04F) + 1F) * 0.05F;
|
||||
float z = 0.5F + (float) Math.sin(time * 0.05F) * 0.025F;
|
||||
ItemStack stack = hourglass.getStackInSlot(0);
|
||||
ItemStack stack = hasWorld ? hourglass.getStackInSlot(0) : null;
|
||||
|
||||
float fract1 = stack == null ? 0 : hourglass.timeFraction;
|
||||
float fract2 = stack == null ? 0 : 1F - hourglass.timeFraction;
|
||||
GlStateManager.translate(x, y, z);
|
||||
|
||||
float rot = hourglass.flip ? 180F : 1F;
|
||||
if(hourglass.flipTicks > 0)
|
||||
float rot = hasWorld && hourglass.flip ? 180F : 1F;
|
||||
if(hasWorld && hourglass.flipTicks > 0)
|
||||
rot += (hourglass.flipTicks - ticks) * (180F / 4F);
|
||||
GlStateManager.rotate(rot, 0F, 0F, 1F);
|
||||
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
model.render(fract1, fract2, hourglass.flip, hourglass.getColor());
|
||||
model.render(fract1, fract2, hasWorld && hourglass.flip, hasWorld ? hourglass.getColor() : 0);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelIncensePlate;
|
||||
import vazkii.botania.common.block.tile.TileIncensePlate;
|
||||
|
||||
public class RenderTileIncensePlate extends TileEntitySpecialRenderer {
|
||||
public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncensePlate> {
|
||||
|
||||
private static final float[] ROTATIONS = new float[] {
|
||||
180F, 0F, 90F, 270F
|
||||
@@ -42,9 +42,7 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer {
|
||||
ModelIncensePlate model = new ModelIncensePlate();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
TileIncensePlate plate = (TileIncensePlate) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
EnumFacing facing = plate.getWorld() != null ? plate.getWorld().getBlockState(plate.getPos()).getValue(BotaniaStateProps.CARDINALS) : EnumFacing.SOUTH;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -53,11 +51,11 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer {
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
// Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
|
||||
model.render();
|
||||
// model.render();
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
|
||||
ItemStack stack = plate.getStackInSlot(0);
|
||||
|
||||
@@ -27,11 +27,12 @@ import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.RenderEventHandler;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.common.block.BlockLightRelay;
|
||||
import vazkii.botania.common.block.tile.TileLightRelay;
|
||||
|
||||
public class RenderTileLightRelay extends TileEntitySpecialRenderer {
|
||||
public class RenderTileLightRelay extends TileEntitySpecialRenderer<TileLightRelay> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float pticks, int digProgress) {
|
||||
public void renderTileEntityAt(TileLightRelay tile, double x, double y, double z, float pticks, int digProgress) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
TextureAtlasSprite iicon = tile.getBlockMetadata() > 0 ? RenderEventHandler.INSTANCE.lightRelayWorldIconRed : RenderEventHandler.INSTANCE.lightRelayWorldIcon;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import vazkii.botania.client.model.ModelPool;
|
||||
import vazkii.botania.common.block.mana.BlockPool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
|
||||
public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
public class RenderTilePool extends TileEntitySpecialRenderer<TilePool> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_POOL);
|
||||
private static final ResourceLocation textureInf = new ResourceLocation(LibResources.MODEL_INFINITE_POOL);
|
||||
@@ -49,9 +49,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
public static int forceManaNumber = -1;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
TilePool pool = (TilePool) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TilePool pool, double d0, double d1, double d2, float f, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -60,9 +58,9 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
|
||||
GlStateManager.color(1F, 1F, 1F, a);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
boolean inf = tileentity.getWorld() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1;
|
||||
boolean dil = tileentity.getWorld() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2;
|
||||
boolean fab = tileentity.getWorld() == null ? forceMeta == 3 : tileentity.getBlockMetadata() == 3;
|
||||
boolean inf = pool.getWorld() == null ? forceMeta == 1 : pool.getBlockMetadata() == 1;
|
||||
boolean dil = pool.getWorld() == null ? forceMeta == 2 : pool.getBlockMetadata() == 2;
|
||||
boolean fab = pool.getWorld() == null ? forceMeta == 3 : pool.getBlockMetadata() == 3;
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(inf ? textureInf : dil ? textureDil : texture);
|
||||
|
||||
@@ -70,8 +68,8 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
if(fab) {
|
||||
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
|
||||
if(tileentity != null)
|
||||
time += new Random(tileentity.getPos().hashCode()).nextInt(100000);
|
||||
if(pool != null)
|
||||
time += new Random(pool.getPos().hashCode()).nextInt(100000);
|
||||
|
||||
Color color = Color.getHSBColor(time * 0.005F, 0.6F, 1F);
|
||||
GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255);
|
||||
@@ -84,7 +82,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
model.render();
|
||||
GlStateManager.color(1F, 1F, 1F, a);
|
||||
GL11.glColor4f(1F, 1F, 1F, a); // Use GL11 manually since we call color4ub above, and GlStateManager doesn't know that, so the color leaks
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
|
||||
@@ -25,11 +25,10 @@ import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
//import vazkii.botania.client.render.item.RenderLens;
|
||||
import vazkii.botania.common.block.tile.mana.TilePrism;
|
||||
|
||||
public class RenderTilePrism extends TileEntitySpecialRenderer {
|
||||
public class RenderTilePrism extends TileEntitySpecialRenderer<TilePrism> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partTicks, int digProgress) {
|
||||
TilePrism prism = (TilePrism) tile;
|
||||
public void renderTileEntityAt(TilePrism prism, double x, double y, double z, float partTicks, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x, y, z);
|
||||
float pos = (float) Math.sin((ClientTickHandler.ticksInGame + partTicks) * 0.05F) * 0.5F * (1F - 1F / 16F) - 0.5F;
|
||||
@@ -39,7 +38,6 @@ public class RenderTilePrism extends TileEntitySpecialRenderer {
|
||||
if(stack != null) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
if(stack.getItem() instanceof ILens) {
|
||||
ILens lens = (ILens) stack.getItem();
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.rotate(90F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(0.5F, 0.5F, pos);
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelPump;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
|
||||
public class RenderTilePump extends TileEntitySpecialRenderer {
|
||||
public class RenderTilePump extends TileEntitySpecialRenderer<TilePump> {
|
||||
|
||||
private static final float[] ROTATIONS = new float[] {
|
||||
180F, 0F, 90F, 270F
|
||||
@@ -33,21 +33,19 @@ public class RenderTilePump extends TileEntitySpecialRenderer {
|
||||
private static final ModelPump model = new ModelPump();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
TilePump pump = (TilePump) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TilePump pump, double d0, double d1, double d2, float f, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
int meta = pump.getWorld() != null ? pump.getBlockMetadata() : 0;
|
||||
int meta = pump != null && pump.getWorld() != null ? pump.getBlockMetadata() : 0;
|
||||
|
||||
GlStateManager.translate(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F);
|
||||
model.render(Math.max(0F, Math.min(8F, pump.innerRingPos + pump.moving * f)));
|
||||
model.render(Math.max(0F, Math.min(8F, pump == null ? 8 : pump.innerRingPos + pump.moving * f)));
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -34,9 +34,11 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.IPylonModel;
|
||||
import vazkii.botania.client.model.ModelPylon;
|
||||
import vazkii.botania.client.model.ModelPylonOld;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TilePylon;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
|
||||
public class RenderTilePylon extends TileEntitySpecialRenderer {
|
||||
public class RenderTilePylon extends TileEntitySpecialRenderer<TilePylon> {
|
||||
|
||||
private static final ResourceLocation textureOld = new ResourceLocation(LibResources.MODEL_PYLON_OLD);
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_PYLON);
|
||||
@@ -52,7 +54,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer {
|
||||
public static boolean pink = false;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
public void renderTileEntityAt(TilePylon pylon, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
if(model == null)
|
||||
model = ConfigHandler.oldPylonModel ? new ModelPylonOld() : new ModelPylon();
|
||||
|
||||
@@ -63,8 +65,8 @@ public class RenderTilePylon extends TileEntitySpecialRenderer {
|
||||
float a = MultiblockRenderHandler.rendering ? 0.6F : 1F;
|
||||
GlStateManager.color(1F, 1F, 1F, a);
|
||||
PylonVariant variant = null;
|
||||
if(tileentity.getWorld() != null) {
|
||||
variant = ((PylonVariant) tileentity.getWorld().getBlockState(tileentity.getPos()).getValue(BotaniaStateProps.PYLON_VARIANT));
|
||||
if(pylon.getWorld() != null && pylon.getWorld().getBlockState(pylon.getPos()).getBlock() == ModBlocks.pylon) {
|
||||
variant = pylon.getWorld().getBlockState(pylon.getPos()).getValue(BotaniaStateProps.PYLON_VARIANT);
|
||||
green = variant == PylonVariant.NATURA;
|
||||
pink = variant == PylonVariant.GAIA;
|
||||
}
|
||||
@@ -73,10 +75,10 @@ public class RenderTilePylon extends TileEntitySpecialRenderer {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(pink ? texturePinkOld : green ? textureGreenOld : textureOld);
|
||||
else Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
|
||||
double worldTime = tileentity.getWorld() == null ? 0 : (double) (ClientTickHandler.ticksInGame + pticks);
|
||||
double worldTime = pylon.getWorld() == null ? 0 : (double) (ClientTickHandler.ticksInGame + pticks);
|
||||
|
||||
if(tileentity != null)
|
||||
worldTime += new Random(tileentity.getPos().hashCode()).nextInt(360);
|
||||
if(pylon != null)
|
||||
worldTime += new Random(pylon.getPos().hashCode()).nextInt(360);
|
||||
|
||||
if(ConfigHandler.oldPylonModel) {
|
||||
GlStateManager.translate(d0 + 0.5, d1 + 2.2, d2 + 0.5);
|
||||
|
||||
@@ -15,11 +15,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import vazkii.botania.client.core.handler.RedStringRenderer;
|
||||
import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
|
||||
public class RenderTileRedString extends TileEntitySpecialRenderer {
|
||||
public class RenderTileRedString extends TileEntitySpecialRenderer<TileRedString> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partticks, int digProgress) {
|
||||
TileRedString trs = (TileRedString) tileentity;
|
||||
public void renderTileEntityAt(TileRedString trs, double x, double y, double z, float partticks, int digProgress) {
|
||||
RedStringRenderer.redStringTiles.add(trs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,14 +33,12 @@ import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.model.ModelSpinningCubes;
|
||||
import vazkii.botania.common.block.tile.TileRuneAltar;
|
||||
|
||||
public class RenderTileRuneAltar extends TileEntitySpecialRenderer {
|
||||
public class RenderTileRuneAltar extends TileEntitySpecialRenderer<TileRuneAltar> {
|
||||
|
||||
ModelSpinningCubes cubes = new ModelSpinningCubes();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partticks, int digProgress) {
|
||||
TileRuneAltar altar = (TileRuneAltar) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileRuneAltar altar, double x, double y, double z, float partticks, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(x, y, z);
|
||||
|
||||
@@ -39,14 +39,15 @@ public class RenderTileSkullOverride extends TileEntitySkullRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntitySkull p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_, int digProgress) {
|
||||
if (p_147500_1_ instanceof TileEntitySkull) {
|
||||
TileEntitySkull skull = ((TileEntitySkull) p_147500_1_);
|
||||
render(skull, (float) p_147500_2_, (float) p_147500_4_, (float) p_147500_6_, EnumFacing.getFront(p_147500_1_.getBlockMetadata() & 7) /*todo 1.8*/, skull.getSkullRotation() * 360 / 16.0F, skull.getSkullType(), skull.getPlayerProfile(), digProgress);
|
||||
if (p_147500_1_ != null) {
|
||||
render(p_147500_1_, (float) p_147500_2_, (float) p_147500_4_, (float) p_147500_6_, EnumFacing.getFront(p_147500_1_.getBlockMetadata() & 7) /*todo 1.8*/, p_147500_1_.getSkullRotation() * 360 / 16.0F, p_147500_1_.getSkullType(), p_147500_1_.getPlayerProfile(), digProgress);
|
||||
} else {
|
||||
render(null, ((float) p_147500_2_), ((float) p_147500_4_), ((float) p_147500_6_), EnumFacing.NORTH, 0, 3, null, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void render(TileEntitySkull skull, float par1, float par2, float par3, EnumFacing par4, float par5, int par6, GameProfile gameProfile, int digProgress) {
|
||||
boolean gaia = skull instanceof TileGaiaHead;
|
||||
boolean gaia = skull == null || skull instanceof TileGaiaHead;
|
||||
if(par6 == 3 || gaia) {
|
||||
ResourceLocation resourcelocation = DefaultPlayerSkin.getDefaultSkinLegacy();
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
|
||||
@@ -26,16 +26,16 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.common.block.tile.TileSparkChanger;
|
||||
|
||||
public class RenderTileSparkChanger extends TileEntitySpecialRenderer {
|
||||
public class RenderTileSparkChanger extends TileEntitySpecialRenderer<TileSparkChanger> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
public void renderTileEntityAt(TileSparkChanger tileentity, double d0, double d1, double d2, float pticks, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
GlStateManager.rotate(90F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(0.8F, 0.2F, -0.22F);
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
ItemStack stack = ((TileSparkChanger) tileentity).getStackInSlot(0);
|
||||
ItemStack stack = tileentity.getStackInSlot(0);
|
||||
if(stack != null) {
|
||||
GlStateManager.pushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
|
||||
@@ -34,7 +34,7 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelSpreader;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
|
||||
public class RenderTileSpreader extends TileEntitySpecialRenderer {
|
||||
public class RenderTileSpreader extends TileEntitySpecialRenderer<TileSpreader> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_SPREADER);
|
||||
private static final ResourceLocation textureRs = new ResourceLocation(LibResources.MODEL_SPREADER_REDSTONE);
|
||||
@@ -47,8 +47,7 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer {
|
||||
private static final ModelSpreader model = new ModelSpreader();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
TileSpreader spreader = (TileSpreader) tileentity;
|
||||
public void renderTileEntityAt(TileSpreader spreader, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
@@ -77,7 +76,7 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer {
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
double worldTicks = tileentity.getWorld() == null ? 0 : time;
|
||||
double worldTicks = spreader.getWorld() == null ? 0 : time;
|
||||
GlStateManager.rotate((float) worldTicks % 360, 0F, 1F, 0F);
|
||||
GlStateManager.translate(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F);
|
||||
model.renderCube();
|
||||
|
||||
@@ -23,27 +23,28 @@ import net.minecraft.tileentity.TileEntityEndPortal;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.common.block.tile.TileStarfield;
|
||||
|
||||
// THIS CODE WAS STOLEN FROM THE END PORTAL
|
||||
// OH GOD
|
||||
// I HAVE NO IDEA WHAT I'M DOING
|
||||
// SO MUCH STUFF I DON'T UNDERSTAND D:
|
||||
// HELP
|
||||
public class RenderTileStarfield extends TileEntitySpecialRenderer {
|
||||
public class RenderTileStarfield extends TileEntitySpecialRenderer<TileStarfield> {
|
||||
|
||||
private static final ResourceLocation END_SKY_TEXTURE = new ResourceLocation("textures/environment/end_sky.png");
|
||||
private static final ResourceLocation END_PORTAL_TEXTURE = new ResourceLocation("textures/entity/end_portal.png");
|
||||
private static final Random field_147527_e = new Random(31100L);
|
||||
FloatBuffer field_147528_b = GLAllocation.createDirectFloatBuffer(16);
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage)
|
||||
public void renderTileEntityAt(TileStarfield starfield, double x, double y, double z, float partialTicks, int destroyStage)
|
||||
{
|
||||
float f = (float)this.rendererDispatcher.entityX;
|
||||
float f1 = (float)this.rendererDispatcher.entityY;
|
||||
float f2 = (float)this.rendererDispatcher.entityZ;
|
||||
GlStateManager.disableLighting();
|
||||
field_147527_e.setSeed(31100L);
|
||||
float f3 = 0.24F;
|
||||
float f3 = 0.24F; // Botania: move to bottom of block space
|
||||
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
@@ -116,6 +117,7 @@ public class RenderTileStarfield extends TileEntitySpecialRenderer {
|
||||
f11 = f12 = f13 = 1.0F * f6;
|
||||
}
|
||||
|
||||
// Botania: change color based on time
|
||||
Color color = Color.getHSBColor(Minecraft.getSystemTime() / 20F % 360 / 360F, 1F, 1F);
|
||||
f11 = color.getRed() / 255F;
|
||||
f12 = color.getGreen() / 255F;
|
||||
|
||||
@@ -28,12 +28,10 @@ import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.common.block.mana.BlockTerraPlate;
|
||||
import vazkii.botania.common.block.tile.TileTerraPlate;
|
||||
|
||||
public class RenderTileTerraPlate extends TileEntitySpecialRenderer {
|
||||
public class RenderTileTerraPlate extends TileEntitySpecialRenderer<TileTerraPlate> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
TileTerraPlate plate = (TileTerraPlate) tileentity;
|
||||
|
||||
public void renderTileEntityAt(TileTerraPlate plate, double d0, double d1, double d2, float f, int digProgress) {
|
||||
float max = TileTerraPlate.MAX_MANA / 10F;
|
||||
float alphaMod = Math.min(max, plate.getCurrentMana()) / max;
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -25,15 +25,16 @@ import vazkii.botania.client.core.proxy.ClientProxy;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelTeruTeruBozu;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.tile.TileTeruTeruBozu;
|
||||
|
||||
public class RenderTileTeruTeruBozu extends TileEntitySpecialRenderer {
|
||||
public class RenderTileTeruTeruBozu extends TileEntitySpecialRenderer<TileTeruTeruBozu> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TERU_TERU_BOZU);
|
||||
private static final ResourceLocation textureHalloween = new ResourceLocation(LibResources.MODEL_TERU_TERU_BOZU_HALLOWEEN);
|
||||
ModelTeruTeruBozu model = new ModelTeruTeruBozu();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
public void renderTileEntityAt(TileTeruTeruBozu tileentity, double d0, double d1, double d2, float f, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.enableBlend();
|
||||
@@ -44,7 +45,7 @@ public class RenderTileTeruTeruBozu extends TileEntitySpecialRenderer {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ClientProxy.dootDoot ? textureHalloween : texture);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
double time = Botania.proxy.getWorldElapsedTicks() + f;
|
||||
boolean hasWorld = tileentity.getWorld() != null;
|
||||
boolean hasWorld = tileentity != null && tileentity.getWorld() != null;
|
||||
if(hasWorld)
|
||||
time += new Random(tileentity.getPos().hashCode()).nextInt(1000);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
import vazkii.botania.common.item.material.ItemManaResource;
|
||||
import vazkii.botania.common.item.relic.ItemInfiniteFruit;
|
||||
|
||||
public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
|
||||
public class RenderTileTinyPotato extends TileEntitySpecialRenderer<TileTinyPotato> {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TINY_POTATO);
|
||||
private static final ResourceLocation textureGrayscale = new ResourceLocation(LibResources.MODEL_TINY_POTATO_GS);
|
||||
@@ -58,8 +58,7 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
|
||||
private static final ModelTinyPotato model = new ModelTinyPotato();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8, int digProgress) {
|
||||
TileTinyPotato potato = (TileTinyPotato) var1;
|
||||
public void renderTileEntityAt(TileTinyPotato potato, double d0, double d1, double d2, float var8, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class BlockAlfPortal extends BlockModContainer implements IWandable, ILex
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((AlfPortalState) state.getValue(BotaniaStateProps.ALFPORTAL_STATE)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.ALFPORTAL_STATE).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,7 +83,7 @@ public class BlockAlfPortal extends BlockModContainer implements IWandable, ILex
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
return world.getBlockState(pos).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF ? 0 : 15;
|
||||
return world.getBlockState(pos).getBlock() == this && world.getBlockState(pos).getValue(BotaniaStateProps.ALFPORTAL_STATE) != AlfPortalState.OFF ? 15 : 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,9 +54,14 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
return new BlockState(this, BotaniaStateProps.ALTGRASS_VARIANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isToolEffective(String type, IBlockState state) {
|
||||
return type.equals("shovel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((AltGrassVariant) state.getValue(BotaniaStateProps.ALTGRASS_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.ALTGRASS_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,8 +88,8 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
if(!world.isRemote && world.getLight(pos.up()) >= 9) {
|
||||
AltGrassVariant variant = ((AltGrassVariant) state.getValue(BotaniaStateProps.ALTGRASS_VARIANT));
|
||||
if(!world.isRemote && state.getBlock() == this && world.getLight(pos.up()) >= 9) {
|
||||
AltGrassVariant variant = state.getValue(BotaniaStateProps.ALTGRASS_VARIANT);
|
||||
for(int l = 0; l < 4; ++l) {
|
||||
BlockPos pos1 = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1);
|
||||
|
||||
@@ -108,12 +113,15 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
|
||||
return plantable.getPlantType(world, pos.down()) == EnumPlantType.Plains;
|
||||
EnumPlantType type = plantable.getPlantType(world, pos.down());
|
||||
return type == EnumPlantType.Plains || type == EnumPlantType.Beach;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random r) {
|
||||
AltGrassVariant variant = ((AltGrassVariant) state.getValue(BotaniaStateProps.ALTGRASS_VARIANT));
|
||||
if (state.getBlock() != this)
|
||||
return;
|
||||
AltGrassVariant variant = state.getValue(BotaniaStateProps.ALTGRASS_VARIANT);
|
||||
switch(variant) {
|
||||
case DRY: // Dry
|
||||
break;
|
||||
|
||||
@@ -121,8 +121,7 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
|
||||
TileCamo camo = (TileCamo) tile;
|
||||
Block block = camo.camo;
|
||||
if(block != null)
|
||||
return block instanceof BlockCamo ? 0xFFFFFF : block.colorMultiplier(par1World, pos, pass);
|
||||
|
||||
return block instanceof BlockCamo ? 0xFFFFFF : block.getRenderColor(block.getDefaultState()); // todo
|
||||
}
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumFacing) state.getValue(BotaniaStateProps.CARDINALS)).getHorizontalIndex();
|
||||
return state.getValue(BotaniaStateProps.CARDINALS).getHorizontalIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BlockGaiaHead extends BlockSkull {
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str);
|
||||
GameRegistry.registerBlock(this, null, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
return state.getValue(BotaniaStateProps.POWERED) ? 0 : 15;
|
||||
return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -136,11 +136,6 @@ public class BlockIncensePlate extends BlockModContainer implements ILexiconable
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileIncensePlate();
|
||||
|
||||
@@ -50,7 +50,7 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((LivingRockVariant) state.getValue(BotaniaStateProps.LIVINGROCK_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.LIVINGROCK_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,7 +54,7 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((LivingWoodVariant) state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -70,7 +70,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMetadata();
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,7 +146,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
|
||||
@Override
|
||||
public void grow(World world, Random rand, BlockPos pos, IBlockState state) {
|
||||
placeDoubleFlower(world, pos, ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)), 1 | 2);
|
||||
placeDoubleFlower(world, pos, state.getValue(BotaniaStateProps.COLOR), 1 | 2);
|
||||
}
|
||||
|
||||
public static void placeDoubleFlower(World world, BlockPos pos, EnumDyeColor color, int flags) {
|
||||
|
||||
@@ -73,7 +73,7 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((CrateVariant) state.getValue(BotaniaStateProps.CRATE_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.CRATE_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((PlatformVariant) state.getValue(BotaniaStateProps.PLATFORM_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.PLATFORM_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,14 +92,14 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, BlockPos pos, IBlockState state, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {
|
||||
PlatformVariant variant = ((PlatformVariant) state.getValue(BotaniaStateProps.PLATFORM_VARIANT));
|
||||
PlatformVariant variant = state.getValue(BotaniaStateProps.PLATFORM_VARIANT);
|
||||
if(variant == PlatformVariant.INFRANGIBLE || variant == PlatformVariant.ABSTRUSE && par7Entity != null && par7Entity.posY > pos.getY() + (par7Entity instanceof EntityPlayer ? 2 : 0) && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
|
||||
super.addCollisionBoxesToList(par1World, pos, state, par5AxisAlignedBB, par6List, par7Entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World par1World, BlockPos pos) {
|
||||
PlatformVariant variant = ((PlatformVariant) par1World.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT));
|
||||
PlatformVariant variant = par1World.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT);
|
||||
return variant == PlatformVariant.INFRANGIBLE ? -1F : super.getBlockHardness(par1World, pos);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
PlatformVariant variant = ((PlatformVariant) world.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT));
|
||||
PlatformVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT);
|
||||
return variant == PlatformVariant.ABSTRUSE ? LexiconData.platform : variant == PlatformVariant.INFRANGIBLE ? null : LexiconData.spectralPlatform;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class BlockPylon extends BlockModContainer implements ILexiconable, IInfu
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((PylonVariant) state.getValue(BotaniaStateProps.PYLON_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.PYLON_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,7 +126,7 @@ public class BlockPylon extends BlockModContainer implements ILexiconable, IInfu
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
PylonVariant variant = ((PylonVariant) world.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT));
|
||||
PylonVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT);
|
||||
return variant == PylonVariant.MANA ? LexiconData.pylon : variant == PylonVariant.NATURA ? LexiconData.alfhomancyIntro : LexiconData.gaiaRitual;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMetadata();
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -163,7 +163,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
int currentLight = ((TileSpecialFlower) world.getTileEntity(pos)).getLightValue();
|
||||
if(currentLight == -1)
|
||||
currentLight = 0;
|
||||
return LightHelper.getPackedColor(((EnumDyeColor) world.getBlockState(pos).getValue(BotaniaStateProps.COLOR)), currentLight);
|
||||
return LightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), currentLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -283,7 +283,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
|
||||
@Override
|
||||
public int getRenderColor(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR))
|
||||
return state.getValue(BotaniaStateProps.COLOR)
|
||||
.getMapColor().colorValue;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && stack.getItem() == ModItems.dye) {
|
||||
EnumDyeColor newColor = EnumDyeColor.byMetadata(stack.getItemDamage());
|
||||
EnumDyeColor oldColor = ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR));
|
||||
EnumDyeColor oldColor = state.getValue(BotaniaStateProps.COLOR);
|
||||
if(newColor != oldColor)
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.COLOR, newColor), 1 | 2);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((Enum) state.getValue(BotaniaStateProps.STORAGE_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.STORAGE_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +93,7 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
StorageVariant variant = ((StorageVariant) world.getBlockState(pos).getValue(BotaniaStateProps.STORAGE_VARIANT));
|
||||
StorageVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.STORAGE_VARIANT);
|
||||
return variant == StorageVariant.MANASTEEL ? LexiconData.pool : LexiconData.terrasteel;
|
||||
}
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ public final class ModFluffBlocks {
|
||||
stoneWall = new Block18StoneWall();
|
||||
|
||||
count = 0;
|
||||
for (EnumDyeColor color : ((Collection<EnumDyeColor>) BotaniaStateProps.PAVEMENT_COLOR.getAllowedValues())) {
|
||||
for (EnumDyeColor color : BotaniaStateProps.PAVEMENT_COLOR.getAllowedValues()) {
|
||||
pavementStairs[count] = new BlockPavementStairs(color);
|
||||
pavementSlabs[count] = new BlockPavementSlab(false, color, count);
|
||||
pavementFullSlabs[count] = new BlockPavementSlab(true, color, count);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class Block18Stone extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((FutureStoneVariant) state.getValue(BotaniaStateProps.FUTURESTONE_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.FUTURESTONE_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,12 +40,12 @@ public class BlockBuriedPetals extends BlockModFlower {
|
||||
@Override
|
||||
@Optional.Method(modid = "easycoloredlights")
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
return ColoredLightHelper.getPackedColor(((EnumDyeColor) world.getBlockState(pos).getValue(BotaniaStateProps.COLOR)), originalLight);
|
||||
return ColoredLightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), originalLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World par1World, BlockPos pos, IBlockState state, Random par5Random) {
|
||||
EnumDyeColor color = ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR));
|
||||
EnumDyeColor color = state.getValue(BotaniaStateProps.COLOR);
|
||||
int hex = color.getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BlockCustomBrick extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((CustomBrickVariant) state.getValue(BotaniaStateProps.CUSTOMBRICK_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.CUSTOMBRICK_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,7 +92,7 @@ public class BlockCustomBrick extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
CustomBrickVariant variant = ((CustomBrickVariant) world.getBlockState(pos).getValue(BotaniaStateProps.CUSTOMBRICK_VARIANT));
|
||||
CustomBrickVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.CUSTOMBRICK_VARIANT);
|
||||
return variant.getName().contains("azulejo") ? LexiconData.azulejo : LexiconData.decorativeBlocks;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BlockEndStoneBrick extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EndBrickVariant) state.getValue(BotaniaStateProps.ENDBRICK_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.ENDBRICK_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,7 +59,7 @@ public class BlockManaBeacon extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMetadata();
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,7 +104,7 @@ public class BlockManaBeacon extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getRenderColor(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMapColor().colorValue;
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,14 +25,17 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
import vazkii.botania.common.block.tile.TileManaFlame;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.world.WorldTypeSkyblock;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
public class BlockManaFlame extends BlockModContainer {
|
||||
public class BlockManaFlame extends BlockModContainer implements ILexiconable {
|
||||
|
||||
public BlockManaFlame() {
|
||||
super(Material.cloth);
|
||||
@@ -105,4 +108,9 @@ public class BlockManaFlame extends BlockModContainer {
|
||||
return new TileManaFlame();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.lenses;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMetadata();
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,7 +117,7 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
@Override
|
||||
@Optional.Method(modid = "easycoloredlights")
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
return ColoredLightHelper.getPackedColor(((EnumDyeColor) world.getBlockState(pos).getValue(BotaniaStateProps.COLOR)), originalLight);
|
||||
return ColoredLightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), originalLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,7 +127,7 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World par1World, BlockPos pos, IBlockState state, Random par5Random) {
|
||||
int hex = ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMapColor().colorValue;
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BlockPavement extends BlockMod {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
switch ((EnumDyeColor) state.getValue(BotaniaStateProps.PAVEMENT_COLOR)) {
|
||||
switch (state.getValue(BotaniaStateProps.PAVEMENT_COLOR)) {
|
||||
case GREEN: return 5;
|
||||
case YELLOW: return 4;
|
||||
case RED: return 3;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BlockPetalBlock extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMetadata();
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,7 +83,7 @@ public class BlockPetalBlock extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getRenderColor(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMapColor().colorValue;
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BlockPrismarine extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((PrismarineVariant) state.getValue(BotaniaStateProps.PRISMARINE_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.PRISMARINE_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BlockShinyFlower extends BlockModFlower implements IInfusionStabili
|
||||
@Override
|
||||
@Optional.Method(modid = "easycoloredlights")
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
return ColoredLightHelper.getPackedColor(((EnumDyeColor) world.getBlockState(pos).getValue(BotaniaStateProps.COLOR)), originalLight);
|
||||
return ColoredLightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), originalLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,7 @@ public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMetadata();
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,7 +114,7 @@ public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getRenderColor(IBlockState state) {
|
||||
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMapColor().colorValue;
|
||||
return state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BlockBiomeStoneA extends BlockBiomeStone {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((BiomeStoneVariant) state.getValue(BotaniaStateProps.BIOMESTONE_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.BIOMESTONE_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ public class BlockBiomeStoneB extends BlockBiomeStone {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((BiomeBrickVariant) state.getValue(BotaniaStateProps.BIOMEBRICK_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.BIOMEBRICK_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,6 +35,7 @@ public class BlockModPane extends BlockPane {
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setHardness(0.3F);
|
||||
setStepSound(soundTypeGlass);
|
||||
setLightLevel(1.0F);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Block18StoneWall extends BlockModWall {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((Enum) state.getValue(BotaniaStateProps.FUTURESTONEWALL_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.FUTURESTONEWALL_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,7 +45,7 @@ public class BlockBiomeStoneWall extends BlockModWall {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((Enum) state.getValue(BotaniaStateProps.BIOMESTONEWALL_VARIANT)).ordinal() - 8;
|
||||
return state.getValue(BotaniaStateProps.BIOMESTONEWALL_VARIANT).ordinal() - 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BlockBellows extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumFacing) state.getValue(BotaniaStateProps.CARDINALS)).getIndex();
|
||||
return state.getValue(BotaniaStateProps.CARDINALS).getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -65,7 +65,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((DrumVariant) state.getValue(BotaniaStateProps.DRUM_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.DRUM_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,7 +112,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
public void onBurstCollision(IManaBurst burst, World world, BlockPos pos) {
|
||||
if(burst.isFake())
|
||||
return;
|
||||
DrumVariant variant = ((DrumVariant) world.getBlockState(pos).getValue(BotaniaStateProps.DRUM_VARIANT));
|
||||
DrumVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.DRUM_VARIANT);
|
||||
if(variant == DrumVariant.WILD)
|
||||
ItemGrassHorn.breakGrass(world, null, 0, pos);
|
||||
else if(variant == DrumVariant.CANOPY)
|
||||
@@ -172,7 +172,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
DrumVariant variant = ((DrumVariant) world.getBlockState(pos).getValue(BotaniaStateProps.DRUM_VARIANT));
|
||||
DrumVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.DRUM_VARIANT);
|
||||
|
||||
switch(variant) {
|
||||
case GATHERING:
|
||||
|
||||
@@ -68,7 +68,7 @@ public class BlockPump extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess w, BlockPos pos) {
|
||||
EnumFacing facing = ((EnumFacing) w.getBlockState(pos).getValue(BotaniaStateProps.CARDINALS));
|
||||
EnumFacing facing = w.getBlockState(pos).getValue(BotaniaStateProps.CARDINALS);
|
||||
setBlockBounds(facing.getAxis());
|
||||
}
|
||||
|
||||
|
||||
@@ -57,11 +57,6 @@ public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileSpawnerClaw();
|
||||
|
||||
@@ -71,7 +71,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((SpreaderVariant) state.getValue(BotaniaStateProps.SPREADER_VARIANT)).ordinal();
|
||||
return state.getValue(BotaniaStateProps.SPREADER_VARIANT).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -252,7 +252,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
SpreaderVariant variant = ((SpreaderVariant) world.getBlockState(pos).getValue(BotaniaStateProps.SPREADER_VARIANT));
|
||||
SpreaderVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.SPREADER_VARIANT);
|
||||
return variant == SpreaderVariant.MANA ? LexiconData.spreader : variant == SpreaderVariant.REDSTONE ? LexiconData.redstoneSpreader : LexiconData.dreamwoodSpreader;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public abstract class BlockRedString extends BlockModContainer<TileRedString> im
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumFacing) state.getValue(BotaniaStateProps.FACING)).getIndex();
|
||||
return state.getValue(BotaniaStateProps.FACING).getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,7 +35,7 @@ public class BlockRedStringDispenser extends BlockRedString {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int meta = ((EnumFacing) state.getValue(BotaniaStateProps.FACING)).getIndex();
|
||||
int meta = state.getValue(BotaniaStateProps.FACING).getIndex();
|
||||
if (state.getValue(BotaniaStateProps.POWERED)) {
|
||||
meta |= 8;
|
||||
} else {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BlockRedStringInterceptor extends BlockRedString {
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int meta = ((EnumFacing) state.getValue(BotaniaStateProps.FACING)).getIndex();
|
||||
int meta = state.getValue(BotaniaStateProps.FACING).getIndex();
|
||||
if (state.getValue(BotaniaStateProps.POWERED)) {
|
||||
meta |= 8;
|
||||
} else {
|
||||
|
||||
@@ -93,7 +93,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
if(inv != null) {
|
||||
List<ItemStack> filter = getFilterForInventory(inv, pos_, true);
|
||||
boolean canAccept = canAcceptItem(stack, filter, filterType);
|
||||
int availablePut = InventoryHelper.testInventoryInsertion(inv, stack, dir);
|
||||
int availablePut = supertile.getWorld().isRemote ? 1 : InventoryHelper.testInventoryInsertion(inv, stack, dir);
|
||||
canAccept &= availablePut > 0;
|
||||
|
||||
if(canAccept) {
|
||||
@@ -112,9 +112,9 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
|
||||
if(invToPutItemIn != null) {
|
||||
if(invToPutItemIn != null && !item.isDead) {
|
||||
boolean remote = supertile.getWorld().isRemote;
|
||||
if(!item.isDead && remote) {
|
||||
if(remote) {
|
||||
if(!particled.contains(item)) {
|
||||
SubTileSpectranthemum.spawnExplosionParticles(item, 3);
|
||||
particled.add(item);
|
||||
|
||||
@@ -194,7 +194,7 @@ public class TileAlfPortal extends TileMod implements ITickable {
|
||||
}
|
||||
|
||||
public boolean onWanded() {
|
||||
AlfPortalState state = ((AlfPortalState) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE));
|
||||
AlfPortalState state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
if(state == AlfPortalState.OFF) {
|
||||
AlfPortalState newState = getValidState();
|
||||
if(newState != AlfPortalState.OFF) {
|
||||
|
||||
@@ -136,7 +136,9 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl
|
||||
@Override
|
||||
public void update() {
|
||||
IBlockState state = worldObj.getBlockState(getPos());
|
||||
EnumFacing.Axis axis = ((EnumFacing.Axis) state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION));
|
||||
if (state.getBlock() != ModBlocks.enchanter)
|
||||
return;
|
||||
EnumFacing.Axis axis = state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION);
|
||||
|
||||
if(getBlockMetadata() < PYLON_LOCATIONS.size())
|
||||
for(BlockPos pylon : PYLON_LOCATIONS.get(axis)) {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class TileManaBeacon extends TileMod implements ITickable {
|
||||
}
|
||||
|
||||
if(!redstone) {
|
||||
int hex = ((EnumDyeColor) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR)).getMapColor().colorValue;
|
||||
int hex = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
@@ -11,17 +11,25 @@
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class TileOpenCrate extends TileSimpleInventory implements ITickable {
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 1;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TilePylon extends TileEntity implements ITickable {
|
||||
@Override
|
||||
public void update() {
|
||||
++ticks;
|
||||
PylonVariant variant = ((PylonVariant) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.PYLON_VARIANT));
|
||||
PylonVariant variant = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.PYLON_VARIANT);
|
||||
|
||||
if(activated && worldObj.isRemote) {
|
||||
if(worldObj.getBlockState(centerPos).getBlock() != getBlockForMeta() || variant != PylonVariant.MANA && worldObj.getBlockState(centerPos).getBlock().getMetaFromState(worldObj.getBlockState(centerPos)) == 0) { // todo 1.8 clarify
|
||||
@@ -70,7 +70,7 @@ public class TilePylon extends TileEntity implements ITickable {
|
||||
|
||||
Block block = worldObj.getBlockState(pos.down()).getBlock();
|
||||
if(block == ModBlocks.flower || block == ModBlocks.shinyFlower) {
|
||||
int hex = ((EnumDyeColor) worldObj.getBlockState(pos.down()).getValue(BotaniaStateProps.COLOR)).getMapColor().colorValue;
|
||||
int hex = worldObj.getBlockState(pos.down()).getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -27,12 +28,14 @@ import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -102,6 +105,11 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
|
||||
int ticks = 0;
|
||||
boolean sendPacket = false;
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull() {
|
||||
Block blockBelow = worldObj.getBlockState(pos.down()).getBlock();
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -141,6 +142,11 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
List<PositionProperties> lastTentativeBurst;
|
||||
boolean invalidTentativeBurst = false;
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull() {
|
||||
return mana >= getMaxMana();
|
||||
|
||||
@@ -76,7 +76,7 @@ public abstract class TileRedString extends TileMod implements ITileBound, ITick
|
||||
}
|
||||
|
||||
public EnumFacing getOrientation() {
|
||||
return ((EnumFacing) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.FACING));
|
||||
return worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.FACING);
|
||||
}
|
||||
|
||||
public TileEntity getTileAtBinding() {
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ModPotions {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("Severe error, please report this to the mod author:");
|
||||
System.err.println(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.client.Minecraft;
|
||||
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.entity.player.EntityPlayerMP;
|
||||
@@ -30,6 +31,8 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.BotaniaAPIClient;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.internal.DummyMethodHandler;
|
||||
import vazkii.botania.api.internal.IManaNetwork;
|
||||
@@ -46,6 +49,7 @@ import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.client.core.handler.BossBarHandler;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.render.SpecialFlowerModel;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockModFlower;
|
||||
import vazkii.botania.common.block.BlockSpecialFlower;
|
||||
@@ -98,18 +102,13 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSubTileIconForName(String name) {
|
||||
// IIcon icon = (ConfigHandler.altFlowerTextures ? BlockSpecialFlower.iconsAlt : BlockSpecialFlower.icons).get(name);
|
||||
// return icon == null ? Blocks.red_flower.getIcon(0, 0) : icon; todo 1.8
|
||||
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("minecraft:red_flower");
|
||||
public ModelResourceLocation getSubTileBlockModelForName(String name) {
|
||||
return BotaniaAPIClient.getRegisteredSubtileBlockModels().get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBasicSignatureIcons(String name, TextureMap map) {
|
||||
// IIcon normal = IconHelper.forName(register, name); todo 1.8
|
||||
// IIcon alt = IconHelper.forName(register, BlockModFlower.ALT_DIR + "/" + name);
|
||||
// BlockSpecialFlower.icons.put(name, normal);
|
||||
// BlockSpecialFlower.iconsAlt.put(name, alt == null ? normal : alt);
|
||||
public ModelResourceLocation getSubTileItemModelForName(String name) {
|
||||
return BotaniaAPIClient.getRegisteredSubtileItemModels().get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2187,13 +2187,10 @@ public final class ModCraftingRecipes {
|
||||
for(int i = 0; i < 8; i++)
|
||||
addWall(ModFluffBlocks.biomeStoneA, i + 8, ModFluffBlocks.biomeStoneWall, i);
|
||||
|
||||
addWall(ModFluffBlocks.stone, 0, ModFluffBlocks.stoneWall, 0); // Andesite todo 1.8 convert to OreDict?
|
||||
addWall(Blocks.stone, 5, ModFluffBlocks.stoneWall, 0);
|
||||
addWall(ModFluffBlocks.stone, 1, ModFluffBlocks.stoneWall, 1); // Basalt
|
||||
addWall(ModFluffBlocks.stone, 2, ModFluffBlocks.stoneWall, 2); // Diorite
|
||||
addWall(Blocks.stone, 3, ModFluffBlocks.stoneWall, 2); // Diorite
|
||||
addWall(ModFluffBlocks.stone, 3, ModFluffBlocks.stoneWall, 3); // Granite
|
||||
addWall(Blocks.stone, 1, ModFluffBlocks.stoneWall, 3); // Granite
|
||||
addWallWithOreDict(LibOreDict.STONE_18_VARIANTS[0], ModFluffBlocks.stoneWall, 0); // Andesite
|
||||
addWallWithOreDict(LibOreDict.STONE_18_VARIANTS[1], ModFluffBlocks.stoneWall, 1); // Basalt
|
||||
addWallWithOreDict(LibOreDict.STONE_18_VARIANTS[2], ModFluffBlocks.stoneWall, 2); // Diorite
|
||||
addWallWithOreDict(LibOreDict.STONE_18_VARIANTS[3], ModFluffBlocks.stoneWall, 3); // Granite
|
||||
|
||||
// Pane Recipes
|
||||
addPane(ModBlocks.manaGlass, ModFluffBlocks.managlassPane);
|
||||
@@ -2210,23 +2207,20 @@ public final class ModCraftingRecipes {
|
||||
addStairsAndSlabs(ModFluffBlocks.biomeStoneB, i, ModFluffBlocks.biomeStoneStairs[i + 16], ModFluffBlocks.biomeStoneSlabs[i + 16]);
|
||||
}
|
||||
|
||||
// Andesite Basalt Diorite Granite Stair/Slab todo 1.8 convert to oredict?
|
||||
addStairsAndSlabs(ModFluffBlocks.stone, 0, ModFluffBlocks.stoneStairs[0], ModFluffBlocks.stoneSlabs[0]);
|
||||
addStairsAndSlabs(Blocks.stone, 5, ModFluffBlocks.stoneStairs[0], ModFluffBlocks.stoneSlabs[0]);
|
||||
// Andesite Basalt Diorite Granite Stair/Slab
|
||||
addStairsAndSlabsWithOredict(LibOreDict.STONE_18_VARIANTS[0], Blocks.stone, 5, ModFluffBlocks.stoneStairs[0], ModFluffBlocks.stoneSlabs[0]);
|
||||
|
||||
addStairsAndSlabs(ModFluffBlocks.stone, 1, ModFluffBlocks.stoneStairs[1], ModFluffBlocks.stoneSlabs[1]);
|
||||
addStairsAndSlabsWithOredict(LibOreDict.STONE_18_VARIANTS[1], ModFluffBlocks.stone, 1, ModFluffBlocks.stoneStairs[1], ModFluffBlocks.stoneSlabs[1]);
|
||||
|
||||
addStairsAndSlabs(ModFluffBlocks.stone, 2, ModFluffBlocks.stoneStairs[2], ModFluffBlocks.stoneSlabs[2]);
|
||||
addStairsAndSlabs(Blocks.stone, 3, ModFluffBlocks.stoneStairs[2], ModFluffBlocks.stoneSlabs[2]);
|
||||
addStairsAndSlabsWithOredict(LibOreDict.STONE_18_VARIANTS[2], Blocks.stone, 3, ModFluffBlocks.stoneStairs[2], ModFluffBlocks.stoneSlabs[2]);
|
||||
|
||||
addStairsAndSlabs(ModFluffBlocks.stone, 3, ModFluffBlocks.stoneStairs[3], ModFluffBlocks.stoneSlabs[3]);
|
||||
addStairsAndSlabs(Blocks.stone, 1, ModFluffBlocks.stoneStairs[3], ModFluffBlocks.stoneSlabs[3]);
|
||||
addStairsAndSlabsWithOredict(LibOreDict.STONE_18_VARIANTS[3], Blocks.stone, 1, ModFluffBlocks.stoneStairs[3], ModFluffBlocks.stoneSlabs[3]);
|
||||
|
||||
// Andesite Basalt Diorite Granite Bricks Stair/Slab
|
||||
addStairsAndSlabs(ModFluffBlocks.stone, 8, ModFluffBlocks.stoneStairs[4], ModFluffBlocks.stoneSlabs[4]);
|
||||
addStairsAndSlabs(ModFluffBlocks.stone, 9, ModFluffBlocks.stoneStairs[5], ModFluffBlocks.stoneSlabs[5]);
|
||||
addStairsAndSlabs(ModFluffBlocks.stone, 10, ModFluffBlocks.stoneStairs[6], ModFluffBlocks.stoneSlabs[6]);
|
||||
addStairsAndSlabs(ModFluffBlocks.stone, 11, ModFluffBlocks.stoneStairs[7], ModFluffBlocks.stoneSlabs[7]);
|
||||
addStairsAndSlabsWithOredict(LibOreDict.STONE_18_VARIANTS[8], ModFluffBlocks.stone, 8, ModFluffBlocks.stoneStairs[4], ModFluffBlocks.stoneSlabs[4]);
|
||||
addStairsAndSlabsWithOredict(LibOreDict.STONE_18_VARIANTS[9], ModFluffBlocks.stone, 9, ModFluffBlocks.stoneStairs[5], ModFluffBlocks.stoneSlabs[5]);
|
||||
addStairsAndSlabsWithOredict(LibOreDict.STONE_18_VARIANTS[10], ModFluffBlocks.stone, 10, ModFluffBlocks.stoneStairs[6], ModFluffBlocks.stoneSlabs[6]);
|
||||
addStairsAndSlabsWithOredict(LibOreDict.STONE_18_VARIANTS[11], ModFluffBlocks.stone, 11, ModFluffBlocks.stoneStairs[7], ModFluffBlocks.stoneSlabs[7]);
|
||||
|
||||
// Pavement Stairsm & Stairs
|
||||
for(int i = 0; i < ModFluffBlocks.pavementStairs.length; i++)
|
||||
@@ -2283,12 +2277,34 @@ public final class ModCraftingRecipes {
|
||||
'Q', new ItemStack(slab));
|
||||
}
|
||||
|
||||
// Same as above, but use od for forward recipes, only use block and meta for slab -> full block recipe
|
||||
private static void addStairsAndSlabsWithOredict(String od, Block block, int meta, Block stairs, Block slab) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(slab, 6),
|
||||
"QQQ",
|
||||
'Q', od));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(stairs, 4),
|
||||
" Q", " QQ", "QQQ",
|
||||
'Q', od));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(stairs, 4),
|
||||
"Q ", "QQ ", "QQQ",
|
||||
'Q', od));
|
||||
GameRegistry.addRecipe(new ItemStack(block, 1, meta),
|
||||
"Q", "Q",
|
||||
'Q', new ItemStack(slab)); // TODO this causes conflicts between the brick slab -> brick restoration recipe and the brick slab -> chiseled brick recipe
|
||||
}
|
||||
|
||||
private static void addWall(Block block, int blockMeta, Block wall, int wallMeta) {
|
||||
GameRegistry.addRecipe(new ItemStack(wall, 6, wallMeta),
|
||||
"BBB", "BBB",
|
||||
'B', new ItemStack(block, 1, blockMeta));
|
||||
}
|
||||
|
||||
private static void addWallWithOreDict(String od, Block wall, int wallMeta) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(wall, 6, wallMeta),
|
||||
"BBB", "BBB",
|
||||
'B', od));
|
||||
}
|
||||
|
||||
private static void addPane(Block block, Block pane) {
|
||||
GameRegistry.addRecipe(new ItemStack(pane, 16),
|
||||
"BBB", "BBB",
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraftforge.common.ForgeHooks;
|
||||
import vazkii.botania.api.item.IRelic;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class AesirRingRecipe implements IRecipe {
|
||||
|
||||
@Override
|
||||
@@ -46,13 +44,13 @@ public class AesirRingRecipe implements IRecipe {
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1) {
|
||||
UUID soulbind = null;
|
||||
String soulbind = null;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
if(stack.getItem() instanceof IRelic) {
|
||||
UUID bind = ((IRelic) stack.getItem()).getSoulbindUuid(stack);
|
||||
String bind = ((IRelic) stack.getItem()).getSoulbindUsername(stack);
|
||||
if(soulbind == null)
|
||||
soulbind = bind;
|
||||
else if(!soulbind.equals(bind))
|
||||
@@ -62,7 +60,7 @@ public class AesirRingRecipe implements IRecipe {
|
||||
}
|
||||
|
||||
ItemStack stack = new ItemStack(ModItems.aesirRing);
|
||||
((IRelic) ModItems.aesirRing).bindToUuid(soulbind, stack);
|
||||
((IRelic) ModItems.aesirRing).bindToUsername(soulbind, stack);
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 133 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user