mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 04:09:40 +00:00
More various models
This commit is contained in:
1 parent
2f4785c7b4
commit
5fe696875f
60 files changed
+633
-49
No files matched your search
@@ -23,6 +23,7 @@ import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.AltGrassVariant;
|
||||
import vazkii.botania.api.state.enums.BiomeBrickVariant;
|
||||
import vazkii.botania.api.state.enums.BiomeStoneVariant;
|
||||
import vazkii.botania.api.state.enums.CrateVariant;
|
||||
import vazkii.botania.api.state.enums.DrumVariant;
|
||||
import vazkii.botania.api.state.enums.EndBrickVariant;
|
||||
import vazkii.botania.api.state.enums.FutureStoneVariant;
|
||||
@@ -114,6 +115,9 @@ public final class ModelHandler {
|
||||
/** Normal Items **/
|
||||
registerStandardItems();
|
||||
registerManaResources();
|
||||
registerDyesPetals();
|
||||
registerRunes();
|
||||
registerBows();
|
||||
|
||||
/** Special Item Meshers **/
|
||||
}
|
||||
@@ -193,6 +197,13 @@ public final class ModelHandler {
|
||||
registerItemModel(ModBlocks.alchemyCatalyst);
|
||||
registerItemModel(ModBlocks.conjurationCatalyst);
|
||||
registerItemModel(ModBlocks.reedBlock);
|
||||
registerItemModel(ModBlocks.bifrost);
|
||||
registerItemModel(ModBlocks.bifrostPerm);
|
||||
registerItemModel(ModBlocks.enderEye);
|
||||
registerItemModel(ModBlocks.tinyPlanet);
|
||||
registerItemModel(ModBlocks.thatch);
|
||||
registerItemModel(ModBlocks.blazeBlock);
|
||||
registerItemModel(ModBlocks.forestEye);
|
||||
|
||||
// Blocks which share models with their item, and have only one variant to switch over
|
||||
registerVariantsDefaulted(ModBlocks.altGrass, AltGrassVariant.class, "variant");
|
||||
@@ -206,6 +217,7 @@ public final class ModelHandler {
|
||||
registerVariantsDefaulted(ModFluffBlocks.biomeStoneA, BiomeStoneVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModFluffBlocks.biomeStoneB, BiomeBrickVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.endStoneBrick, EndBrickVariant.class, "variant");
|
||||
registerVariantsDefaulted(ModBlocks.openCrate, CrateVariant.class, "variant");
|
||||
}
|
||||
|
||||
private static void registerStandardItems() {
|
||||
@@ -251,6 +263,9 @@ public final class ModelHandler {
|
||||
registerItemModel(thunderSword);
|
||||
registerItemModel(glassPick);
|
||||
registerItemModel(twigWand);
|
||||
registerItemModel(flowerBag);
|
||||
registerItemModel(fertilizer);
|
||||
registerItemModel(obedienceStick);
|
||||
}
|
||||
|
||||
private static void registerManaResources() {
|
||||
@@ -262,6 +277,46 @@ public final class ModelHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerDyesPetals() {
|
||||
Item item = dye;
|
||||
String name = GameData.getItemRegistry().getNameForObject(item).toString();
|
||||
|
||||
Item item2 = petal;
|
||||
String name2 = GameData.getItemRegistry().getNameForObject(item2).toString();
|
||||
|
||||
for (EnumDyeColor color : EnumDyeColor.values()) {
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(item, color.getMetadata(), new ModelResourceLocation(name, "inventory"));
|
||||
|
||||
ModelLoader.registerItemVariants(item2, new ModelResourceLocation(name2, "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(item2, color.getMetadata(), new ModelResourceLocation(name2, "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerRunes() {
|
||||
List<String> variantNames = ImmutableList.of("water", "fire", "earth", "air", "spring", "summer", "autumn", "winter", "mana", "lust", "gluttony", "greed", "sloth", "wrath", "envy", "pride");
|
||||
for (int i = 0; i < variantNames.size(); i++) {
|
||||
ModelLoader.registerItemVariants(rune, new ModelResourceLocation("botania:rune_" + variantNames.get(i), "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(rune, i, new ModelResourceLocation("botania:rune_" + variantNames.get(i), "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerBows() {
|
||||
ModelLoader.registerItemVariants(livingwoodBow, new ModelResourceLocation("botania:livingwoodBow", "inventory"));
|
||||
ModelLoader.registerItemVariants(livingwoodBow, new ModelResourceLocation("botania:livingwoodBow_pulling_1", "inventory"));
|
||||
ModelLoader.registerItemVariants(livingwoodBow, new ModelResourceLocation("botania:livingwoodBow_pulling_2", "inventory"));
|
||||
ModelLoader.registerItemVariants(livingwoodBow, new ModelResourceLocation("botania:livingwoodBow_pulling_3", "inventory"));
|
||||
registerItemModel(livingwoodBow);
|
||||
|
||||
ModelLoader.registerItemVariants(crystalBow, new ModelResourceLocation("botania:crystalBow", "inventory"));
|
||||
ModelLoader.registerItemVariants(crystalBow, new ModelResourceLocation("botania:crystalBow_pulling_1", "inventory"));
|
||||
ModelLoader.registerItemVariants(crystalBow, new ModelResourceLocation("botania:crystalBow_pulling_2", "inventory"));
|
||||
ModelLoader.registerItemVariants(crystalBow, new ModelResourceLocation("botania:crystalBow_pulling_3", "inventory"));
|
||||
ModelLoader.registerItemVariants(crystalBow, new ModelResourceLocation("botania:crystalBow_pulling_4", "inventory"));
|
||||
ModelLoader.registerItemVariants(crystalBow, new ModelResourceLocation("botania:crystalBow_pulling_5", "inventory"));
|
||||
registerItemModel(crystalBow);
|
||||
}
|
||||
|
||||
private static void registerStateMappers() {
|
||||
// Ignore vanilla facing, variant in double flower
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower1, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build());
|
||||
|
||||
@@ -32,6 +32,7 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.tile.TileBifrost;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lexicon.page.PageBrew;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -72,12 +73,12 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, BlockPos pos, EnumFacing side) {
|
||||
return shouldSideBeRendered1(p_149646_1_, pos, side.getOpposite()); //todo 1.8 verify
|
||||
return shouldSideBeRendered1(p_149646_1_, pos, side.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT_MIPPED; // todo 1.8
|
||||
return EnumWorldBlockLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, BlockPos pos, EnumFacing side) {
|
||||
return shouldSideBeRendered1(p_149646_1_, pos, side.getOpposite()); //todo 1.8 verify
|
||||
return shouldSideBeRendered1(p_149646_1_, pos, side.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,7 +64,7 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT_MIPPED; // todo 1.8 verify
|
||||
return EnumWorldBlockLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,7 +60,7 @@ public class BlockEnderEye extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
return state.getValue(BotaniaStateProps.POWER);
|
||||
return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,6 +38,11 @@ public class BlockFakeAir extends BlockModContainer {
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
|
||||
if(shouldRemove(world, pos))
|
||||
|
||||
@@ -32,6 +32,11 @@ public abstract class BlockModContainer<T extends TileEntity> extends BlockConta
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
if(shouldRegisterInNameSet())
|
||||
|
||||
@@ -52,11 +52,6 @@ public class BlockManaBeacon extends BlockModContainer implements ILexiconable {
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, BotaniaStateProps.COLOR);
|
||||
|
||||
@@ -40,11 +40,6 @@ public class BlockStarfield extends BlockModContainer implements ILexiconable {
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.25F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT_MIPPED;
|
||||
|
||||
@@ -52,11 +52,6 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex
|
||||
random = new Random();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idSpawnerClaw;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -143,7 +143,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idSpreader;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,12 +10,16 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.tool.bow;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
@@ -49,4 +53,29 @@ public class ItemCrystalBow extends ItemLivingwoodBow {
|
||||
ManaItemHandler.requestManaExactForTool(p_77615_1_, p_77615_3_, ARROW_COST / (infinity ? 2 : 1), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
|
||||
String name = GameData.getItemRegistry().getNameForObject(this).toString();
|
||||
|
||||
if (useRemaining == 0) {
|
||||
return new ModelResourceLocation(name, "inventory");
|
||||
}
|
||||
|
||||
int j = (int) ((getMaxItemUseDuration(stack) - useRemaining) * chargeVelocityMultiplier());
|
||||
|
||||
if(j >= 28)
|
||||
return new ModelResourceLocation(name + "_pulling_5", "inventory");
|
||||
if(j >= 23)
|
||||
return new ModelResourceLocation(name + "_pulling_4", "inventory");
|
||||
if(j >= 18)
|
||||
return new ModelResourceLocation(name + "_pulling_3", "inventory");
|
||||
if(j > 13)
|
||||
return new ModelResourceLocation(name + "_pulling_2", "inventory");
|
||||
if(j > 0)
|
||||
return new ModelResourceLocation(name + "_pulling_1", "inventory");
|
||||
|
||||
return new ModelResourceLocation(name, "inventory");
|
||||
}
|
||||
|
||||
}
|
||||
+22
-16
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.tool.bow;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -23,6 +24,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
@@ -164,21 +166,25 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem {
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override todo 1.8
|
||||
// public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||
// if(stack != usingItem)
|
||||
// return itemIcon;
|
||||
//
|
||||
// int j = (int) ((getMaxItemUseDuration(stack) - useRemaining) * chargeVelocityMultiplier());
|
||||
//
|
||||
// if(j >= 18)
|
||||
// return pullIcons[2];
|
||||
// if(j > 13)
|
||||
// return pullIcons[1];
|
||||
// if(j > 0)
|
||||
// return pullIcons[0];
|
||||
//
|
||||
// return itemIcon;
|
||||
// }
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
|
||||
String name = GameData.getItemRegistry().getNameForObject(this).toString();
|
||||
|
||||
if (useRemaining == 0) {
|
||||
return new ModelResourceLocation(name, "inventory");
|
||||
}
|
||||
|
||||
int j = (int) ((getMaxItemUseDuration(stack) - useRemaining) * chargeVelocityMultiplier());
|
||||
|
||||
if(j >= 18)
|
||||
return new ModelResourceLocation(name + "_pulling_3", "inventory");
|
||||
if(j > 13)
|
||||
return new ModelResourceLocation(name + "_pulling_2", "inventory");
|
||||
if(j > 0)
|
||||
return new ModelResourceLocation(name + "_pulling_1", "inventory");
|
||||
|
||||
return new ModelResourceLocation(name, "inventory");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user