
Yagoki
Members-
Posts
290 -
Joined
-
Last visited
Everything posted by Yagoki
-
there are methods called getDatapacket and onDataPacketrecived in the TileEntity. These get passed from the server to the client every time the block is marked for an update (via world.markBlockForUpdate). You can write the NBT for the server tile to the packet sent form this, then read it on the client. That's how i do it for one of my tile entities, Not quite as complex as yours but it should still apply.
-
You may want to take a look at your variables i j and k, This may be causing your null pointer. Also, be careful using static variables here because you could get problems concerning threading. Try putting this into the block or a TileEntity instead as a local method and pass it the required parameters through the method. Personally i'd also suggest (just as a bit of cleanup) that you reuse your parX variables so you only have one, and reassign it new values, this will just free up a small amount of memory space and make things look nicer. public class MyTE extends TileEntity { @Override public void onUpdate() { if(this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { int id = this.worldObj.getBlockId(xCoord+1, yCoord, zCoord); if(id==1) world.setBlockId(xCoord+1, yCoord, zCoord, 0); id = this.worldObj.getBlockId(xCoord+1, yCoord+1, zCoord); if(id==1) world.setBlockId(xCoord+1, yCoord+1, zCoord, 0); //and so on } } } He is calling this from his block, in the on neighbor block changed, so it is called only when the block is in the world however yes he should be doing it in his block/tileEntity
-
Yes it's because of the server and client threads. If you only want it called on one side use an if statement, with world.isRemote which returns true on the client and false on the server. This shouldn't cause a problem, normally you want to do things on both, but sometimes you will only want t do it on the server, and very very rarely you may want to do something only on the client (although i'm not sure why)
-
First, reobf doesn't move your textures, so if you haven't you will manually need to move them into your zip. If you've done this, make sure your texture paths are "modzipfile.zip/mods/items/ItemTexture.png" yes you need to include the mods package INSIDE your zip. If you've done all this read the console output when minecraft is launching, you may need to use multiMC or something, and it will say that it could not find the texture files and give you the path it looked in, make sure your path matches this.
-
Here is how I handle packets for my tile entities, should be similar for other things too. also here is how i'm sending the packets ByteArrayOutputStream bos = new ByteArrayOutputStream(s.length() + 12); DataOutputStream outputStream = new DataOutputStream(bos); try { outputStream.writeInt(x); outputStream.writeInt(y); outputStream.writeInt(z); outputStream.writeUTF(s); } catch (IOException e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = MyPacketHandler.proxDet; packet.data = bos.toByteArray(); packet.length = bos.size(); PacketDispatcher.sendPacketToServer(packet); full class here
-
Minecraft Crashing, but I don't know why. (failed to start game)
Yagoki replied to jordsta95's topic in Modder Support
!?!?!?! Try updating forge, it defiantly worked in my multiMC. if that STILL doesn't work double make sure you are using the zip that I linked, If still nothing pm me and i'll try to sort this through skype or something. it will probably be faster that way. -
Minecraft Crashing, but I don't know why. (failed to start game)
Yagoki replied to jordsta95's topic in Modder Support
OK, I got it working for you, I'll just post the file and you should be able to see what I did: http://www.mediafire.com/download/vjphxh5af5jzvfz/EverythingAndMore(1).zip quite a few people seem to be making this mistake, can't wait for everyone to trip over the 1.6 update when that happens . YAY more layout changes! -
Minecraft Crashing, but I don't know why. (failed to start game)
Yagoki replied to jordsta95's topic in Modder Support
what do you put inside your zip folder? show me that. just downloaded it to see how it is in the current version you've got no the forums, and your package layout is massively different to how it is in the screenshots you showed. -
Minecraft Crashing, but I don't know why. (failed to start game)
Yagoki replied to jordsta95's topic in Modder Support
you need an @Instance annotation @Mod(modid = "TestMod", name = "TestMod", version = "0.0.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class TestMod { @Instance("TestMod") //these lines need to public static TestMod instance; //be added @SidedProxy(clientSide = SourcePaths.MainPath + "client.ClientProxy", serverSide = SourcePaths.MainPath + "common.CommonProxy") public static CommonProxy proxy; @PreInit public static void preInit(FMLPreInitializationEvent evt) { } @Init public static void init(FMLInitializationEvent evt) { } @PostInit public static void postInit(FMLPostInitializationEvent evt) { } } -
Minecraft Crashing, but I don't know why. (failed to start game)
Yagoki replied to jordsta95's topic in Modder Support
-
Minecraft Crashing, but I don't know why. (failed to start game)
Yagoki replied to jordsta95's topic in Modder Support
Hmmm.... can I see the code in your main file too, I've got a feeling it's something with your annotations but I can't be sure. This does seem like an odd one... -
[SOLVED]Textures not loading IN Minecraft (they do in Eclipse)
Yagoki replied to AndrewSherman's topic in Modder Support
you need to include mods. in the zipped package (so it'd be mods.Graveyards_Mod.blocks.texture.png for example) like this umm... i'm not sure what to say? did you learn java? the this. ensures that the variable being referenced is the one local to the class/object, it exists so we can do things like: public class Foo { public int bar = 0; public void setBar(int bar) { this.bar = bar; } //Alternatively you could do public void setBar(int b) { bar = b; } } the use if it is only required when there is a variable in the method with the same name, and is sometimes used outside this condition to clarify that this parameter belongs to this object, not just the method. the lack of a this. in the case you are showing wouldn't even matter and, if it did cause a problem, it would be visible inside eclipse. -
Minecraft Crashing, but I don't know why. (failed to start game)
Yagoki replied to jordsta95's topic in Modder Support
any chance you could show us a pic of your setup when doing this (i.e. file paths/directories...)? It appears to be looking for the following class "Everything_and_More_Mod", my hunch is that you've got it in the wrong file or a different file to what you've said it in. Also show us that file and your main mod file so i can see if it is what i think it is. -
[Unsolved] Texture location with non-standard modding environment
Yagoki replied to SamTebbs33's topic in Modder Support
You seem to need to put it into the same source folder as your code since the 1.5 (at least I've been unable to get it to work like that) (just showing my packages for an example of what i mean) in textures there are /items/ and /blocks/ sub directories. -
... because for some reason that wasn't the first thing I tried... I'm not just going to copy paste code if I don't understand how it works, that's just not good practice.
-
... not useful.
-
Thought I would try to make the network system in my mod look cool by making it have a similar style to the achievement page, However when I started to look through the code for the achievement page i was met by a welcoming party of lots of scary GL11 stuff (I really need to get round to learning to use this stuff, any hints where to start with that?). Anyway, I was wandering if you guys help me to figure out what is required to creating a style like that, as I was just got lost fairly quickly (due to my confusion when it comes to GL11 , also this cold and three maths exams in one day probably isn't helping me).
-
This works: public class TestBlock extends Block { public TestBlock(int par1, Material par2Material) { super(par1, par2Material); } @Override public boolean hasTileEntity(int metadata) { return true; } @Override public TileEntity createTileEntity(World world, int metadata) { return new TestTileEntity(); } } the tile entity (nothing special here): public class TestTileEntity extends TileEntity { @Override public void updateEntity() { System.out.println("Hello World : " + this.worldObj.isRemote); } } this was called on both sides, not sure what was wrong with yours, it could be something with ITileProvider, but I couldn't see anything obvious as to what it may be. Your other option is to extend ContainerBlock instead of using ITileProvideras this also works
-
no Scala is just an additional language which forge gives support for, Not having it doesn't have an effect on anything (other than you cant use it)
-
that's odd. Can I see your block and the tile entity?
-
create a tile entity and use the updateEntity() method
-
That's fine. It's all open source anyway, so you can find it all on my github if you need it. I will say however that before blindly copying code, make sure you understand it and the programming concepts involved in how it was written.