Closed Tarig0 closed 11 years ago
just go into my fork and fork it from there I think
Shoot, having trouble getting it set up, and I don't have time to wrestle with github right now, so I'll just paste here some completely untested code that you can try:
@Override
public boolean isLadder(World world, int x, int y, int z,EntityLiving entity)
{
TileEntity tile2 = world.getBlockTileEntity(x, y, z);
if (tile2 != null && (tile2 instanceof TileEntityLittleChunk))
{
TileEntityLittleChunk tile = (TileEntityLittleChunk) tile2;
int i = MathHelper.floor_double(entity.posX * (double)tile.size);
int j = MathHelper.floor_double(entity.boundingBox.minY * (double)tile.size);
int k = MathHelper.floor_double(entity.posZ * (double)tile.size);
int blockid = tile.getBlockID(i % tile.size, j % tile.size, k % tile.size);
return Block.blocksList[blockid] != null && Block.blocksList[blockid].isLadder((World) tile.getLittleWorld(), i, j, k, entity);
}
return false;
}
It's basically the same way vanilla Minecraft handles the ladder, by just checking the one lil'block. Only players around tiny size and mobs of very small width could use them.
No casting safety? How exotic! :P
EDIT: <3
That would be a much cleaner way to do things, unfortunately I want this to work for players that don't have Gulliver installed. That's the only reason why I scan the horizontal square around the entity for the ladder. What we could do is add in a if statement to check if entity width <= 1/7 or 1/8 meter and use this bit of code there
btw if you use javaclose it with another
you can format your code ` is on the ~ key
ah figured out why you can't fork my repo @UncleMion you need to delete the fork you already created since you can't have two repos with the same name
Ah, I see; I had the impression that you only wanted to allow tiny players to use the ladders. My bad.
I've got code in my EntityLiving.isOnLadder() that does a similarish check on surrounding blocks. I'll use that to do a different isLadder() after I fix the fork.
By the way, java wasn't formatting my code correctly, so I just put it back to the
that I had before. Is ``` supposed to do syntax checking when you put "java" in front? Does it not work on blocks of code?
EDIT: grr I need to figure out this markdown syntax, wish I had a preview button when editing a comment...
sorry put java on the inside of the first ```
you can escape ` with the \ character
Thanks :)
oo to clarify my intent I want to allow regular players to use LB ladders only if Gulliver is not installed if it is I want them to follow your rules, I figured half size was small enough since giants can use regular ladders some how
there we go much better handling, now to check with guliver
hmm can't figure out why but with Gulliver I can only climb things on the lowest X (WEST) side of a little chunk. Works fine without Gulliver. Think it's in your ballpark mion.
Will test this tonight
how'd the testing go?
Nothing from testing?
Hi Guys, Looks like something is broken with the calculations. Just testing in 1.6.2 just a straight pull over and the calculation doesn't seem to be working as intended.
Tarig, are you able to pull the 1.6.2 branch and do some testing yourself please.
I'll commit the code that I've pulled over for now.
Ill add this as an issue instead.
Resolved in ff612c0c4643b4fc09f500cd7d9d270d0635781c
I think I have a simpler and cleaner way to code that isLadder() method. What do I need to do? Do I make another fork from yours and then commit that?