mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2025-02-16 12:21:20 +01:00
Added portal rotating
This commit is contained in:
parent
a53563f02e
commit
09c7ed656e
@ -4,6 +4,7 @@ import com.sekwah.advancedportals.core.data.PlayerLocation;
|
||||
import com.sekwah.advancedportals.core.data.PortalLocation;
|
||||
import com.sekwah.advancedportals.core.util.Lang;
|
||||
import com.sekwah.advancedportals.coreconnector.container.PlayerContainer;
|
||||
import com.sekwah.advancedportals.coreconnector.container.WorldContainer;
|
||||
|
||||
public class CoreListeners {
|
||||
|
||||
@ -95,6 +96,16 @@ public class CoreListeners {
|
||||
AdvancedPortalsCore.getPortalManager().playerSelectorActivate(player, blockLoc, leftClick);
|
||||
return false;
|
||||
}
|
||||
else if(leftClick || itemName.equals("\u00A75Portal Block Placer")) {
|
||||
WorldContainer world = player.getWorld();
|
||||
if(world.getBlockData(blockLoc) == 1) {
|
||||
world.setBlockData(blockLoc, (byte) 2);
|
||||
}
|
||||
else {
|
||||
world.setBlockData(blockLoc, (byte) 1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class EndGatewayBlockSubCommand implements SubCommand {
|
||||
sender.sendMessage(Lang.translateColor("messageprefix.negative") + Lang.translate("command.playeronly"));
|
||||
}
|
||||
else {
|
||||
player.giveItem(this.portalsCore.getConfig().getSelectorMaterial(), "\u00A78Gateway Block Placer"
|
||||
player.giveWool("BLACK", "\u00A78Gateway Block Placer"
|
||||
, "\u00A7rThis wool is made of a magical substance",
|
||||
"\u00A7rRight Click: Place portal block");
|
||||
sender.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translate("command.gatewayblock"));
|
||||
|
@ -23,7 +23,7 @@ public class EndPortalBlockSubCommand implements SubCommand {
|
||||
sender.sendMessage(Lang.translateColor("messageprefix.negative") + Lang.translate("command.playeronly"));
|
||||
}
|
||||
else {
|
||||
player.giveItem(this.portalsCore.getConfig().getSelectorMaterial(), "\u00A78End Portal Block Placer"
|
||||
player.giveWool("BLACK", "\u00A78End Portal Block Placer"
|
||||
, "\u00A7rThis wool is made of a magical substance",
|
||||
"\u00A7rRight Click: Place portal block");
|
||||
sender.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translate("command.endportalblock"));
|
||||
|
@ -23,7 +23,7 @@ public class PortalBlockSubCommand implements SubCommand {
|
||||
sender.sendMessage(Lang.translateColor("messageprefix.negative") + Lang.translate("command.playeronly"));
|
||||
}
|
||||
else {
|
||||
player.giveItem(this.portalsCore.getConfig().getSelectorMaterial(), "\u00A75Portal Block Placer"
|
||||
player.giveWool("PURPLE", "\u00A75Portal Block Placer"
|
||||
, "\u00A7rThis wool is made of a magical substance",
|
||||
"\u00A7rRight Click: Place portal block",
|
||||
"\u00A7rLeft Click: Rotate portal block");
|
||||
|
@ -47,6 +47,8 @@ public class PlayerContainer {
|
||||
return this.player.hasPermission(permission);
|
||||
}
|
||||
|
||||
public WorldContainer getWorld() {return null;}
|
||||
|
||||
/**
|
||||
* @param blockPos
|
||||
* @param material
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.sekwah.advancedportals.coreconnector.container;
|
||||
|
||||
import com.sekwah.advancedportals.core.data.PortalLocation;
|
||||
|
||||
public class WorldContainer {
|
||||
|
||||
public void setBlock(PortalLocation location, String material) {
|
||||
}
|
||||
|
||||
public void setBlockData(PortalLocation location, byte data) {
|
||||
}
|
||||
|
||||
public String getBlock(PortalLocation location) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public byte getBlockData(PortalLocation location) {
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user