
vilu
Forge Modder-
Posts
84 -
Joined
-
Last visited
Everything posted by vilu
-
That's because you are returning null in your gui handler for client. Return gui for client and container for server.
-
You should use lowercase foldernames in assets dir and also in code, mod id should be lowercased.
-
[1.7.10] TileEntitySpecialRenderer Rendering problem
vilu replied to a3626a's topic in Modder Support
I got an idea that you could try. It seems like you are rendering your model part by part. Try render only one part first and comment out everything else (means that you would call getIcon(...) only once in render code). Check if it renders correctly then and if so, include next piece of model to be rendered. This could help you to determinate where the actual problem is or does the problem apply to whole rendering code. -
[1.7.10] TileEntitySpecialRenderer Rendering problem
vilu replied to a3626a's topic in Modder Support
I just checked images you posted and I see that it's not the lighting problem as I thought (Except if it renders as it should but it becomes dark when player watches it from certain angles). How does this problem happen exactly? Does your texture change as shown in your images when changing view angle or how? When it changes does it change back (flickers between correct texture and abnormal texture)? -
Check vanilla's GuiButton and how it works. Basicly it checks if your mouse cursor is over the button boundaries and changes hover texture if so. You can just extend GuiButton or FML's GuiButtonExt (which is by the way little bit better than Vanilla one) and bind your own texture.
-
[1.7.10] TileEntitySpecialRenderer Rendering problem
vilu replied to a3626a's topic in Modder Support
I think you should read about consept of the OpenGL. Do some googling to find out how OpenGL works, how and when you should use glPushMatrix. You asked where to insert that piece of code, well, you should insert it so that it would be applied to parts that has lighting issues. -
[1.7.10] TileEntitySpecialRenderer Rendering problem
vilu replied to a3626a's topic in Modder Support
Try this after pushing matrix: GL11.glDisable(GL11.GL_CULL_FACE); Tessellator tessellator = Tessellator.instance; int brightness = tileentity.getBlockType().getMixedBrightnessForBlock(tileentity.getWorldObj(), tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); tessellator.setBrightness(brightness); tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); -
Question About Binding Textures to Techne Models
vilu replied to MadTinkerer's topic in Modder Support
Sorry for that =D I just woke up and having flu so it is hard to stay calm =D Ok but you got the idea? Check the YourModel#render(..) and how it renders those boxes so you understand how you can render things in multiple parts and even rotate and scale those parts as needed without having them affecting other already rendered parts. -
Question About Binding Textures to Techne Models
vilu replied to MadTinkerer's topic in Modder Support
argh... If you don't want to try what I just said then ok.. But this is something I just did without using tessellator and with method I explained: This thing can be turned off (then there is no rotating blue cubes and light indicator on the front turns from green to red) -
Question About Binding Textures to Techne Models
vilu replied to MadTinkerer's topic in Modder Support
Like I said, you don't have to use tessellator if you don't want to. You just render your model in two parts; you have in your model.java file method named render(...) right? There are names you have given in techne for each parts. Create new method, for example, renderTankContent() and move things you want to render depending on tileentity data to there. Then you just check in your tileentity special renderer you first call yourmodel#render(...) and then check if it should render it with content or not, if so, bind texture for content and render content. Here is the whole idea how to do this: tileentity special renderer#renderTileEntityAt(...) --rotate and scale model as needed-- --bind texture-- model#render(...) --check if tileentity#hasFluid, and if so: -- --bind texture-- model#renderTankContent() -
Question About Binding Textures to Techne Models
vilu replied to MadTinkerer's topic in Modder Support
@LordMastodonFTW: Oh, ok...that makes sense. -
Question About Binding Textures to Techne Models
vilu replied to MadTinkerer's topic in Modder Support
It doesn't matter whether you use Techne or not. If you have custom renderer you can decide what you render and how you render it. This is how I would do it: Render it in two parts, first the solid (empty) tank and if there it's not empty (you check that from your tileentity in your renderer's renderTileEntityAt(...) method) then you render fluid and bind fluid specific texture. You can decide do you want to use tessellator for that or not. LoardMastodonFTW: What do you mean by suggesting using the Tessellator? -
Check your recipes class and there the method named getSmeltingResult(String). It seems like you are calling it by using ItemStack as parameter and method is expecting String.
-
What part exactly you don't understand in EntityTameable? Have you considered to extend EntityTameable so you would have already parts of code for taming entity?
-
Like I said, check how EntityWolf does that. It extends EntityTameable and EntityTameable#readEntityFromNBT has code that restores owner.
-
In your Entity's writeEntityFromNBT you store player's name or UUID and in readEntityFromNBT you read it and set it back. Just look how horses or wolfes stores owner info.
-
It's because you haven't add any AI tasks, so put this.tasks.addTask(1, new EntityAIWander(this, 1.0D)); to your constructor as well.
-
In the Entity constructor try this: public EntityUndeadMage(World world, EntityPlayer player, double x, double y, double z){ super(world); setSize(1.0F, 1.0F); setPosition(x, y, z); prevPosX = x; prevPosY = y; prevPosZ = z; }
-
Try adding 0.5F or 1.0F to Y-coordinate and let me know what happens.
-
You should spawn it on server side only and away from player position. You are now trying to spawn it on both sides (client and server) and inside of players bounding box.
-
I think that if you set variables on the server side and then trigger markBlockForUpdate in TileEntity#updateEntity it saves variables to nbt on the server side and then sends changed variables to the client side. I think that you don't need to call markBlockForUpdate in client side... Like TheGreyGhost said below, you should call markBlockForUpdate in client side as well.
-
In TileEntity's read and write nbt parts use variable to save value. Then if you do World#markBlockForUpdate on both sides (client and server) you should get same value to client side as well when updating block.
-
It triggers once only. Once for client and once for server so it may seem like it triggers twice. When printing debugging lines to console you should always check the side as well (for example if you have World reference, check is World.isRemote returns true or false). To archive desired effect you should decide do you want to use metadata or nbt to store data for texture. If it is just the texture metadata is easiest way to do so. So you store that data in right-click method and in renderer you retrive that data by getting it from block (metadata for example, TileEntity.getWorldObj().getBlockMetadata(.... ) and then check what it is and set correct texture.
-
It floats like regular mobs would? Do you mean like EntityGhast or like entities which can swim or what? Show the part of your code that doesn't work. It really depends your needs if you should create AI task for it. If your entity should not be very smart with moving (like pathfinding around the obstacles) you can do basic moving without AI tasks.
-
You should use super class depending your needs so do comparing between classes. Look tutorials for custom mob rendering, that should help you with rendering. And no, you cannot use MC pathfinding for flying entities because pathfinder is made for entities in the ground so it tries to create path that is on the ground. You can create your own pathfinder AI task or use something from EntityGhast. With trigonometry you can create lines that are more "natural" or again, check how EntityGhast changes its position.