Archived
Merge remote-tracking branch 'origin/dev'
This commit is contained in:
+16
-10
@@ -1,5 +1,9 @@
|
|||||||
from helpers import *
|
from helpers import *
|
||||||
from basecommands import simplecommand
|
from basecommands import simplecommand
|
||||||
|
import org.bukkit.event.block.BlockBreakEvent as BlockBreakEvent
|
||||||
|
import org.bukkit.block.Furnace as Furnace
|
||||||
|
import org.bukkit.inventory.ItemStack as ItemStack
|
||||||
|
import org.bukkit.Material as Material
|
||||||
|
|
||||||
denyslabcorrection = open_json_file("denyslabcorrection", []) #Players that don't want slabs corrected
|
denyslabcorrection = open_json_file("denyslabcorrection", []) #Players that don't want slabs corrected
|
||||||
denyautofill = open_json_file("denyautocauldronfill", [])
|
denyautofill = open_json_file("denyautocauldronfill", [])
|
||||||
@@ -93,11 +97,15 @@ def on_block_place(event):
|
|||||||
return
|
return
|
||||||
uuid = uid(player)
|
uuid = uid(player)
|
||||||
block = event.getBlockPlaced()
|
block = event.getBlockPlaced()
|
||||||
if uuid not in denyslabcorrection and str(block.getType()) in ("WOOD_STEP", "STEP") and block.getData() < 8:
|
material = str(block.getType())
|
||||||
|
if uuid not in denyslabcorrection and material in ("WOOD_STEP", "STEP") and block.getData() < 8:
|
||||||
block.setData(block.getData() + 8) # Flip upside down
|
block.setData(block.getData() + 8) # Flip upside down
|
||||||
elif uuid not in denyautofill and str(block.getType()) == "CAULDRON":
|
elif uuid not in denyautofill and material == "CAULDRON":
|
||||||
block.setData(3) #3 layers of water, 3 signal strength
|
block.setData(3) #3 layers of water, 3 signal strength
|
||||||
|
elif material == "FURNACE":
|
||||||
|
state = block.getState()
|
||||||
|
state.getInventory().setSmelting(ItemStack(Material.REDSTONE))
|
||||||
|
state.update()
|
||||||
|
|
||||||
@hook.event("player.PlayerInteractEvent", "monitor")
|
@hook.event("player.PlayerInteractEvent", "monitor")
|
||||||
def on_interact(event):
|
def on_interact(event):
|
||||||
@@ -109,10 +117,8 @@ def on_interact(event):
|
|||||||
if event.hasItem() and not str(event.getItem().getType()) == "REDSTONE":
|
if event.hasItem() and not str(event.getItem().getType()) == "REDSTONE":
|
||||||
return
|
return
|
||||||
block = event.getClickedBlock()
|
block = event.getClickedBlock()
|
||||||
if str(block.getType()) == "CAULDRON" and block.getData() > 0:
|
event2 = BlockBreakEvent(block, player)
|
||||||
block.setData(block.getData() - 1) #Lower water level by one
|
server.getPluginManager().callEvent(event2)
|
||||||
|
data = block.getData()
|
||||||
|
if not event2.isCancelled() and str(block.getType()) == "CAULDRON":
|
||||||
|
block.setData(data - 1 if data > 0 else 3)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from helpers import *
|
|||||||
# receive info based on the user's IP. information provided by ipinfo.io
|
# receive info based on the user's IP. information provided by ipinfo.io
|
||||||
def ip_info(player):
|
def ip_info(player):
|
||||||
if player.isOnline():
|
if player.isOnline():
|
||||||
return json.load(urllib2.urlopen("https://ipinfo.io%s/json" % str(player.getAddress().getAddress())))
|
return json.load(urllib2.urlopen("http://ipinfo.io%s/json" % str(player.getAddress().getAddress())))
|
||||||
else:
|
else:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
@@ -42,6 +42,11 @@ def get_website_data(player):
|
|||||||
return ("http://redstoner.com/users/%s" % results[0][0], results[0][1]) if results else (None, None)
|
return ("http://redstoner.com/users/%s" % results[0][0], results[0][1]) if results else (None, None)
|
||||||
|
|
||||||
|
|
||||||
|
# receive country based on the user's IP
|
||||||
|
def get_country(data):
|
||||||
|
return str(data.get("country"))
|
||||||
|
|
||||||
|
|
||||||
def get_all_names(player):
|
def get_all_names(player):
|
||||||
uuid = str(uid(player)).replace("-", "")
|
uuid = str(uid(player)).replace("-", "")
|
||||||
names = json.load(urllib2.urlopen("https://api.mojang.com/user/profiles/%s/names" % uuid))
|
names = json.load(urllib2.urlopen("https://api.mojang.com/user/profiles/%s/names" % uuid))
|
||||||
@@ -64,8 +69,7 @@ def get_all_data(sender, player):
|
|||||||
msg(sender, "&6> Website account: &e%s" % website[0])
|
msg(sender, "&6> Website account: &e%s" % website[0])
|
||||||
msg(sender, "&6> email: &e%s" % website[1])
|
msg(sender, "&6> email: &e%s" % website[1])
|
||||||
msg(sender, "&7 -- Data provided by ipinfo.io")
|
msg(sender, "&7 -- Data provided by ipinfo.io")
|
||||||
msg(sender, "&6> Country: &e%s" % str(data.get("country")))
|
msg(sender, "&6> Country: &e%s" % get_country(data))
|
||||||
msg(sender, "&6> Network: &e%s" % str(data.get("org")))
|
|
||||||
msg(sender, "&7 -- Data provided by Mojang")
|
msg(sender, "&7 -- Data provided by Mojang")
|
||||||
msg(sender, "&6> All ingame names used so far: &e%s" % get_all_names(player))
|
msg(sender, "&6> All ingame names used so far: &e%s" % get_all_names(player))
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user