Help with use of Block 36

Discussion in 'Plugin Development' started by monster860, Nov 21, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    monster860

    I am making an elevator plugin that uses Block 36. I am using block 36 so that I have a smooth transition. The problem is, that the block acts like the tile entity is missing client-side. Is this fixable? and if it is, how do you fix it?

    Code:
    Code:
    public void moveOneDown() {
            for (int x = elevatorX; x <= elevatorX + elevatorWidth; x++)
                for (int y = elevatorY; y <= elevatorY + elevatorHeight; y++)
                    for (int z = elevatorZ; z <= elevatorZ + elevatorDepth; z++)
                    {
                        Block block = world.getBlockAt(x,y,z);
                        Block block1 = world.getBlockAt(x,y - 1,z);
                        if (block.getTypeId() != 0)
                        {
                            TileEntityPiston tep;
                            int id = block.getTypeId();
                            byte data = block.getData();
                            block.setTypeIdAndData(0, (byte)0, true);
                            block1.setTypeIdAndData(36, (byte)4, true);
                            CraftBlock cb = (CraftBlock)block;
                            CraftChunk cc = (CraftChunk)cb.getChunk();
                            net.minecraft.server.World nmsw = cc.getHandle().world;
                            tep = new TileEntityPiston(id, data, 2, true, true);
                            nmsw.setTileEntity(x, y - 1, z, tep);
                        }
                    }
            elevatorY--;
        }
       
        public void moveOneUp() {
            for (int x = elevatorX; x <= elevatorX + elevatorWidth; x++)
                for (int y = elevatorY + elevatorHeight; y >= elevatorY; y--)
                    for (int z = elevatorZ; z <= elevatorZ + elevatorDepth; z++)
                    {
                        Block block = world.getBlockAt(x,y,z);
                        Block block1 = world.getBlockAt(x,y + 1,z);
                        if (block.getTypeId() != 0)
                        {
                            TileEntityPiston tep;
                            int id = block.getTypeId();
                            byte data = block.getData();
                            block.setTypeIdAndData(0, (byte)0, true);
                            block1.setTypeIdAndData(36, (byte)4, true);
                            CraftBlock cb = (CraftBlock)block;
                            CraftChunk cc = (CraftChunk)cb.getChunk();
                            net.minecraft.server.World nmsw = cc.getHandle().world;
                            tep = new TileEntityPiston(id, data, 1, true, true);
                            nmsw.setTileEntity(x, y + 1, z, tep);
                        }
                    }
            elevatorY++;
        }
     
  2. monster860 Why re-create the wheel instead of helping improving V10lift?

    Also I don't think what you want to do is possible. AFAIK (correct me if I'm wrong) block 36 is always invisible, just holding a copy of the original block while the client renders the moving animation triggered by the piston.

    I have another idea for smooth movement, but as it seems like you're developing a direct concurrency plugin to V10lift I won't tell you. Also I don't have the time to implement it in V10Lift atm. :(
     
  3. Offline

    monster860

    Can I guess that your idea is to use falling sand blocks?

    Besides, you should give your plugin a less obscure name if you want people to find it if they're looking for an elevator.
     
  4. Offline

    desht

    Actually, "lift" is a commonly-used term in various countries for the device known in the US as an "elevator". This is an international community, remember :)
     
    ZeusAllMighty11 and fireblast709 like this.
  5. monster860 Something like that, yes. And I'm from germay, we say "Lift" or "Aufzug" here. Didn't know that this wasn't known in US.
     
Thread Status:
Not open for further replies.

Share This Page