Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for buttons appearing on Stargates in a fixed direction. #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/Portal.java
Expand Up @@ -607,6 +607,47 @@ public static Portal createPortal(SignPost id, Player player) {
} else {
Blox button = topleft.modRelative(buttonVector.getRight(), buttonVector.getDepth(), buttonVector.getDistance() + 1, modX, 1, modZ);
button.setType(BUTTON);

// start Hidendra
/* dirty hacks */

Block.Face[] faces = new Block.Face[] {
Block.Face.Front, Block.Face.Left, Block.Face.Right, Block.Face.Back
};

// we want THE OBSIDIAN
for(Block.Face face : faces) {
Block blockFace = button.getBlock().getFace(face);

if(blockFace.getType() != OBSIDIAN) {
continue;
}

switch(face) {
case Front: // SOUTH - 0x01
button.setData(0x02); // inverse the button dir (south->N)

break;

case Left: // EAST - 0x03
button.setData(0x04);

break;

case Right: // WEST - 0x04
button.setData(0x03);

break;

case Back: // NORTH - 0x02
button.setData(0x01);

break;

}
}

// end

portal = new Portal(topleft, modX, modZ, rotX, id, button, "", name, true, network, gate, player.getName());
}
Expand Down