Everything posted by kc9zda
-
[1.7.2] Custom tree grow bug
The only problem I can think of is that you notify nearby blocks. The logs probably rotate accordingly.
-
[unsolved][1.7.2]How can i make a block that only emits light at night
This example may work on 1.7.2, but I know it works on 1.6.2. If you do not know how to use tile entities, please see the tutorial on the wiki. Now, on your updateEntity method, you should have something similar to: public void updateEntity() { boolean isDay = this.worldObj.isDaytime(); if (isDay && this.worldObj.getBlockId(this.posX, this.posY, this.posZ) == ModBlocks.litBlock.blockId) { this.worldObj.setBlock(this.posX, this.posY, this.posZ, ModBlocks.darkBlock.blockId); } else { if (!isDay && this.worldObj.getBlockId(this.posX, this.posY, this.posZ) == ModBlocks.darkBlock.blockId) { this.worldObj.setBlock(this.posX, this.posY, this.posZ, ModBlocks.litBlock.blockId); } } } This is a start, but there may be some unwanted happenings once the block changes, because Minecraft probably won't like the block changing, but not the tile entity. I also didn't include the server-client syncing code (to sync with the server).
-
[1.6.2]Clear cube-shaped area in world
I had something similar to what Draco18s had but each is in a different method: private void clearAreaCube(int x, int z, int , int zd, int y, int yd, World w) { int i = 1; while (i <= ) { clearColumnRow(x+i, z, zd, y, yd, w); i++; } } private void clearColumnRow(int i, int z, int zd, int y, int yd, World w) { int j = 1; while (j <= zd) { clearColumn(i, z+j, y, yd, w); j++; } } private void clearColumn(int i, int j, int y, int yd, World w) { int k = 1; while (k <= yd) { w.setBlockToAir(i, j, y+k); k++; } } , yd, and zd are the change in x, y and z respectively. I originally had three nested while loops and it only cleared one row of blocks. I just tried the alternative code that was suggested, and it cleared no more than last time. Both pieces of code seemed to clear trees completely from the cube, but I just think that they didn't spawn. After that, I took out the clearing code and placed the structure on the first level that could see the sky (it works in most worlds). Thanks for your help anyway.
-
[1.6.2]Clear cube-shaped area in world
I am trying to put a platform for the player to spawn on and I want all of the platform to be at least visible and I want the player to be able to spawn on it. Currently, if it is in the side of a hill, it is useless, if it is under a tree, the player spawns on top of the tree instead of on the platform. That is why I want to clear a 9 block high area above the platform. I have code to do it, but it doesn't work. I have three nested while loops (one for x, y, and z) and it uses World.setBlockToAir. It only seems to clear either one part of a row or none at all.
-
Find Entity at coordinates XYZ
Yes that was the method I was talking about.
-
Ore generator help
In LotsOfCoalsMain.java, I think that returning the return value from eventmanager() will not work because I think it would cause an infinite loop trying to get the return value. Maybe replace that with "return new EventManager();"?
-
Find Entity at coordinates XYZ
Hello, I want to find an Entity at a set of coordinates specified. I need will need to access the fields of that Entity class. I am already using World.getClosestPlayer(X,Y,Z,4.0), but I don't want to access an Entity standing behind me. I have code written to try to figure out if that Entity is standing in view by comparing it to my look vector, but I don't think that the look vector would work completely. Is there some world function that finds the Entity at XYZ Coordinates and returns a reference to that Entity?
IPS spam blocked by CleanTalk.