Created
January 24, 2012 04:03
-
-
Save d4l3k/1667722 to your computer and use it in GitHub Desktop.
Bukkit Auto Updater
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plugin.is { | |
name "InvincibleTools" | |
version "0.2" | |
author "d4l3k" | |
description "Adds invincible tools & armor to minecraft." | |
} | |
import 'java.util.logging.Logger' | |
import 'java.util.logging.Level' | |
import 'org.bukkit.event.Event' | |
import 'org.bukkit.event.player.PlayerInteractEvent' | |
import 'org.bukkit.event.block.SignChangeEvent' | |
import 'org.bukkit.block.Block' | |
import 'org.bukkit.entity.Player' | |
import 'org.bukkit.ChatColor' | |
import 'org.bukkit.Material' | |
import 'org.bukkit.event.block.Action' | |
import 'org.bukkit.craftbukkit.block.CraftSign' | |
import 'org.bukkit.event.block.SignChangeEvent' | |
import 'org.bukkit.Location' | |
import 'org.bukkit.util.Vector' | |
#requisites | |
import 'org.getspout.spoutapi.SpoutManager' | |
import 'org.getspout.spoutapi.gui.GenericPopup' | |
import 'org.getspout.spoutapi.gui.GenericScrollable' | |
import 'org.getspout.spoutapi.gui.GenericListWidget' | |
import 'org.getspout.spoutapi.gui.ListWidgetItem' | |
import 'org.getspout.spoutapi.gui.GenericLabel' | |
import 'org.getspout.spoutapi.gui.WidgetAnchor' | |
class InvincibleTools < RubyPlugin | |
def onEnable | |
@items = [256,257,258,267,268,269,270,271,272,273,274,275,276,277,278,279,290,291,292,293,294,298,299,300,301,306,307,308,309,310,311,312,313,314,315,316,317,259] | |
registerEvent(Event::Type::PLAYER_INTERACT, Event::Priority::Monitor) do |event| | |
item = event.getItem | |
if item!=nil | |
if @items.include?(item.getTypeId) | |
item.setDurability(-256) | |
end | |
end | |
end | |
end | |
def onDisable | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'xmlsimple' | |
# version = "releases" # Stable Version | |
version = "snapshots" # Unstable Version | |
launch_command = "java -jar bukkit.jar" | |
base_url = 'http://repo.bukkit.org/content/repositories/'+version+'/org/bukkit/craftbukkit/' | |
metadata = 'maven-metadata.xml' | |
xml_data = Net::HTTP.get_response(URI.parse(base_url+metadata)).body | |
config = XmlSimple.xml_in(xml_data) | |
#puts config.to_s | |
latest_primary_version = config["versioning"][0]["latest"][0] | |
puts "Latest CraftBukkit Major Version: #{latest_primary_version}" | |
xml_data = Net::HTTP.get_response(URI.parse(base_url+latest_primary_version+"/"+metadata)).body | |
config = XmlSimple.xml_in(xml_data) | |
#puts config.to_s | |
latest_secondary_version = config["versioning"][0]["snapshotVersions"][0]["snapshotVersion"][0]["value"][0] | |
puts "Latest CraftBukkit Minor Version: #{latest_secondary_version}" | |
url = base_url+latest_primary_version+"/"+"craftbukkit-"+latest_secondary_version+".jar" | |
puts "Download Link: "+url | |
download_command = "rm bukkit_tmp.jar; time axel -a -o bukkit_tmp.jar #{url};mv bukkit_tmp.jar bukkit.jar;#{launch_command}" | |
exec(download_command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment