Blood pendant, enchanted soil, enchanter, open bucket, prism, fix some rendering

This commit is contained in:
Vincent Lee committed 2015-12-27 16:52:30 -06:00
1 parent 5b1ac0368d
commit e83d1600cf
21 files changed
+120 -19

No files matched your search

@@ -136,7 +136,7 @@ public final class BaubleRenderHandler {
// ItemRenderer.renderItemIn2D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
//
// Color color = new Color(item.getColorFromItemStack(stack, 1));
// GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
// GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
// }
GlStateManager.popMatrix();
@@ -114,7 +114,7 @@ public final class BoundTileRenderer {
GlStateManager.pushMatrix();
GlStateManager.translate(pos.getX() - getRenderPosX(), pos.getY() - getRenderPosY(), pos.getZ() - getRenderPosZ() + 1);
Color colorRGB = new Color(color);
GlStateManager.color((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 255);
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 255);
World world = Minecraft.getMinecraft().theWorld;
Block block = world.getBlockState(pos).getBlock();
@@ -259,7 +259,7 @@ public final class HUDHandler {
}
Color color = new Color(Color.HSBtoRGB(0.55F, (float) Math.min(1F, Math.sin(System.currentTimeMillis() / 200D) * 0.5 + 1F), 1F));
GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) (255 - color.getRed()));
GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) (255 - color.getRed()));
mc.renderEngine.bindTexture(manaBar);
GlStateManager.enableBlend();
@@ -484,7 +484,7 @@ public final class HUDHandler {
RenderHelper.drawTexturedModalRect(x + 1, y + 1, 0, 0, 5, 100, 3);
Color color_ = new Color(color);
GlStateManager.color((byte) color_.getRed(), (byte) color_.getGreen(),(byte) color_.getBlue(), (byte) (255F * alpha));
GL11.glColor4ub((byte) color_.getRed(), (byte) color_.getGreen(),(byte) color_.getBlue(), (byte) (255F * alpha));
RenderHelper.drawTexturedModalRect(x + 1, y + 1, 0, 0, 5, Math.min(100, manaPercentage), 3);
}
}
@@ -123,6 +123,7 @@ public final class ModelHandler {
registerBows();
registerLens();
registerItemModelAllMeta(laputaShard, 20);
registerItemModelAllMeta(signalFlare, EnumDyeColor.values().length);
registerItemModelAllMeta(dye, EnumDyeColor.values().length);
registerItemModelAllMeta(petal, EnumDyeColor.values().length);
@@ -217,6 +218,9 @@ public final class ModelHandler {
registerItemModel(ModBlocks.forestEye);
registerItemModel(ModBlocks.seaLamp);
registerItemModel(ModBlocks.cellBlock);
registerItemModel(ModBlocks.enchantedSoil);
registerItemModel(ModBlocks.enchanter);
registerItemModel(ModBlocks.prism);
// Item models which all use the same base model and recolored by render layer
registerItemModelAllMeta(Item.getItemFromBlock(ModBlocks.unstableBlock), EnumDyeColor.values().length);
@@ -299,6 +303,10 @@ public final class ModelHandler {
registerItemModel(tornadoRod);
ModelLoader.registerItemVariants(tornadoRod, new ModelResourceLocation("botania:tornadoRod_flying", "inventory"));
registerItemModel(openBucket);
registerItemModel(bloodPendant);
}
private static void registerManaResources() {
@@ -102,7 +102,7 @@ public final class SubTileRadiusRenderHandler {
int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F);
Color colorRGB = new Color(color);
GlStateManager.color((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 32);
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 32);
double f = 1F / 16F;
double x = aabb.maxX - aabb.minX - f;
@@ -119,7 +119,7 @@ public final class SubTileRadiusRenderHandler {
x += f;
z += f;
double f1 = f + f / 4F;
GlStateManager.color((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64);
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64);
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
tessellator.getWorldRenderer().pos(x, f1, 0).endVertex();
tessellator.getWorldRenderer().pos(0, f1, 0).endVertex();
@@ -139,7 +139,7 @@ public final class SubTileRadiusRenderHandler {
int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F);
Color colorRGB = new Color(color);
GlStateManager.color((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 32);
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 32);
double f = 1F / 16F;
@@ -162,7 +162,7 @@ public final class SubTileRadiusRenderHandler {
radius += f;
double f1 = f + f / 4F;
GlStateManager.color((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64);
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64);
tessellator.getWorldRenderer().begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION);
tessellator.getWorldRenderer().pos(0, f1, 0).endVertex();
for(int i = 0; i < totalAngles + 1; i += step) {
@@ -87,7 +87,7 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer {
// IIcon icon = stack.getItem().getIcon(stack, renderPass);
// if(icon != null) {
// Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
// GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
// GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
// float f = icon.getMinU();
// float f1 = icon.getMaxU();
// float f2 = icon.getMinV();
@@ -73,7 +73,7 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer {
// IIcon icon = stack.getItem().getIcon(stack, renderPass);
// if(icon != null) {
// Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
// GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
// GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
// float f = icon.getMinU();
// float f1 = icon.getMaxU();
// float f2 = icon.getMinV();
@@ -12,6 +12,7 @@ package vazkii.botania.client.render.tile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
@@ -41,8 +42,8 @@ public class RenderTilePrism extends TileEntitySpecialRenderer {
ILens lens = (ILens) stack.getItem();
GlStateManager.pushMatrix();
GlStateManager.rotate(90F, 1F, 0F, 0F);
GlStateManager.translate(0F, 0F, pos);
// todo 1.8 RenderLens.render(stack, lens.getLensColor(stack));
GlStateManager.translate(0.5F, 0.5F, pos);
Minecraft.getMinecraft().getRenderItem().func_181564_a(stack, ItemCameraTransforms.TransformType.NONE);
GlStateManager.popMatrix();
}
}
@@ -48,7 +48,7 @@ public class RenderTileSparkChanger extends TileEntitySpecialRenderer {
// IIcon icon = stack.getItem().getIcon(stack, renderPass);
// if(icon != null) {
// Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
// GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
// GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
// float f = icon.getMinU();
// float f1 = icon.getMaxU();
// float f2 = icon.getMinV();
@@ -78,7 +78,7 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex
@Override
public int getMetaFromState(IBlockState state) {
switch (((EnumFacing.Axis) state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION))) {
switch (state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION)) {
case Z: return 1;
case X:
default: return 0;
@@ -80,7 +80,7 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
@Override
@SideOnly(Side.CLIENT)
public EnumWorldBlockLayer getBlockLayer() {
return EnumWorldBlockLayer.CUTOUT_MIPPED; // todo 1.8
return EnumWorldBlockLayer.TRANSLUCENT;
}
@Override
@@ -123,7 +123,6 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
prism.setInventorySlotContents(0, null);
prism.markDirty();
par1World.setBlockState(pos, state.withProperty(BotaniaStateProps.HAS_LENS, false), 1 | 2);
// par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 14, 1 | 2);
}
return true;
@@ -457,7 +457,7 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
IIcon icon = slotStack.getItem().getIcon(slotStack, renderPass);
if(icon != null) {
Color color = new Color(slotStack.getItem().getColorFromItemStack(slotStack, renderPass));
GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
@@ -45,7 +45,7 @@ public class ItemOpenBucket extends ItemMod {
return par1ItemStack;
Material material = par2World.getBlockState(pos).getBlock().getMaterial();
int l = par2World.getBlockState(pos).getValue(BlockLiquid.LEVEL);
int l = par2World.getBlockState(pos).getBlock().getMetaFromState(par2World.getBlockState(pos)); // hack to get meta so we don't have to know the level prop
if((material == Material.lava || material == Material.water) && l == 0) {
par2World.setBlockToAir(pos);
@@ -181,7 +181,7 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre
ItemRenderer.renderItemIn2D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F);*/
Color color = new Color(getColorFromItemStack(stack, 1));
GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
int light = 15728880;
int lightmapX = light % 65536;
int lightmapY = light / 65536;
@@ -0,0 +1,16 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_bottom_top",
"textures": {
"bottom": "minecraft:blocks/dirt",
"top": "botania:blocks/enchantedSoil0",
"side": "botania:blocks/enchantedSoil1"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}
@@ -0,0 +1,15 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "botania:blocks/enchanter"
},
"transform": "forge:default-block"
},
"variants": {
"facing=x": [{}],
"facing=z": [{}],
"inventory": [{}]
}
}
@@ -0,0 +1,23 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:prism",
"textures": {
"bottom": "botania:blocks/prism0",
"top": "botania:blocks/prism0",
"side": "botania:blocks/prism1"
},
"transform": "forge:default-block"
},
"variants": {
"inventory": [{}],
"powered": {
"true": {},
"false": {}
},
"has_lens": {
"true": {},
"false": {}
}
}
}
@@ -0,0 +1,20 @@
{
"textures": {
"particle": "#side"
},
"elements": [
{
"name": "Cube",
"from": [ 4, 0, 4 ],
"to": [ 12, 16, 12 ],
"faces": {
"down": { "texture": "#bottom", "uv": [ 4, 4, 12, 12 ], "cullface": "down" },
"up": { "texture": "#top", "uv": [ 4, 4, 12, 12 ], "cullface": "up" },
"north": { "texture": "#side", "uv": [ 4, 0, 12, 16 ] },
"south": { "texture": "#side", "uv": [ 4, 0, 12, 16 ] },
"west": { "texture": "#side", "uv": [ 4, 0, 12, 16 ] },
"east": { "texture": "#side", "uv": [ 4, 0, 12, 16 ] }
}
}
]
}
@@ -0,0 +1,7 @@
{
"parent": "botania:item/standard_item",
"textures": {
"layer0": "botania:items/bloodPendant0",
"layer1": "botania:items/bloodPendant1"
}
}
@@ -0,0 +1,6 @@
{
"parent": "botania:item/standard_item",
"textures": {
"layer0": "botania:items/laputaShard"
}
}
@@ -0,0 +1,6 @@
{
"parent": "botania:item/standard_item",
"textures": {
"layer0": "botania:items/openBucket"
}
}