Jump to content

EmperorZelos

Members
  • Posts

    148
  • Joined

  • Last visited

Everything posted by EmperorZelos

  1. I am working on my own kind of fluid blocks, partially because I think it's fun and partially because the current ones are utter shite in my opinion. I was working on it, getting the ISBRH being called and such, now however, it's never being called, I can go into debugging and it never gets called what so ever. I have checked the client registry thing, it is being registered and all but I simply cannot get it to be called for some reason, suggestions? What have I missed? Block: package aerosteam.fluid.liquid; import java.util.ArrayList; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.util.Vec3; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import aerosteam.AeroSteam; import aerosteam.blocks.BlocksGases; import aerosteam.blocks.BlocksLiquids; import aerosteam.functions.GeneralFunctions; import aerosteam.functions.OmniDirection; import aerosteam.proxy.ClientProxy; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockLiquid extends Block{ boolean source = false; private static int c = 0; BlockLiquid product; private float density; public static ForgeDirection[] forgeSides = {ForgeDirection.NORTH,ForgeDirection.WEST,ForgeDirection.SOUTH,ForgeDirection.EAST}; private OmniDirection[] omniSides = OmniDirection.ORDERED_LEVEL; private ForgeDirection[] omniToForge = {ForgeDirection.NORTH,ForgeDirection.NORTH,ForgeDirection.WEST,ForgeDirection.WEST,ForgeDirection.SOUTH,ForgeDirection.SOUTH,ForgeDirection.EAST,ForgeDirection.EAST}; public int maxFlow = 5; public BlockLiquid() { super(Material.water); BlocksLiquids.nrLiquids++; } public BlockLiquid setSource(Block liquid) { BlocksLiquids.nrSources++; this.product = (BlockLiquid) liquid; this.setCreativeTab(AeroSteam.gasTab); this.source = true; return this; } public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { return null; } public void velocityToAddToEntity(World world, int x, int y, int p_14964z0_4_, Entity ent, Vec3 vec) { } private ForgeDirection addDir(ForgeDirection dir1, ForgeDirection dir2){ if (dir1==ForgeDirection.DOWN || dir2 == ForgeDirection.DOWN) return ForgeDirection.DOWN; if (dir1==null) return dir2; if (dir2==null) return dir1; int i1 = dir1.ordinal()-2; int i2 = dir2.ordinal()-2; int d = (i2+i2)&6+2; return ForgeDirection.VALID_DIRECTIONS[d]; } public int flowDist(World world, int x, int y, int z){ c++; Block t = world.getBlock(x, y, z); if (!(t instanceof BlockLiquid)) return 0; BlockLiquid block = (BlockLiquid) t; if (block != this && block.product != this) return 0; if (block.source) return maxFlow; // Determines how far it can go int meta = world.getBlockMetadata(x, y, z); if (meta > 7) return 0; ForgeDirection dir = this.omniToForge[meta].getOpposite(); int r = c < 7 ? flowDist(world,x+dir.offsetX,y+dir.offsetY,z+dir.offsetZ)-1 : -5; c=0; if (r==-5){ System.out.println("bollcoks"); } return r > 0 ? r : 0; } private OmniDirection getDir(World world, int x, int y, int z){ int[] weight = new int[4]; for (int i=0;i<4;i++){// ForgeDirection check = this.forgeSides[i]; Block block = world.getBlock(x+check.offsetX, y+check.offsetY, z+check.offsetZ); if (block instanceof BlockLiquid){ BlockLiquid liq = (BlockLiquid) block; if (liq == this || liq.product == this){ weight[i] = flowDist(world,x+check.offsetX, y+check.offsetY, z+check.offsetZ); //test } }else if (block == Blocks.air){ } } OmniDirection dir=null; int we = weight[1]-weight[3]; //west - east int ns = weight[0]-weight[2]; //north - south int axdif = Math.abs(ns)-Math.abs(we); if (axdif == 0){ if (ns > 0 && we > 0 ) dir = OmniDirection.NORTHWEST; if (ns > 0 && we < 0) dir = OmniDirection.NORTHEAST; if (ns < 0 && we > 0) dir = OmniDirection.SOUTHWEST; if (ns < 0 && we < 0) dir = OmniDirection.SOUTHEAST; }else{ if (axdif > 0){ if (ns > 0) dir = OmniDirection.NORTH; if (ns < 0) dir = OmniDirection.SOUTH; }else{ if (we < 0) dir = OmniDirection.EAST; if (we > 0) dir = OmniDirection.WEST; } } return dir != null ? dir.getOpposite():null; } private int dirID(OmniDirection dir){ for (int i=0;i<8;i++){ if (dir == this.omniSides[i]) return i; } return 8; } @Override public void onBlockAdded(World world, int x, int y, int z) { world.scheduleBlockUpdate(x,y,z, this, 10); } @Override public void updateTick(World world, int x, int y, int z, Random rnd){ updateLiqState(world,x,y,z); /*ForgeDirection dir = null; for (ForgeDirection check: this.sides){ Block block = world.getBlock(x+check.offsetX, y+check.offsetY, z+check.offsetZ); if (block == this){ dir = addDir(dir,check.getOpposite()); }else if (block == Blocks.air){ } }*/ } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityplayer,ItemStack itemstack){ if (this.source){ for (int i = 0; i< this.forgeSides.length;i++){ ForgeDirection check = this.forgeSides[i]; Block block = world.getBlock(x+check.offsetX, y+check.offsetY, z+check.offsetZ); if (block == Blocks.air){ world.setBlock(x+check.offsetX, y+check.offsetY, z+check.offsetZ, this.product,2*i,2); world.scheduleBlockUpdate(x+check.offsetX, y+check.offsetY, z+check.offsetZ, this.product, 10); } } } } private void updateLiqState(World world, int x, int y, int z){ int meta = dirID(getDir(world,x,y,z)); world.setBlockMetadataWithNotify(x, y, z, meta, 2); int flow = flowDist(world,x,y,z); ForgeDirection dir = null; if (flow > 1){ for (ForgeDirection check: this.forgeSides){ Block block = world.getBlock(x+check.offsetX, y+check.offsetY, z+check.offsetZ); if (block instanceof BlockLiquid){ BlockLiquid liq = (BlockLiquid) block; if (liq == this || liq.product == this){ } dir = addDir(dir,check.getOpposite()); }else if (block == Blocks.air){ OmniDirection d = getDir(world,x+check.offsetX, y+check.offsetY, z+check.offsetZ); int nmeta = dirID(d); Block liq = this.source ? this.product:this; world.setBlock(x+check.offsetX, y+check.offsetY, z+check.offsetZ, liq, nmeta, 2); } } }else if (flow == 0){ world.setBlock(x, y, z, Blocks.air); } } public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { if (!this.source){ if (block instanceof BlockLiquid){ BlockLiquid liq = (BlockLiquid) block; } world.scheduleBlockUpdate(x,y,z, this, 10); } } public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) {} /** * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z */ @SideOnly(Side.CLIENT) public int getMixedBrightnessForBlock(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) { int l = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, 0); int i1 = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_ + 1, p_149677_4_, 0); int j1 = l & 255; int k1 = i1 & 255; int l1 = l >> 16 & 255; int i2 = i1 >> 16 & 255; return (j1 > k1 ? j1 : k1) | (l1 > i2 ? l1 : i2) << 16; } /** * The type of render function that is called for this block */ /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return ClientProxy.liquidRenderType; } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister icon) { this.blockIcon = icon.registerIcon(AeroSteam.MODID + ":" + "water"); } public boolean isOpaqueCube() { return false; } @Override public boolean canRenderInPass(int pass) { //Set the static var in the client proxy //ClientProxy.renderPass = pass; //the block can render in both passes, so return true always return pass == 1; } @Override public int getRenderBlockPass() { return 1; } } Client Proxy: public void setCustomRenderers() { gasRenderType = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new RenderBlockGases()); liquidRenderType = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new RenderBlockLiquid()); }
  2. I have noticed if I use GL11.glDisable(GL11.GL_LIGHTING); it looks good from the sides but underneath it gets too bright then.
  3. I am having problem with a custom rendering, I am using it to render blocks seemingly normally but with great diversity in a simple manner. The issue is that the sides come out darkened http://i1310.photobucket.com/albums/s644/EmperorZelos/2015-08-22_12.32.45_zpsvfkcwpoe.png[/img] Like this, this is my code package aerosteam.renderer.blocks; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; import aerosteam.AeroSteam; import aerosteam.model.blocks.ModelBarrel; import aerosteam.recipes.Beverages; import aerosteam.tileentity.TileEntityBarrel; public class RenderPipeBlock extends TileEntitySpecialRenderer{ float[] dx = {0.5F,0.5F,0F,0F,0.5F,0.5F}; float[] dy = {0F,0F,0.5F,0.5F,0.5F,0.5F}; float[] dz = {0.5F,0.5F,0.5F,0.5F,0F,0F}; Block test = Blocks.brick_block; public RenderPipeBlock(){ } @Override public void renderTileEntityAt(TileEntity entity, double x,double y, double z, float f) { //TileEntityBarrel barrel = (TileEntityBarrel) entity; IIcon icon = test.getIcon(5, 6); Tessellator t = Tessellator.instance; float minU = icon.getMinU(); float minV = icon.getMinV(); float maxU = icon.getMaxU(); float maxV = icon.getMaxV(); int sizeX = 16; int sizeY = 16; Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); GL11.glPushMatrix(); //GL11.glTranslatef((float)x+0.5F, (float)y+1.5F, (float)z+0.5F); //GL11.glRotatef(180, 0F, 0F, 1F); GL11.glTranslated(x, y, z); //GL11.glEnable(GL11.GL_BLEND); t.startDrawingQuads(); t.addVertexWithUV(1, 1, 0, minU, minV); //Top right t.addVertexWithUV(1, 0, 0, minU, maxV); //Bottom right t.addVertexWithUV(0, 0, 0, maxU, maxV); //Bottom left texture t.addVertexWithUV(0, 1, 0, maxU, minV); //Top left t.draw(); GL11.glPopMatrix(); } public void renderItem(TileEntity entity){ TileEntityBarrel ana = (TileEntityBarrel) entity; renderTileEntityAt(ana,0D,-0.5D,0D,0F); } } What is it missing that is causing this darkening? The "isOpaque" is set to false also.
  4. if I recall correctly NBT only works on stacks.
  5. Never crossed my mind, which are possible? And if both how are both done?
  6. Storing information in tile entities and get it back when the server loads (or chunk in their case) is relatively trivial. My question is, what if I want to have global variables? Like if one did some form of gate system to store the adresses which are then reloaded everytime the server is booted up again?
  7. Using it I can render the item but it seems to want to do a 3D model of it in the world =/ Which is not what I want sadly
  8. Which I have dangerously low experience with unfortunately, do you know any guide that can make this work where I can get the icon and all rendered and shown? If I got that far I could play around and learn it.
  9. Ah I found it, I use TileEntitySpecialRenderer
  10. I have looked into that one but I am uncertain how to render it on a Tessellator
  11. While that does certainly give me the texture of the block, it unfortunately does not give me the icon of the block one sees in the inventory. I mean the 3D rendition in the inventory one see of blocks, like for hte anvil and such.
  12. When I use blocks I get it trying to render items that is somewhere along and it doesn't seem to fit. ItemStack stack = new ItemStack(Item.getItemFromBlock(Blocks.brick_block), 1, 0); drawIcon(0,0,stack.getIconIndex(),ForgeDirection.SOUTH); private void drawIcon(int posX, int posY, IIcon icon, ForgeDirection side){ Tessellator t = Tessellator.instance; float minU = icon.getMinU(); float minV = icon.getMinV(); float maxU = icon.getMaxU(); float maxV = icon.getMaxV(); int sizeX = 16; int sizeY = 16; GL11.glTranslated(posX, posY, 0.0D); //GL11.glBindTexture(TextureMap.locationItemsTexture); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); //GL11.glEnable(GL11.GL_BLEND); t.startDrawingQuads(); t.addVertexWithUV(0, 0, 0, minU, maxV); //Bottom left texture t.addVertexWithUV(0, 1, 0, maxU, maxV); //Top left t.addVertexWithUV(1, 1, 0, maxU, minV); //Top right t.addVertexWithUV(1, 0, 0, minU, minV); //Bottom right /*t.addVertexWithUV(posX, posY+sizeY, 0D, minU, maxV); t.addVertexWithUV(posX + sizeX, posY + sizeY, 1D, maxU, maxV); t.addVertexWithUV(posX + sizeX, posY + 0, 1D, maxU, minV); t.addVertexWithUV(posX + 0, posY + 0, 0.0D, minU, minV);*/ t.draw(); }
  13. does that include ALL items, including those added by mods? Edit: It seems to work for that so thank you, but what about the icon of blocks? As they are rendered in inventories
  14. Hello! I am currently trying to make a block that shows the item content within it. I know how to get the item and all so that's not an issue. My issue is when it comes to rendering, I just cannot figure out a manner at which I grab the rendered icon for an item in inventory and render it on Tessellator. I have gotten a tessellator running but the issue is getting the texture. How would I do this for a given item or stack? Best regards and thanks in advance.
  15. I am trying to make an illusion block, I know it has been done but half the fun is trying to do it yourself and figure out things. Unfortunately I am stuck at something. When I have the blocks placed in 1 high, either along the ground or one block above the ground it works fine, I can walk straight through the block and nothing happens, however when I put them it such that there is 1 block on the ground and then another block ontop of that, making them together 2 blocks high. THere is suddenly a wall on one of the sides of this 1 by 2 pile that I can't pass through and if I enter any other side it pushes me in the direction of this side I can't pass through. WHen I am in survival mode I ahve noticed however this is causing me damage so I am presuming I need to fix it so you can breath in it like it was air or something, I just seem to have trouble finding the proper function for that. What am I missing that would allow me to fix this? package aerosteam.blocks.magic; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import aerosteam.AeroSteam; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class MagicIllusion extends Block{ @SideOnly(Side.CLIENT) private IIcon Icon; public MagicIllusion() { super(Material.rock); this.setCreativeTab(AeroSteam.aeroTab); this.setBlockBounds(0, 0, 0, 0, 0, 0); // TODO Auto-generated constructor stub } @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { IIcon icon=this.blockIcon; int meta = world.getBlockMetadata(x, y, z); if (meta <6){ ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[meta]; Block block = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (block.getRenderType() == 0) icon = block.getIcon(world, x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ, side); } return icon; } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister icon) { this.blockIcon = icon.registerIcon(AeroSteam.MODID + ":" + "illusion"); } public int getRenderType(){ return 0; } public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side){ return true; } public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityplayer,ItemStack itemstack){ int l = MathHelper.floor_double((double)(entityplayer.rotationYaw * 4.0F/360.F)+0.5D) & 3 ; int t = MathHelper.floor_double((double)(entityplayer.rotationPitch * 4.0F/360.F)+0.5D) & 3; ForgeDirection dir = getDir(t,l); Block block = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (isBlockValid(block)){ if (!isCircular(world,x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ,x,y,z)){ world.setBlockMetadataWithNotify(x, y, z, metaForge(dir), 2); return; } } for (int i = 0;i<6;i++){ dir = ForgeDirection.VALID_DIRECTIONS[i]; block = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (isBlockValid(block)){ world.setBlockMetadataWithNotify(x, y, z, i, 2); return; } } } public boolean isBlockValid(Block block){ return block != Blocks.air && block.getRenderType() == 0; } public int metaForge(ForgeDirection dir){ for (int i=0;i<6;i++){ if (ForgeDirection.VALID_DIRECTIONS[i]==dir) return i; } return 7; } public ForgeDirection getDir(int t, int l){ if (t==1) return ForgeDirection.DOWN; if (t==3) return ForgeDirection.UP; if (l==0) return ForgeDirection.SOUTH; if (l==1) return ForgeDirection.WEST; if (l==2) return ForgeDirection.NORTH; if (l==3) return ForgeDirection.EAST; return null; } public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){ int meta = world.getBlockMetadata(x, y, z); for (int i = 1;i<7;i++){ int delta = (meta + i) % 6; ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[delta]; Block block = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (isBlockValid(block)){ if (!isCircular(world,x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ,x,y,z)){ world.setBlockMetadataWithNotify(x, y, z, delta, 2); break; } } } //System.out.println("meta: " + meta); return false; } public void onNeighborBlockChange(World world, int x, int y, int z, Block block){ int meta = world.getBlockMetadata(x, y, z); if (meta < 6){ ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[meta]; if (world.isAirBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ)){ for (int i = 1;i<7;i++){ int delta = (meta + i) % 6; dir = ForgeDirection.VALID_DIRECTIONS[delta]; Block blocky = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (isBlockValid(blocky)){ if (!isCircular(world,x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ,x,y,z)){ world.setBlockMetadataWithNotify(x, y, z, delta, 2); return; } } } world.setBlockMetadataWithNotify(x, y, z, 6, 2); } }else{ ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[0]; for (int i = 0;i<6;i++){ dir = ForgeDirection.VALID_DIRECTIONS[i]; Block test = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (isBlockValid(test)){ world.setBlockMetadataWithNotify(x, y, z, i, 2); return; } } } } public boolean isCircular(World world,int x,int y,int z,int sX,int sY,int sZ){ if (sX==x && sY==y & sZ==z) return true; int meta = world.getBlockMetadata(x, y, z); ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[meta]; Block block = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (block != this) return false; return isCircular(world,x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ,sX,sY,sZ); } public Block source(World world,int x,int y,int z){ int meta = world.getBlockMetadata(x, y, z); ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[meta]; Block kern = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (kern==this){ kern = source(world,x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); } return this; } /*public Block source(World world,int x,int y,int z){ int meta = world.getBlockMetadata(x, y, z); ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[meta]; Block block = world.getBlock(x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); if (block==this){ return source(world,x+dir.offsetX, y+dir.offsetY, z+dir.offsetZ); } return this; }*/ public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { return null; } public boolean isOpaqueCube() { return false; } public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { this.setBlockBounds(0,0,0,1,1,1); } }
  16. I am working on making a spear weapon and I can't make my model be rendered. In the initial code I have RenderingRegistry.registerEntityRenderingHandler(ProjectileSpear.class, new RenderSpear(new ModelSpear(), 0)); I have used things to check that it is being registered, both debugging and such so I know this one is executed, it is executed along with another mob model I have which IS being rendered properly. This is my render file package aerosteam.renderer.mob; import org.lwjgl.opengl.GL11; import aerosteam.AeroSteam; import aerosteam.mobs.MobThief; import aerosteam.model.mobs.ModelThief; import aerosteam.model.various.ModelBullet; import aerosteam.model.various.ModelSpear; import aerosteam.projectiles.ProjectileBullet; import aerosteam.projectiles.ProjectileSpear; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; public class RenderSpear extends Render { private static final ResourceLocation textureStone = new ResourceLocation(AeroSteam.MODID + ":" + "textures/model/SpearStone.png"); private static final ResourceLocation textureWooden = new ResourceLocation(AeroSteam.MODID + ":" + "textures/model/SpearWooden.png"); protected ModelSpear modelEntity; public RenderSpear(ModelBase model, float f) { super(); modelEntity=((ModelSpear) model); System.out.println("Register Spear"); } public void doRender(Entity entity, double x, double y, double z, float u, float v){ System.out.println("Spear is rendering"); GL11.glPushMatrix(); GL11.glTranslatef((float)x+0.0F,(float)y-0.875F,(float)z+0.0F); this.bindTexture(textureStone); GL11.glPushMatrix(); this.modelEntity.renderModel(0.0625F*1F); GL11.glPopMatrix(); GL11.glPopMatrix(); } public void renderSpear(ProjectileSpear entityarrow, double d, double d1, double d2, float f, float f1) /* */ { System.out.println("Spear is rendering-2"); /* 18 */ /* */ } public void func_76986_a(Entity entity, double d, double d1, double d2, float f, float f1) /* */ { /* 99 */ renderSpear((ProjectileSpear)entity, d, d1, d2, f, f1); /* */ } @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { System.out.println("Spear texture"); return textureStone; } } As you can see I have it giving text to write when certain things are meant to appear, sadly only "register spear" is the one showing up, none of the others are beign activated strangely enough. What am I doing wrong here?
  17. I have also tried doing this to mimic my remove recipie algorithm...no success. private static void removeBiome(BiomeGenBase biome){ List<BiomeEntry> biomes = BiomeManager.warmBiomes; Iterator<BiomeEntry> check = biomes.iterator(); while (check.hasNext()){ BiomeGenBase checkBiome = check.next().biome; if (checkBiome == biome){ check.remove(); } } } }
  18. removeSpawnBiome? I tried it, the biome still popped up
  19. Hello! I want to refine the vanilla biomes nad I'd like to remove htem so I can readd my own, how would I go about it exacly? I ahve looked through the source code but I can't find anything that removes them. I might just be blind, do you have any suggestions? Best regards
  20. I am interested in adding slight differenses to normal biomes, is there aw ay to replace them in generation?
  21. Also it says that the dynamic light one is configurable, does that mean I can make a config file of it that supports my stuff?
  22. Doing it the "Dynamic Lights" way would most likely be more efficient, but requires a pretty hacky coremod. I don't recommend it. why not?
  23. is either preferable or do they result in roughly the same amount of processing?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.