mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Made Requested Changes
This commit is contained in:
parent
bac456da25
commit
8a56939931
@ -99,7 +99,7 @@ public abstract class AReactor extends SlimefunItem {
|
|||||||
}
|
}
|
||||||
BlockMenu ap = getAccessPort(b.getLocation());
|
BlockMenu ap = getAccessPort(b.getLocation());
|
||||||
if(ap != null) {
|
if(ap != null) {
|
||||||
menu.replaceExistingItem(infoSlot, new CustomItem(new ItemStack(Material.GREEN_WOOL), "&7Access Port", "", "&6Detected", "", "&7> Click to open Access Port"));
|
menu.replaceExistingItem(infoSlot, new CustomItem(new ItemStack(Material.GREEN_WOOL), "&7Access Port", "", "&6Detected", "", "&7> Click to view Access Port"));
|
||||||
menu.addMenuClickHandler(infoSlot, (p, slot, item, action) -> {
|
menu.addMenuClickHandler(infoSlot, (p, slot, item, action) -> {
|
||||||
ap.open(p);
|
ap.open(p);
|
||||||
newInstance(menu, b);
|
newInstance(menu, b);
|
||||||
@ -107,7 +107,7 @@ public abstract class AReactor extends SlimefunItem {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
menu.replaceExistingItem(infoSlot, new CustomItem(new ItemStack(Material.RED_WOOL), "&7Access Port", "", "&cNot Detected", "", "&7Access Port Must Be", "&7Placed 3 Blocks Above", "&7Reactor!"));
|
menu.replaceExistingItem(infoSlot, new CustomItem(new ItemStack(Material.RED_WOOL), "&7Access Port", "", "&cNot detected", "", "&7Access Port must be", "&7placed 3 blocks above", "&7a reactor!"));
|
||||||
menu.addMenuClickHandler(infoSlot, (p, slot, item, action) -> {
|
menu.addMenuClickHandler(infoSlot, (p, slot, item, action) -> {
|
||||||
newInstance(menu, b);
|
newInstance(menu, b);
|
||||||
menu.open(p);
|
menu.open(p);
|
||||||
|
@ -48,6 +48,11 @@ public class ReactorAccessPort extends SlimefunItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canOpen(Block b, Player p) {
|
public boolean canOpen(Block b, Player p) {
|
||||||
|
if(p.hasPermission("slimefun.inventory.bypass") || CSCoreLib.getLib().getProtectionManager().canAccessChest(p.getUniqueId(),b,true)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
AReactor reactor = getReactor(b.getLocation());
|
AReactor reactor = getReactor(b.getLocation());
|
||||||
if(reactor != null) {
|
if(reactor != null) {
|
||||||
boolean empty = true;
|
boolean empty = true;
|
||||||
@ -60,7 +65,7 @@ public class ReactorAccessPort extends SlimefunItem {
|
|||||||
if(bm.getItemInSlot(slot) != null)
|
if(bm.getItemInSlot(slot) != null)
|
||||||
empty = false;
|
empty = false;
|
||||||
|
|
||||||
if(!p.isSneaking() && !empty && (p.hasPermission("slimefun.inventory.bypass") || CSCoreLib.getLib().getProtectionManager().canAccessChest(p.getUniqueId(),b,true))) {
|
if(!empty || !p.isSneaking()) {
|
||||||
//reactor is not empty, lets view it's inventory instead.
|
//reactor is not empty, lets view it's inventory instead.
|
||||||
bm.open(p);
|
bm.open(p);
|
||||||
return false;
|
return false;
|
||||||
@ -198,9 +203,11 @@ public class ReactorAccessPort extends SlimefunItem {
|
|||||||
public BlockMenu getReactorMenu(Location l) {
|
public BlockMenu getReactorMenu(Location l) {
|
||||||
Location reactorL = new Location(l.getWorld(), l.getX(), l.getY() - 3, l.getZ());
|
Location reactorL = new Location(l.getWorld(), l.getX(), l.getY() - 3, l.getZ());
|
||||||
|
|
||||||
if (BlockStorage.check(reactorL, "NUCLEAR_REACTOR")) return BlockStorage.getInventory(reactorL);
|
SlimefunItem item = BlockStorage.check(reactorL);
|
||||||
|
|
||||||
|
if(item != null && (item.getID().equals("NUCLEAR_REACTOR") || item.getID().equals("NETHERSTAR_REACTOR")))
|
||||||
|
return BlockStorage.getInventory(reactorL);
|
||||||
|
|
||||||
if (BlockStorage.check(reactorL, "NETHERSTAR_REACTOR")) return BlockStorage.getInventory(reactorL);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user