mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Update sounds to 1.9, fix compile
This commit is contained in:
parent
37c20d5b6d
commit
526118e7d3
3 changed files with 114 additions and 18 deletions
|
@ -1,6 +1,8 @@
|
||||||
package com.earth2me.essentials;
|
package com.earth2me.essentials;
|
||||||
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.attribute.Attribute;
|
||||||
|
import org.bukkit.attribute.AttributeInstance;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.conversations.Conversation;
|
import org.bukkit.conversations.Conversation;
|
||||||
import org.bukkit.conversations.ConversationAbandonedEvent;
|
import org.bukkit.conversations.ConversationAbandonedEvent;
|
||||||
|
@ -98,21 +100,6 @@ public class OfflinePlayer implements Player {
|
||||||
public void setHealth(double d) {
|
public void setHealth(double d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Egg throwEgg() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Snowball throwSnowball() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Arrow shootArrow() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInsideVehicle() {
|
public boolean isInsideVehicle() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -901,6 +888,11 @@ public class OfflinePlayer implements Player {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InventoryView openMerchant(Villager villager, boolean b) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeInventory() {
|
public void closeInventory() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
@ -1101,6 +1093,16 @@ public class OfflinePlayer implements Player {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGlowing(boolean b) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isGlowing() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPlayerWeather(WeatherType arg0) {
|
public void setPlayerWeather(WeatherType arg0) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
@ -1321,8 +1323,73 @@ public class OfflinePlayer implements Player {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void spawnParticle(Particle particle, Location location, int i) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void spawnParticle(Particle particle, double v, double v1, double v2, int i) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void spawnParticle(Particle particle, Location location, int i, T t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void spawnParticle(Particle particle, double v, double v1, double v2, int i, T t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void spawnParticle(Particle particle, Location location, int i, double v, double v1, double v2) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void spawnParticle(Particle particle, double v, double v1, double v2, int i, double v3, double v4, double v5) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void spawnParticle(Particle particle, Location location, int i, double v, double v1, double v2, T t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void spawnParticle(Particle particle, double v, double v1, double v2, int i, double v3, double v4, double v5, T t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void spawnParticle(Particle particle, Location location, int i, double v, double v1, double v2, double v3) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void spawnParticle(Particle particle, double v, double v1, double v2, int i, double v3, double v4, double v5, double v6) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void spawnParticle(Particle particle, Location location, int i, double v, double v1, double v2, double v3, T t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void spawnParticle(Particle particle, double v, double v1, double v2, int i, double v3, double v4, double v5, double v6, T t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendTitle(String title, String subtitle) {
|
public void sendTitle(String title, String subtitle) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AttributeInstance getAttribute(Attribute attribute) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -134,8 +134,15 @@ public class Commandessentials extends EssentialsCommand {
|
||||||
if (note == null || note.isEmpty()) {
|
if (note == null || note.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Sound noteHarp;
|
||||||
|
try {
|
||||||
|
noteHarp = Sound.valueOf("NOTE_PIANO"); // pre-1.9, referenced internally as note.harp
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
noteHarp = Sound.valueOf("BLOCK_NOTE_HARP"); // 1.9
|
||||||
|
}
|
||||||
|
|
||||||
for (Player onlinePlayer : ess.getOnlinePlayers()) {
|
for (Player onlinePlayer : ess.getOnlinePlayers()) {
|
||||||
onlinePlayer.playSound(onlinePlayer.getLocation(), Sound.NOTE_PIANO, 1, noteMap.get(note));
|
onlinePlayer.playSound(onlinePlayer.getLocation(), noteHarp, 1, noteMap.get(note));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 20, 2);
|
}, 20, 2);
|
||||||
|
@ -155,19 +162,25 @@ public class Commandessentials extends EssentialsCommand {
|
||||||
private final String[] playerMoo = new String[]{" (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..."};
|
private final String[] playerMoo = new String[]{" (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..."};
|
||||||
|
|
||||||
private void run_moo(final Server server, final CommandSource sender, final String command, final String args[]) {
|
private void run_moo(final Server server, final CommandSource sender, final String command, final String args[]) {
|
||||||
|
Sound moo;
|
||||||
|
try {
|
||||||
|
moo = Sound.valueOf("COW_IDLE"); // pre-1.9
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
moo = Sound.valueOf("ENTITY_COW_MILK"); // 1.9
|
||||||
|
}
|
||||||
if (args.length == 2 && args[1].equals("moo")) {
|
if (args.length == 2 && args[1].equals("moo")) {
|
||||||
for (String s : consoleMoo) {
|
for (String s : consoleMoo) {
|
||||||
logger.info(s);
|
logger.info(s);
|
||||||
}
|
}
|
||||||
for (Player player : ess.getOnlinePlayers()) {
|
for (Player player : ess.getOnlinePlayers()) {
|
||||||
player.sendMessage(playerMoo);
|
player.sendMessage(playerMoo);
|
||||||
player.playSound(player.getLocation(), Sound.COW_IDLE, 1, 1.0f);
|
player.playSound(player.getLocation(), moo, 1, 1.0f);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (sender.isPlayer()) {
|
if (sender.isPlayer()) {
|
||||||
sender.getSender().sendMessage(playerMoo);
|
sender.getSender().sendMessage(playerMoo);
|
||||||
final Player player = sender.getPlayer();
|
final Player player = sender.getPlayer();
|
||||||
player.playSound(player.getLocation(), Sound.COW_IDLE, 1, 1.0f);
|
player.playSound(player.getLocation(), moo, 1, 1.0f);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sender.getSender().sendMessage(consoleMoo);
|
sender.getSender().sendMessage(consoleMoo);
|
||||||
|
|
|
@ -5,6 +5,10 @@ import com.earth2me.essentials.craftbukkit.FakeWorld;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.Warning.WarningState;
|
import org.bukkit.Warning.WarningState;
|
||||||
import org.bukkit.World.Environment;
|
import org.bukkit.World.Environment;
|
||||||
|
import org.bukkit.boss.BarColor;
|
||||||
|
import org.bukkit.boss.BarFlag;
|
||||||
|
import org.bukkit.boss.BarStyle;
|
||||||
|
import org.bukkit.boss.BossBar;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
|
@ -16,6 +20,7 @@ import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
import org.bukkit.help.HelpMap;
|
import org.bukkit.help.HelpMap;
|
||||||
import org.bukkit.inventory.*;
|
import org.bukkit.inventory.*;
|
||||||
import org.bukkit.map.MapView;
|
import org.bukkit.map.MapView;
|
||||||
|
@ -34,6 +39,7 @@ import org.bukkit.util.CachedServerIcon;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
@ -909,6 +915,16 @@ public class FakeServer implements Server {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChunkGenerator.ChunkData createChunkData(World world) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BossBar createBossBar(String s, BarColor barColor, BarStyle barStyle, BarFlag... barFlags) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UnsafeValues getUnsafe() {
|
public UnsafeValues getUnsafe() {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
|
Loading…
Reference in a new issue