
Alron
Forge Modder-
Posts
25 -
Joined
-
Last visited
Everything posted by Alron
-
Thanks. I'll see if I can find out how the .tnc file is structured. A shame though that the old minecraft models no longer work.
-
Alright, I might take a look at that. Any pointers on where to start learning about making a custom model loader?
-
So there is still no way to render items in the inventory through a TESR or something similar? Do all models of items now have to be done via json files or obj files etc?
-
[1.7.10]problem with server won'y run , infinity 2.3.0
Alron replied to liliexx's topic in Support & Bug Reports
Since you are running FTB Infinity, you should propably go to the FTB forums http://forum.feed-the-beast.com/forum/tech-support.210/. I doubt that people here can help you. -
Hi, Is there a way to register an Item with my own ISmartModel, so that it shows up in my inventory using that model? As of now I hve only seen how to do it with a ModelResourceLocation. Or alternatively a way to render the Item with a TileEntitySpecialRenderer. I would hate to convert all my Techne models to json models if there is a way to avoid that.
-
Thanks. Will try to make it work without.
-
Hi I want to use a couple APIs for the mod I'm currently making, so I followed a tutorial (https://raw.githubusercontent.com/coolAlias/Forge_Tutorials/master/ModdingWithAPIs.java) on how to use them. Loaded the Buildcraft api in and minecraft runs nicely. Now the problem is that I want the mod to work even without any other mods installed, so I use the @Optional annotations: @Optional.InterfaceList(value={ @Optional.Interface(iface="buildcraft.api.power.IPowerReceptor", modid="BuildCraft|Energy", striprefs=true) }) public class TileEntityPowerReceptor extends TileEntity implements IPowerReceptor{ //is that gonna work without bc? public PowerHandler BCPowerHandler = new PowerHandler(this, PowerHandler.Type.MACHINE); private int power; public TileEntityPowerReceptor(){ } @Method(modid="BuildCraft|Energy") @Override public PowerReceiver getPowerReceiver(ForgeDirection side) { return BCPowerHandler.getPowerReceiver(); } @Method(modid="BuildCraft|Energy") @Override public void doWork(PowerHandler workProvider) { // TODO Auto-generated method stub } @Method(modid="BuildCraft|Energy") @Override public World getWorld() { return worldObj; } public int getPower() { return power; } public void setPower(int power) { this.power = power; } } I don't think that will work though since it doesn't know what a PowerHandler object is without BC. Can I strip that as well somehow?
-
[Solved][1.7.10] Rendering a cube with scale not working
Alron replied to Alron's topic in Modder Support
Hi yeah it just occured to me that there really was no reason not to do it in glScalef. So I moved it there and it works fine now, thanks! -
[Solved][1.7.10] Rendering a cube with scale not working
Alron replied to Alron's topic in Modder Support
Thanks for the suggestion! Unfortunately that method doesn't seem to exist in Render (which is the parent of the RenderShot) . The shot is also extends EntityFireball and not EntityLivingBase (should have mentioned that in OP). The -1 is because this shot is fired from a cannon, the model for which I made in Techne. When I imported it it screwed up the rotations and such so I just started to change values until it looked right. Thats also the reason for the "shot.getRenderYaw() - (float)Math.PI * 0.5f". Will clean all that rotation stuff up later though, its kinda messy right now. The scaling I'm worried about happens here though: float scale = 0.0625F * shot.getSizeFactor(); LogHelper.info(scale); cubeShot.render(scale); -
[Solved][1.7.10] Rendering a cube with scale not working
Alron replied to Alron's topic in Modder Support
What is that/how do I do it? I've never heard of it. -
I'd guess you have to remove the @SideOnly annotation at the top of your repair table class. I think it causes the constructor of that class to only exist on the client since you commented out the variable below the annotation.
-
[Solved][1.7.10] Rendering a cube with scale not working
Alron replied to Alron's topic in Modder Support
I'm actually doing that, its not the problem. shot.getSizeFactor() returns the correct value on the client and the server side. As I said, the scale is calculated properly and as far as I can tell it really should work. -
Hey everyone I've got a small problem with rendering cubes. I have a RenderShot that should render a shot for an EntityShot, and it basically just renders one cube with varying size. Or at least it should. Here's the code for the renderer: public class RenderShot extends Render{ private ModelBase model = new ModelBase(){}; private ModelRenderer cubeShot; public RenderShot(){ model.textureHeight = 32; model.textureWidth = 64; cubeShot = new ModelRenderer(model); cubeShot.addBox(-2F, -2F, -8F, 4, 4, 16);; cubeShot.setTextureSize(64, 32); } @Override public void doRender(Entity entity, double x, double y, double z, float yaw, float partialTickTime) { EntityShot shot = (EntityShot)entity; GL11.glPushMatrix(); GL11.glTranslatef((float)x, (float)y, (float)z); GL11.glScalef(-1F, -1F, 1F); Minecraft.getMinecraft().getTextureManager().bindTexture(Textures.Model.ENERGY_SHOT); //rotation works cubeShot.rotateAngleX = shot.getRenderPitch(); cubeShot.rotateAngleY = shot.getRenderYaw() - (float)Math.PI * 0.5f; //also correctly calculated float scale = 0.0625F * shot.getSizeFactor(); LogHelper.info(scale); cubeShot.render(scale); GL11.glPopMatrix(); } @Override protected ResourceLocation getEntityTexture(Entity entity) { return Textures.Model.ENERGY_SHOT; } } The problem is that it doesn't vary the size even though the scale calculation clearly works (I know cause I print it out). It always renders all shots the same size, either max scale(wich is a scale of 0.0625) or min scale (wich is about 0.015). It might switch from min to max or the other way around when I restart the game, but it always renders every shot the same size. Does anyone have an idea what could cause that?
-
I think that explains it well enough. Thanks!
-
Ok, I understand why you would use an API. So if I make a mod with Forge, why do I need things from FML in my base mod class? Or could I make a Forge mod without using anything from FML?
-
I know that they are two seperate things, but whats the difference between Forge and FML? What does what? I had no clue what they actually do whan I tried to explain that to someone
-
You need to set the hardness of the block with (yourBlock).setHardness(float hardness). To make it drop something you override this method: public int idDropped(int par1, Random par2Random, int par3). If your looking for some good tutorials, check this out:
-
Thanks a lot for the suggestions, I could fianlly figure it out. Looks like the positioning was off and I had to subtract 1 from posX and posZ to make it work. Don't know how that would make sense but it works now so I'm happy
-
I'm stuck on trying to detect a block in front of an entity. I have some code written for it but its acting really wierd and I can't figure out the error. I have tried to find it for over a day now, its driving me nuts. So here is my code: public boolean checkFrontForBlock(){ int i = (int)Math.round(getRotationY() * 2 / Math.PI) % 4; boolean detected = false; switch(i){ case 0: detected = !worldObj.isAirBlock((int)(posX), (int)(posY), (int)(posZ)-1); break; case 1: detected = !worldObj.isAirBlock((int)(posX)+1, (int)(posY), (int)(posZ)); break; case 2: detected = !worldObj.isAirBlock((int)(posX), (int)(posY), (int)(posZ)+1); break; case 3: detected = !worldObj.isAirBlock((int)(posX)-1, (int)(posY), (int)(posZ)); break; default: System.out.println("Got to default statement"); } System.out.println("Block in front: " + detected + ", i is " + i); return detected; } i is properly calculated and works, just theisAirBlock doesn't. Wich is wierd because the following movement code works no problem: public void moveForward(int distance, float speed){ targetX = (float) (Math.floor(posX)+0.5F); targetZ = (float) (Math.floor(posZ)+0.5F); hasTarget = true; int i = (int)Math.round(getRotationY() * 2 / Math.PI) % 4; switch(i){ case 0: motionZ = -speed; targetZ -= distance; break; case 1: motionX = speed; targetX += distance; break; case 2: motionZ = speed; targetZ += distance; break; case 3: motionX = -speed; targetX -= distance; break; } } A screenshot of the problem to show you how it's not working: The first and the last are detecting a block in front, the two in the middle don't. The first one is facing north, the next one is rotated 90°(east) and so on. So i is 0, 1, 2, 3 from left to right. I hope somebody can help me, because Ijust can't figure it out. >.<
-
Thanks for the answers! readUTF and writeUTF works perfectly for me.
-
I have an issue where sending strings with the PacketHandler inserts some wierd null chars and doesnt send along some chars. I'm currently using this code to send strings: ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); DataOutputStream dataStream = new DataOutputStream(byteStream); try{ dataStream.writeChars(str + "\n"); PacketDispatcher.sendPacketToServer(PacketDispatcher.getPacket(ModInfo.CHANNEL, byteStream.toByteArray())); }catch(IOException ex){ System.err.append("Faild to send String"); } and this to recieve: String str = reader.readLine(); What am I doing wrong, or whats the proper way of sending strings?
-
Thanks, that works. But how can I mark this thread as solved now?
-
Hi, I'm trying to get the itemstack that the player is currently moving around with the mouse in a gui. I looked in GuiContainer, but I couldn't figure out how to get it. Thanks in advance for any help
-
Where should I start to get into more advance modding.
Alron replied to gmod622's topic in Modder Support
I can only recommend the courses from VSWE on youtube: http://www.youtube.com/user/VsweGoesMinecraft?feature=watch He teaches what you need in java as well as modding(from the basics to some advanced stuff) It will take a while to get to the advanced stuff if you are only just learning java now though. -
Hi My mod just wont load. I can run minecraft without any errors, and eclips doesn't show any errors either, but it just doesnt load my mod. It loads Forge, FML and MCP though. Code in my main mod class(as i said, i dont get any errors): http://paste.minecraftforge.net/view/0c7fca4c